Repository navigation
Conversation
Plain Transformers models may not define keep_in_fp32_for_weight_transfer, causing NIXL transfer initialization to raise AttributeError. Look up the predicate optionally and use the shared wire-dtype resolver, consistent with the other transfer paths. Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
…p32-policy Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
…p32-policy Signed-off-by: Yaser Afshar <yaser.afshar@intel.com>
yafshar
marked this pull request as ready for review
November 3, 2026 18:36
Contributor
Author
|
Ready for review. NIXL now picks the FP32/BF16 wire dtype with resolve_wire_dtype, the same rule NCCL and the filesystem transport use, and the TODO asking for this is removed. No behaviour change: every trainer model already provides keep_in_fp32_for_weight_transfer. Merges cleanly on current main. @biswapanda could you review? @garrett361 @mikasenghaas for approval. |
This branch has not been deployed
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.
Change
NIXL decides whether each tensor goes to the inference engine as FP32 or BF16 with its own inline copy of the rule. NCCL and the filesystem gather already share that rule through
resolve_wire_dtypeinutils/weights.py, whose docstring asks for NIXL to join them:This PR makes NIXL call
resolve_wire_dtypeand look upkeep_in_fp32_for_weight_transferwithgetattr(..., None), as the other two transports do. It also drops thecast(PreTrainedModelPrimeRL, model)that only existed for the direct method call, and removes the TODO.nccl.py)getattr(..., None)resolve_wire_dtypeutils/weights.py)getattr(..., None)resolve_wire_dtypenixl.py), beforecastnixl.py), aftergetattr(..., None)resolve_wire_dtypeNo behaviour change. Since #3773 removed the Hugging Face model fallback, every trainer model inherits
keep_in_fp32_for_weight_transferfromPreTrainedModelPrimeRL, so each tensor keeps the same wire dtype.An earlier version of this PR was a fix for an
AttributeErrorthat NIXL raised on Hugging Face models. #3773 removed that code path, so the PR is now only a cleanup.