Repository navigation
feat: add fp32 LM head toggle - #4096
Conversation
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]> # Conflicts: # nemo_rl/models/generation/vllm/config.py # nemo_rl/models/megatron/setup.py
guyueh1
left a comment
There was a problem hiding this comment.
This is an agent-team review (6 agents: rl-expert, bug-finder, design-reviewer, test-agent, comment-reviewer, devil-advocate). No merge conflicts. All findings below survived an adversarial devil's-advocate pass — one candidate finding (a hypothesized silent-skip bug in _resolve_output_layer_owner) was investigated against the actual vendored NemotronOmniModel/NemotronVLModel/Qwen3OmniModel classes and found unreachable, so it's omitted here.
Linter: ruff/ruff-format/taplo pass clean except the import-sort fix below (already captured as an inline comment); pyrefly-typecheck failed only due to a known macOS-arm64 platform/lockfile mismatch, unrelated to this PR.
Generated by Claude Code
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
Signed-off-by: Guyue Huang <[email protected]>
|
/ok to test 18b9e24 |
Signed-off-by: Guyue Huang <[email protected]>
|
/ok to test a59da2e |
Signed-off-by: Guyue Huang <[email protected]>
|
/ok to test 3143fb9 |
Signed-off-by: Guyue Huang <[email protected]>
|
/ok to test 723bc95 |
Signed-off-by: Guyue Huang <[email protected]>
yfw
left a comment
There was a problem hiding this comment.
Thanks — the vLLM side of this is carefully done (the source patch applies cleanly and idempotently to the pinned 0.25.1 nemotron_h.py, keeps the live lm_head.weight for refit, covers both the sampler and the greedy get_top_tokens route, and fails loudly when an anchor is missing), and the two-flag + validator shape is stricter than the repo's usual interpolation-only coupling in a good way.
The main ask is on the Megatron half: the pinned Megatron-Bridge/Megatron-LM already provide logit_dtype for exactly this (fp32-accumulated fp32 logits from a bf16 tensor-core GEMM), and switching to it removes the forward monkeypatch plus the four wrapper-only defects called out inline. The other inline items are a validator ordering gap, the colocated-reshard generation path, test coverage for the patch anchors, and the exemplar/reference-config lines for the Megatron key.
Unit tests: all 34 PR tests pass locally at head; whole-directory runs of tests/unit/models/generation and tests/unit/models/policy show only environmental failures in files this PR does not touch. Linters pass at head.
Generated by Claude Code
Signed-off-by: Guyue Huang <[email protected]>
|
/ok to test b7549e9 |
Signed-off-by: Guyue Huang <[email protected]>
|
/ok to test 94d8b8b |
Summary
generation.vllm_cfg.fp32_lm_headtoggle and thread it into vLLM source patchingTesting
/Users/guyueh/.local/share/nel/venvs/nel-next/bin/ruff format --check .../Users/guyueh/.local/share/nel/venvs/nel-next/bin/ruff check .../Users/guyueh/.local/share/nel/venvs/nel-next/bin/python -m py_compile ...git diff --checkNotes
uvis not on PATH in this shell, the cached pytest env is missingomegaconf, and importing the vLLM package path in that env hits missingnemo.lens/Users/guyueh/Documents/work/code/RL/.venv/bin/pythonis missingpre_commit, so the signed-off commit was created with--no-verifyafter the targeted checks above