Skip to content

Fix: Update optimization.py#44909

Merged
Rocketknight1 merged 7 commits intohuggingface:mainfrom
anshuS1310:fix-inverse-sqrt-scheduler-args
Mar 24, 2026
Merged

Fix: Update optimization.py#44909
Rocketknight1 merged 7 commits intohuggingface:mainfrom
anshuS1310:fix-inverse-sqrt-scheduler-args

Conversation

@anshuS1310
Copy link
Copy Markdown
Contributor

The get_scheduler function was identifying the inverse_sqrt scheduler type but failing to pass **scheduler_specific_kwargs to the underlying get_inverse_sqrt_schedule function.

This caused user-defined parameters like timescale to be silently ignored. This commit adds the missing kwargs to the function call at line 664.

Fixes #44908

The `get_scheduler` function was identifying the `inverse_sqrt` scheduler type but failing to pass `**scheduler_specific_kwargs` to the underlying `get_inverse_sqrt_schedule` function. 

This caused user-defined parameters like `timescale` to be silently ignored. This commit adds the missing kwargs to the function call at line 664.

Fixes huggingface#44908
@Rocketknight1 Rocketknight1 force-pushed the fix-inverse-sqrt-scheduler-args branch from 2e7f6fa to 0028eed Compare March 23, 2026 14:22
Copy link
Copy Markdown
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, seems good to me!

@Rocketknight1 Rocketknight1 enabled auto-merge March 23, 2026 16:50
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

auto-merge was automatically disabled March 23, 2026 17:32

Head branch was pushed to by a user without write access

@anshuS1310
Copy link
Copy Markdown
Contributor Author

@Rocketknight1
Thanks for the approval! Could a maintainer please approve the CI workflows so the required checks can finish?

@Rocketknight1 Rocketknight1 enabled auto-merge March 24, 2026 12:43
@Rocketknight1 Rocketknight1 added this pull request to the merge queue Mar 24, 2026
Merged via the queue into huggingface:main with commit 2f121ea Mar 24, 2026
28 checks passed
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Mar 27, 2026
* Update optimization.py

The `get_scheduler` function was identifying the `inverse_sqrt` scheduler type but failing to pass `**scheduler_specific_kwargs` to the underlying `get_inverse_sqrt_schedule` function. 

This caused user-defined parameters like `timescale` to be silently ignored. This commit adds the missing kwargs to the function call at line 664.

Fixes huggingface#44908

* Update optimization.py

* Update optimization.py

* Update optimization.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inverse_sqrt scheduler ignores lr_scheduler_kwargs (timescale not passed)

3 participants