Restore enforce_marked_param_dtypes after model materialization - #60
Merged
Merged
Conversation
PR #28 (DeepSeek V4 RL support) removed the call to enforce_marked_param_dtypes in get_model. Miles allows selected parameters to opt out of Float16Module's global bf16/fp16 cast, and this call restores those dtypes immediately after model materialization, so it is added back. Thanks to @zyzshishui for finding this bug. Co-authored-by: zyzshishui <82826991+zyzshishui@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
guapisolo
force-pushed
the
restore-enforce-marked-param-dtypes
branch
from
June 29, 2026 08:27
a7342dc to
6cc7765
Compare
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.
What
Restores the call to
enforce_marked_param_dtypes(model)inget_model(megatron/training/training.py), right aftercorrect_amax_history_if_needed(model)and before the DDP wrap.Why
PR #28 (DeepSeek V4 RL support) removed this block. Miles allows selected parameters to opt out of
Float16Module's global bf16/fp16 cast; this call restores those dtypes immediately after model materialization. Without it, marked fp32 params get silently cast, so the block is added back.This change is an exact revert of the removal in PR #28 — the resulting file is byte-identical to the pre-#28 state.
Acknowledgements
Thanks to @zyzshishui for finding this bug. 🙏
🤖 Generated with Claude Code