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
f3b3533e
Unverified
Commit
f3b3533e
authored
Apr 23, 2024
by
hoshi-hiyouga
Committed by
GitHub
Apr 22, 2024
Browse files
Fix layerwise GaLore optimizer hard to converge with warmup scheduler (#30372)
Update optimization.py
parent
0d84901c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
src/transformers/optimization.py
src/transformers/optimization.py
+2
-3
No files found.
src/transformers/optimization.py
View file @
f3b3533e
...
...
@@ -444,9 +444,8 @@ def get_scheduler(
def
scheduler_hook
(
param
):
# Since the optimizer hook has been already attached we only need to
# attach the scheduler hook
if
param
.
grad
is
not
None
:
scheduler_dict
[
param
].
step
()
# attach the scheduler hook, the gradients have been zeroed here
scheduler_dict
[
param
].
step
()
for
param
in
optimizer_dict
.
keys
():
if
param
.
requires_grad
:
...
...
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