Improve handling of Init's config arguments#1368
Closed
aphedges wants to merge 1 commit intodeepspeedai:masterfrom
Closed
Improve handling of Init's config arguments#1368aphedges wants to merge 1 commit intodeepspeedai:masterfrom
Init's config arguments#1368aphedges wants to merge 1 commit intodeepspeedai:masterfrom
Conversation
33ce6bc to
f4b4e05
Compare
Contributor
Author
|
It seems that #1373 was released and merged after this, so one of the core problems this PR fixes no longer exists. However, it still fixes a related bug, so I think that it is still relevant. I've rebased to incorporate the changes from the merged PR. |
Contributor
Author
|
The bug and the main documentation fix in this PR were solved when #1407 was merged. No need to include this now, then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
configinstead ofconfig_dict_or_pathconfigis deprecatedExplanation
I figured out that when using
transformers, as of DeepSpeed commit e08c239, I was having issues loading models for training as fp32. I figured out thattransformersis still using theconfigparameter, even though it does not function the way it did back before the commit. This causesInsertPostInitMethodToModuleSubClasses.dtypeto default totorch.half, even though the class should takeds_config.fp16_enabledinto account.My fix here is to treat
configas a deprecated alias for the newconfig_dict_or_pathparameter. This seems reasonable given a comment on another PR: #1271 (comment). In addition, from #1008 and #1271, it seems that there only needs to be one instance ofDeepSpeedConfigin the method, so I removed the second one.I added a runtime warning so users can see that the parameter that they were using should be changed. I will be putting a PR out to transfer to the new parameter in
transformersafter this PR is merged and released. I'm guessing that the oldconfigparameter should be removed at some point in the future, but I have no clue about the deprecation policy for this library.