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
80d50076
Unverified
Commit
80d50076
authored
Feb 02, 2024
by
Sourab Mangrulkar
Committed by
GitHub
Feb 02, 2024
Browse files
Reduce GPU memory usage when using FSDP+PEFT (#28830)
support FSDP+PEFT
parent
f4977959
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/transformers/trainer.py
src/transformers/trainer.py
+2
-0
No files found.
src/transformers/trainer.py
View file @
80d50076
...
...
@@ -1697,6 +1697,8 @@ class Trainer:
use_accelerator_prepare
=
True
if
model
is
self
.
model
else
False
if
delay_optimizer_creation
:
if
use_accelerator_prepare
:
self
.
model
=
self
.
accelerator
.
prepare
(
self
.
model
)
self
.
create_optimizer_and_scheduler
(
num_training_steps
=
max_steps
)
# prepare using `accelerator` prepare
...
...
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