Skip to content

feat(opd): explicit fp32 LM head for MOPD teachers [super-v3.5-posttraining] - #4522

Draft
pjin-nvidia wants to merge 1 commit into
super-v3.5-posttrainingfrom
pjin/super-v3.5-mopd-teacher-fp32-lm-head-20261005
Draft

pjin-nvidia wants to merge 1 commit into
super-v3.5-posttrainingfrom
pjin/super-v3.5-mopd-teacher-fp32-lm-head-20261005

Conversation

@pjin-nvidia

Copy link
Copy Markdown
Contributor

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 (feat: super v3.5 posttraining joint mopd #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 feat: super v3.5 posttraining joint mopd #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.

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]>
@copy-pr-bot

copy-pr-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Oct 6, 2026
@pjin-nvidia pjin-nvidia changed the title feat(opd): explicit fp32 LM head for MOPD teachers feat(opd): explicit fp32 LM head for MOPD teachers [super-v3.5-posttraining] Oct 6, 2026
@terrykong terrykong added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 5, 2026
@terrykong terrykong removed the Documentation Improvements or additions to documentation label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants