-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Refactor ZeRO configs to use Pydantic #2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Wonderful! Thank you for the heads up, Jeff! Also probably extending hjson-support to the rest of DS config would be great, but doesn't have to be part of this PR - just a suggestion. |
|
Absolutely, I think adding hjson + pydantic support is the eventual goal. Once all of our configs are managed by pydantic the goal is to also replace the config-json page with a read-the-docs style page that is auto-generated from doc-strings that are easier to maintain and more accurate. However, one step at a time :) |
…into pydantic-zero
| prev_best_metric_val=0): | ||
| config_zero = tuning_space.get(ZERO_OPTIMIZATION, {}) | ||
| stage = config_zero.get(ZERO_OPTIMIZATION_STAGE, ZERO_OPTIMIZATION_STAGE_DEFAULT) | ||
| stage = config_zero.stage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a bug if config_zero equals {}, and leads to evaluation of {}.stage?
| pydantic.BaseModel to allow for deprecated fields. To enable this feature, | ||
| add deprecated=True to pydantic.Field: | ||
| my_dep_field: int = Field(0, deprecated=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document first argument of Field(, i.e., 0.?
This reverts commit 5997589.
This reverts commit 5997589.
Brings Pydantic into the zero config:
DeepSpeedConfigModelclass which ZeRO and offload configs inherit. This class allows us to enforce extra params are not provided in the config and also implements logic for deprecated config paramsconstants.pyandconfig.pyinto a single Pydantic class that contains the default values for all parametersconstants.py