Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
da6a1b6c
Unverified
Commit
da6a1b6c
authored
Sep 21, 2022
by
Zhong Hui
Committed by
GitHub
Sep 21, 2022
Browse files
[BugFix] Fix fsdp option on shard_grad_op. (#19131)
parent
9e957066
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/training_args.py
src/transformers/training_args.py
+1
-1
No files found.
src/transformers/training_args.py
View file @
da6a1b6c
...
@@ -1197,7 +1197,7 @@ class TrainingArguments:
...
@@ -1197,7 +1197,7 @@ class TrainingArguments:
"`--fsdp offload` can't work on its own. It needs to be added to `--fsdp full_shard` or "
"`--fsdp offload` can't work on its own. It needs to be added to `--fsdp full_shard` or "
'`--fsdp shard_grad_op`. For example, `--fsdp "full_shard offload"`.'
'`--fsdp shard_grad_op`. For example, `--fsdp "full_shard offload"`.'
)
)
elif
FSDPOption
.
FULL_SHARD
in
self
.
fsdp
and
FSDPOption
.
SHARD_GRAD_OP
in
self
.
s
harded_d
dp
:
elif
FSDPOption
.
FULL_SHARD
in
self
.
fsdp
and
FSDPOption
.
SHARD_GRAD_OP
in
self
.
f
sdp
:
raise
ValueError
(
"`--fsdp full_shard` is not compatible with `--fsdp shard_grad_op`."
)
raise
ValueError
(
"`--fsdp full_shard` is not compatible with `--fsdp shard_grad_op`."
)
if
len
(
self
.
fsdp
)
==
0
and
self
.
fsdp_min_num_params
>
0
:
if
len
(
self
.
fsdp
)
==
0
and
self
.
fsdp_min_num_params
>
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment