Repository navigation
feat(opd): explicit fp32 LM head for MOPD teachers [super-v3.5-posttraining] - #4522
Draft
pjin-nvidia wants to merge 1 commit into
Draft
pjin-nvidia wants to merge 1 commit into
pjin-nvidia wants to merge 1 commit into
Conversation
MOPD teachers inherited policy.megatron_cfg.fp32_lm_head through the deep-copied student config, and MegatronPolicyWorker applied the student's fp32 head mode to every teacher. The only check was the worker-level validator inside each teacher's Ray actor, against the student's copied NRL_VLLM_FP32_LM_HEAD, so a teacher-only setting (through megatron_cfg_overrides) failed late, with a vLLM mismatch message. - Teacher config: extend the teacher schemas from the super v3.5 MOPD PR (#3830) with fp32_lm_head. TeacherResourceConfig defaults it to false and TeacherResourceOverrides to None, so an override that omits it keeps default_teacher_cfg's value. TeacherWorkerGroup applies the teacher's own value instead of the student's, and setting it inside megatron_cfg_overrides is rejected. - MOPD supports fp32_lm_head false and "tf32" only. true (the strict-fp32 head) raises NotImplementedError for teachers, and so for a student with non-colocated teachers, since the two must match. Runs without teachers keep true as before. - Validate at setup, before reserving resources (teacher node accounting in grpo.setup, and create_teacher_worker_groups): every teacher must match the student, and with the fp32 head on, a teacher with use_fused_linear_logprobs (inherited or overridden) is rejected, since the fused kernel bypasses output_layer. The worker-level check then passes inside teachers, which carry the student's vLLM setting. - Document the setting in docs/about/algorithms/mopd.md. - Fix ruff D205 and formatting in opd.py's existing #3830 schema code. Only sampled-token MOPD exists on this branch: a teacher's fp32 head logits go straight into fp32 log-probabilities, with no full-vocabulary teacher-logit rebuild to change. Signed-off-by: Peter Jin <[email protected]>
4 tasks done
4 tasks done
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.
MOPD teachers inherited policy.megatron_cfg.fp32_lm_head through the deep-copied student config, and MegatronPolicyWorker applied the student's fp32 head mode to every teacher. The only check was the worker-level validator inside each teacher's Ray actor, against the student's copied NRL_VLLM_FP32_LM_HEAD, so a teacher-only setting (through megatron_cfg_overrides) failed late, with a vLLM mismatch message.
Only sampled-token MOPD exists on this branch: a teacher's fp32 head logits go straight into fp32 log-probabilities, with no full-vocabulary teacher-logit rebuild to change.