-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
fix type annotations for arguments in training_args #24550
Merged
Merged
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4cf0835
testing
shauray8 7e2f313
example script
shauray8 f9f3239
Merge branch 'main' into fix_trainingargs
shauray8 2a2b232
fix typehinting
shauray8 bb23735
some tests
shauray8 1569775
make test
shauray8 266d5b0
optional update
shauray8 8f6e382
Union of arguments
shauray8 056fd3d
does this fix the issue
shauray8 71049cb
remove reports
shauray8 7f9b4cb
set default to False
shauray8 878eb9b
documentation change
shauray8 4443814
None support
shauray8 07760be
does not need None
shauray8 5ce5f1f
Merge branch 'huggingface:main' into fix_trainingargs
shauray8 fbac8a7
Fix typing annotations for FSDP and DeepSpeed in TrainingArguments (#…
mryab ea1b714
Revert "Fix typing annotations for FSDP and DeepSpeed in TrainingArgu…
sgugger 05cc09b
Fix typing annotations for FSDP and DeepSpeed in TrainingArguments (#…
mryab 760f89c
merge
shauray8 20d6b84
hacky fix
shauray8 272f654
fixup
shauray8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -944,8 +944,8 @@ class TrainingArguments: | |
) | ||
}, | ||
) | ||
sharded_ddp: str = field( | ||
default="", | ||
sharded_ddp: Optional[Union[str, bool, List[ShardedDDPOption]]] = field( | ||
default=False, | ||
metadata={ | ||
"help": ( | ||
"Whether or not to use sharded DDP training (in distributed training only). The base option should be" | ||
|
@@ -955,8 +955,8 @@ class TrainingArguments: | |
), | ||
}, | ||
) | ||
fsdp: str = field( | ||
default="", | ||
fsdp: Optional[Union[str, bool, List[FSDPOption]]] = field( | ||
default=False, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same for this - |
||
metadata={ | ||
"help": ( | ||
"Whether or not to use PyTorch Fully Sharded Data Parallel (FSDP) training (in distributed training" | ||
|
@@ -976,7 +976,7 @@ class TrainingArguments: | |
) | ||
}, | ||
) | ||
fsdp_config: Optional[str] = field( | ||
fsdp_config: Optional[Union[str, Dict]] = field( | ||
default=None, | ||
metadata={ | ||
"help": ( | ||
|
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.
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.
The default shouldn't be touched.
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.
the documentation says that it defaults to False - sharded_ddp (
bool
,str
or list of [~trainer_utils.ShardedDDPOption
], optional, defaults toFalse
). but if the default variable has to be " ", I'll try doing it some other way.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.
Then let's fix the documentation as a change in default is potentially braking.
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.
Okay, changing default to
""
in the documentation as well as in the code.