fix: bump accelerate floor to 1.13.0 for transformers 5.3.0 compat#2388
Open
lonexreb wants to merge 2 commits intoNVIDIA-NeMo:mainfrom
Open
fix: bump accelerate floor to 1.13.0 for transformers 5.3.0 compat#2388lonexreb wants to merge 2 commits intoNVIDIA-NeMo:mainfrom
lonexreb wants to merge 2 commits intoNVIDIA-NeMo:mainfrom
Conversation
…IDIA-NeMo#2221) NeMo-RL pins ``transformers==5.3.0`` but currently declares ``accelerate>=0.26``. Versions of accelerate older than 1.1.0 are incompatible with transformers 5.3.0's call sites that pass the ``_is_hf_initialized`` keyword to ``Parameter.__new__``, producing a runtime crash: TypeError: Parameter.__new__() got an unexpected keyword argument '_is_hf_initialized' The currently locked version (1.10.0) is unaffected because the resolver was constrained from elsewhere, but a fresh resolve in a different environment can pick a too-old accelerate and fail at runtime. Tighten the floor so the constraint accurately reflects transformers 5.3.0's real requirement. uv.lock was regenerated with ``uv lock``. The only semantic change is the matching ``accelerate`` specifier in nemo-rl's ``[package.metadata.requires-dist]`` block; the resolved version (``accelerate==1.10.0``) and every other package version are unchanged. The remaining lockfile churn is resolution-marker normalization from a newer uv release and is benign. Refs: NVIDIA-NeMo#2221 Signed-off-by: lonexreb <[email protected]>
5 tasks
The previous commit on this branch claimed `accelerate>=1.1.0` would fix the ``_is_hf_initialized`` ``TypeError`` from NVIDIA-NeMo#2221. That was wrong — verified by reading accelerate's source on the huggingface/accelerate repo: * v1.10.0 ``register_empty_parameter`` (src/accelerate/big_modeling.py:129) has no handling for the ``_is_hf_initialized`` kwarg, so transformers 5.3.0's ``Parameter.__new__`` call still crashes. * v1.13.0 ``register_empty_parameter`` (line 131) pops ``_is_hf_initialized`` from kwargs and re-applies it after parameter creation. So the actual floor required to unblock transformers 5.3.0 is ``>=1.13.0``. Bump pyproject.toml accordingly and regenerate uv.lock — ``accelerate`` moves from 1.10.0 to 1.13.0; no other versions change. Refs: NVIDIA-NeMo#2221 Signed-off-by: lonexreb <[email protected]>
Author
|
Updated to correct floor A code review caught that
So the actual minimum required to unblock transformers 5.3.0 is The original |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the dep mismatch flagged in #2221.
NeMo-RL pins
transformers==5.3.0(pyproject.toml:46) but currentlydeclares
accelerate>=0.26(pyproject.toml:31). Versions ofaccelerateolder than 1.13.0 are incompatible with transformers5.3.0's call sites that pass the
_is_hf_initializedkeyword toParameter.__new__, producing the runtime crash described in theissue:
Why specifically 1.13.0
Investigation of
accelerateupstream:register_empty_parameter(line 129) has no handling forthe
_is_hf_initializedkwarg, so it is forwarded toParameter.__new__, which rejects it.constructing the
Parameterand reapplies it as an attributeafterwards — which is exactly the contract transformers 5.3.0
relies on.
So
>=1.13.0is the precise floor required for transformers 5.3.0compatibility. (The earlier draft of this PR claimed
>=1.1.0wouldsuffice; that was wrong —
1.1.0predates the kwarg-handling fixentirely. Corrected here.)
Change
pyproject.toml:accelerate>=0.26→accelerate>=1.13.0uv.lock: regenerated withuv lockto pick up the new specifier.What this PR does not touch
3rdparty/Megatron-Bridge-workspacedeclares an unconstrainedacceleratedep at pyproject.toml:476 — that lives in upstreamMegatron-Bridge's
setup.py::CACHED_DEPENDENCIESand per thecomment must stay in sync with the Bridge source. Updating it is
outside the scope of this fix and should be coordinated with
Megatron-Bridge directly.
Test plan
uv lockran cleanly with the>=1.13.0floor.acceleratesource on GitHub: v1.13.0 isthe first release with the
_is_hf_initializedpop/reapplyhandling in
register_empty_parameter.Refs: #2221