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
857eb87c
Unverified
Commit
857eb87c
authored
Mar 30, 2022
by
Manuel R. Ciosici
Committed by
GitHub
Mar 30, 2022
Browse files
Support reduce_bucket_size=auto for deepspeed stages <3 (#16496)
parent
81ac45f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/transformers/deepspeed.py
src/transformers/deepspeed.py
+3
-3
No files found.
src/transformers/deepspeed.py
View file @
857eb87c
...
@@ -261,13 +261,13 @@ class HfTrainerDeepSpeedConfig(HfDeepSpeedConfig):
...
@@ -261,13 +261,13 @@ class HfTrainerDeepSpeedConfig(HfDeepSpeedConfig):
"""
"""
This stage is run after we have the model and know num_training_steps.
This stage is run after we have the model and know num_training_steps.
Now we
we
can complete the configuration process.
Now we can complete the configuration process.
"""
"""
# zero
# zero
hidden_size
=
model
.
config
.
hidden_size
self
.
fill_only
(
"zero_optimization.reduce_bucket_size"
,
hidden_size
*
hidden_size
)
if
self
.
is_zero3
():
if
self
.
is_zero3
():
# automatically assign the optimal config values based on model config
# automatically assign the optimal config values based on model config
hidden_size
=
model
.
config
.
hidden_size
self
.
fill_only
(
"zero_optimization.reduce_bucket_size"
,
hidden_size
*
hidden_size
)
self
.
fill_only
(
"zero_optimization.stage3_prefetch_bucket_size"
,
0.9
*
hidden_size
*
hidden_size
)
self
.
fill_only
(
"zero_optimization.stage3_prefetch_bucket_size"
,
0.9
*
hidden_size
*
hidden_size
)
self
.
fill_only
(
"zero_optimization.stage3_param_persistence_threshold"
,
10
*
hidden_size
)
self
.
fill_only
(
"zero_optimization.stage3_param_persistence_threshold"
,
10
*
hidden_size
)
...
...
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