Skip to content

ci: bump MBridge to 1ec9ce8b0 - #5427

Draft
lauradang wants to merge 1 commit into
mainfrom
ci/bump-mbridge-20261123
Draft

lauradang wants to merge 1 commit into
mainfrom
ci/bump-mbridge-20261123

Conversation

@lauradang

Copy link
Copy Markdown
Contributor

What does this PR do ?

Bumps Megatron-Bridge from ae0a1b026 to 1ec9ce8b0 (159 commits, fast-forward), which moves the nested Megatron-LM from e0a4bfed7 to 9261f941c.

1ec9ce8b0 is the first Megatron-Bridge main commit whose Megatron-LM has all of the inference fixes that prefill/decode serving through Dynamo needs:

Megatron-LM Fix
NVIDIA/Megatron-LM#9440 Multiplex Dynamo handoff claims over one socket (decode-side claim stalls, unclaimed handoffs expiring)
NVIDIA/Megatron-LM#9121 Check free Mamba slots before admitting a hybrid request
NVIDIA/Megatron-LM#9123 Reserve the recurrent-state dummy slot when tp_ep > 1
NVIDIA/Megatron-LM#9120 Disaggregated serving for hybrid MoE models with MTP
NVIDIA/Megatron-LM#9394 Keep eager prefill padding within token capacity
NVIDIA/Megatron-LM#9465, NVIDIA/Megatron-LM#9485, NVIDIA/Megatron-LM#9526 Resharding fixes used by the native refit path (partial destination meshes, NCCL communicator reuse, dtype)
NVIDIA/Megatron-LM#9536 --streaming-interval for the Dynamo worker
NVIDIA/Megatron-LM#9534 InferenceConfig.disaggregation_role (decode engines skip the Mamba prefix cache)

Dependency changes

  • This Bridge requires transformers>=5.21.1,<5.24, so the mcore extra moves from 5.16.1 to 5.21.1 and the base range's upper bound follows it (an install without a backend extra resolves to 5.21.1). The vllm, automodel, sglang and trtllm extras keep their own pins.
  • The relock also moves filelock (4.3.1), multi-storage-client (1.5.0), virtualenv (21.15.13), gigatoken (0.11.0), nvidia-cudnn-frontend (1.33.0) and adds pyroute2.
  • Locked with uv 0.11.28 (lockfile revision 3 kept, all 5 provides-extras present); uv lock --check passes with both uv 0.11.28 and the Dockerfile's uv 0.13.6.

Testing

  • tests/unit/test_dependency_pins.py and tests/unit/test_transformers_compat.py: 20 passed (CPU).
  • Needs a full nightly before merge (not yet run).

🤖 Generated with Claude Code

Megatron-Bridge ae0a1b026 -> 1ec9ce8b0 (nested Megatron-LM e0a4bfed7 ->
9261f941c). This brings in the Megatron-LM inference fixes that prefill/decode
serving through Dynamo needs: multiplexed handoff claims, free Mamba slot check
before admission, recurrent-state dummy slot for tp_ep > 1, hybrid MoE + MTP
disaggregated serving, eager prefill padding bound, resharding fixes for the
native refit path, the Dynamo worker streaming interval, and
InferenceConfig.disaggregation_role.

This Bridge requires transformers>=5.21.1,<5.24, so the mcore extra moves from
5.16.1 to 5.21.1 and the base range's upper bound follows it. The vllm,
automodel, sglang and trtllm extras keep their own pins. The relock also moves
filelock, multi-storage-client, virtualenv, gigatoken, nvidia-cudnn-frontend
and adds pyroute2.

Locked with uv 0.11.28 (revision 3 kept); uv 0.11.28 and the Dockerfile's
0.13.6 both pass lock --check.

Signed-off-by: Laura Dang <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI:L1 Run doctests, unit tests, and functional tests label Nov 24, 2026
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: a104935 (PR #5427 from ci/bump-mbridge-20261123)

✅ Submodules that are properly updated:

Megatron-Bridge: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

@lauradang

Copy link
Copy Markdown
Contributor Author

Nightly triage: pipeline 87088330 (PR head a104935: MBridge 1ec9ce8b0, transformers 5.21.1 for mcore)

Result: fails, and the bump causes it. No tests ran. Both Gym images fail to build, and the test stage waits on every image, so nemo_rl_test never starts. The two base images (build-NeMo-RL, build-NeMo-RL-sbsa) built fine.

Baselines: main nightlies 86490531 (11-30) and 86830268 (12-01), plus the previous bump's nightly 75068932. All four images built in all three, so this failure is new with this PR, not a flake.

Likely caused by the bump (needs a fix)

Job Attempts Failure
build-NeMo-RL-gym 581980527, 582104973 failed; 3rd attempt running AssertionError: transformers 5.21.1 detected. The deepseek_v3 tokenizer-blocklist patch was verified against <5.20. raised in the Gym prefetch step
build-NeMo-RL-gym-sbsa 581980528 failed; 2nd attempt running same

The assert is in _patch_transformers_tokenizer_class_set and runs when nemo_rl.models.policy is imported. This PR moves the mcore extra to transformers 5.21.1, so even once the image builds, every Megatron worker would hit the same assert on import.

Suggested fix: raise the assert's bound instead of dropping the patch. In transformers 5.21.1, tokenization_auto.py still lists deepseek_v3 in MODELS_WITH_INCORRECT_HUB_TOKENIZER_CLASS, and the loop that fills TOKENIZER_MAPPING_NAMES from that set is unchanged from 5.16.1. The patch is still needed and its discard/pop still apply. A bound of < 5.24 matches Megatron-Bridge's transformers>=5.21.1,<5.24. After that, rerun the nightly for the flake-vs-bump test comparison.

@lauradang

Copy link
Copy Markdown
Contributor Author

Nightly triage, round 2: pipeline 87145008 (PR head + transformers assert fix)

To get past the image-build failure from my previous comment, I ran this nightly on the PR head plus one commit that raises the deepseek_v3 tokenizer patch's assert bound to < 5.24 (lauradang/RL@2c3d429d8). That commit is not pushed to this PR yet. All four images built, and every test ran.

124 passed, 107 failed. Baselines: main nightlies 86490531 (11-30: 215 passed, 24 failed) and 86830268 (12-01: 74 passed, 166 failed, a bad night), plus the previous bump's nightly 75068932. Most failures are infrastructure, but two groups (20 tests) are caused by the bump and need fixes before merge, and a third needs a rerun to confirm.

Group Failed Cause
H100 disk quota 62 infra: Disk quota exceeded on the cw_dfw coreai_dlalgo_genai Lustre project
PPO value head output_dtype 11 bump
Megatron checkpoint key mismatch 9 bump (stale converted checkpoints)
Already failing on main 16 not related
Other one-offs 9 1 likely bump (rerun pending), 8 not related

1. Every PPO Megatron test: LinearForLastLayer.forward() got an unexpected keyword argument output_dtype (bump)

The pinned Megatron-LM 9261f941c GPTModel now passes output_dtype= to output_layer. The value head NeMo-RL installs there (make_value_head_hook) is Megatron-Bridge's LinearForLastLayer. Its forward has no output_dtype parameter, at this pin and on Bridge main. Each MegatronValueWorker raises TypeError on its first forward pass. Ten of these 11 passed on 11-30 (ppo_qwen2_5_1_5b_math_3n8g_megatron_dedicated_value was already failing).

Failing tests: ppo_qwen2_5_1_5b_gsm8k_*_megatron_valuetp2sp_* (8 variants), ppo_qwen3_30ba3b_3n8g_megatron_cp2_r3_async_single_controller, vlm_ppo_qwen2_5_vl_3b_geometry3k_1n8g_megatron_single_controller_v1, ppo_deepseek_r1_distill_qwen_7b_8n4g_megatron_noncolocated_async_single_controller (GB200). Example: job 582733620.

Suggested fix: add output_dtype: torch.dtype | None = None to LinearForLastLayer.forward in Megatron-Bridge, or in a NeMo-RL subclass if the Bridge freeze rules that out, and cast with it when it is set.

2. Qwen3.5 / Qwen3.6 Megatron tests: checkpoint keys not found (bump)

Examples: KeyError: "language_model.decoder.layers.6.self_attention.linear_proj.weight from model not in state dict" (job 582733333) and Missing key in checkpoint state_dict: language_model.decoder.final_norm._extra_state (job 582733056). The checkpoints come from the converted-checkpoint cache, NRL_MEGATRON_CHECKPOINT_DIR=.../hf_home/main-mirror, which the main nightlies share. The old Bridge wrote them, and the new Bridge names some parameters differently (for example final_layernorm → final_norm). All 9 passed on 11-30.

Failing tests: grpo_qwen3_5_9b_1n8g_megatron{,_fp8}, grpo_qwen3_5_35ba3b_2n8g_megatron_ep16tp2{cp2,_fp8}, grpo_qwen3_8_27b_2n8g_megatron_tp4pp2cp2, and four GB200 grpo_qwen3_5_35ba3b_*_trtllm* recipes.

Suggested fix: the cached conversions for these models need regenerating with the new Bridge once this merges. Because main shares the cache, do that at merge time, or key the cache by Bridge version. Users with Qwen3.5/3.6 checkpoints converted under the old Bridge will also need to reconvert. That is worth a line in the PR description.

3. Possible numerical change, rerun pending

Test HW Nightly job Failure Rerun
grpo_nanov3_30BA3B_2n4g_megatron_generation_noncolocated_zero_kl_mxfp8 GB200 [583067005 is the rerun; nightly job in 87145008] min/max(train/token_mult_prob_error) == 1 fails at 1.049 / 1.071. On 11-30 both were exactly 1.0 (12-01 failed on an rsync I/O error). Generation runs on Megatron inference, which this bump updates. pending, pipeline 87274560

Infra: H100 disk quota (62 tests)

62 cw_dfw failures hit Disk quota exceeded, and 57 of those tests passed on 11-30. The quota is also why single-test reruns on cw_dfw can't run right now: pipeline 87244955 failed in checkout_repo with the same error. Someone needs to free space under coreai_dlalgo_genai/nemo_rl_ci before the H100 half of this nightly can be rerun cleanly.

Not related to the bump

  • Already failing on both main baselines (16): TRT-LLM NIXL disagg (2), qwen3_8b_*_automodel_{dspark,dflash}, TransferQueue reference_policy_logprobs (2), qwen3_30ba3b_4n8g_megatron_qa_nvfp4, *_token_capture* (4), super_rlvr/super_rlhf, deepscaler_1_5b_8K_tq_simple, gspo_deepscaler_1_5b_8K_tq_nixl, nanov3_30ba3b_3n8g_megatron_dynamo_swe1.
  • One-offs in paths this bump doesn't touch (Automodel or vLLM) or with an infra cause:
    • deepscaler_1_5b_16K: CUDA error in vLLM at step 6.
    • gemma3_1b_it_1n4g_automodel: GB200, stopped at step 395 of 400, near the 4 h limit.
    • dapo_gemma4_12b_it_2n8g_automodel: Slurm step failure.
    • ppo_qwen2_5_1_5b_gsm8k_1n8g_automodel_noncolocated_async: log size limit.
    • nanov3 ... mxfp8_rollouts_packed_refit: flaky (failed 11-30, passed 12-01).
  • Unclear, rerun blocked by the quota:
    • llama3_1_8b_instruct_2n8g_megatron_fp8_e2e{,_tq_nixl}: the log was truncated at GitLab's 100 MB limit. FP8 config spam fills it on main too.
    • qwen3_8b_base_1n8g_fp8_kvcache_megatron: stopped at step 43 with no traceback in the GitLab log.

Next: fix 1 (output_dtype) and fix 2 (checkpoint cache), push the assert fix to this branch, then rerun once cw_dfw has space. I'll update this thread with the zero_kl rerun result.

@lauradang

Copy link
Copy Markdown
Contributor Author

Update on item 3: the GB200 rerun (job 583067005, pipeline 87274560) reproduces the failure, so it is caused by the bump.

grpo_nanov3_30BA3B_2n4g_megatron_generation_noncolocated_zero_kl_mxfp8: token_mult_prob_error min/max = 1.043 / 1.060 (expects exactly 1) and max(gen_kl_error) = 0.0047 (expects exactly 0). On main 11-30 (86490531) every check passed exactly. With the new Megatron-LM, Megatron-inference logprobs no longer match training logprobs bit-for-bit under MXFP8, so this needs a look from someone who owns Megatron generation before merge.

@lauradang

Copy link
Copy Markdown
Contributor Author

Rerun of the 62 tests that hit Disk quota exceeded, plus 3 FP8 tests, after the disk was cleared (pipeline 87430334, same image as 87145008): 60 passed, 5 failed, none caused by the bump. All 3 FP8 tests passed.

Test Result Why it's not the bump
llm_ppo_qwen2_5_1_5b_gsm8k_1n8g_automodel_valuetp2_cp2 failed also fails on main 11-30 and 12-01
llm_grpo_qwen3_8b_4n8g_automodel_eagle3 failed also fails on main 11-30 and 12-01 and in the last bump
llm_grpo_llama3_2_1b_instruct_1n8g_megatron_generation failed also fails on main 12-01 and in the last bump
llm_grpo_llama3_2_1b_instruct_1n8g_automodel_v3_tq_simple failed step-time check missed by a hair (10.06 s vs < 10 s); also fails on main 12-01
vlm_grpo_qwen2_5_vl_3b_instruct_clevr_1n8g_megatrontp2_v1 failed train/loss at step 200 = 0.115 vs < 0.1; also fails on main 12-01, passes on 11-30 (intermittent)

The bump-caused failures from the earlier comments haven't changed:

  1. PPO output_dtype crash: fix is in fix(rl): accept output_dtype in LinearForLastLayer.forward Megatron-Bridge#7234 (CI green). This PR needs its Megatron-Bridge pin moved past that fix once it merges.
  2. Qwen3.5 checkpoint key mismatch (final_layernorm → final_norm): the converted-checkpoint cache made with the old Megatron-Bridge is stale.
  3. zero_kl_mxfp8 logprob mismatch on GB200: still open.

@mxinO

mxinO commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Heads-up from testing this pin with #5516: with transformers==5.21.1, every Megatron (and Automodel) run fails at import of nemo_rl.models.policy:

AssertionError: transformers 5.21.1 detected. The deepseek_v3 tokenizer-blocklist patch was verified against <5.20. Check if the upstream fix now applies and remove this patch if so.

The guard is in nemo_rl/models/policy/__init__.py. The patch it protects is still needed: transformers 5.21.1 still lists deepseek_v3 in MODELS_WITH_INCORRECT_HUB_TOKENIZER_CLASS. The patch only uses discard / pop(..., None), so it is safe on 5.21. Raising the bound is enough:

-    # Transformers 5.16.1 still ships both registry entries, so the patch remains
-    # load-bearing across the currently supported backend environments.
+    # Transformers 5.21.1 still lists deepseek_v3 in
+    # MODELS_WITH_INCORRECT_HUB_TOKENIZER_CLASS, so the patch remains load-bearing
+    # across the currently supported backend environments.
@@
-    assert PkgVersion(transformers.__version__) < PkgVersion("5.20.0"), (
+    assert PkgVersion(transformers.__version__) < PkgVersion("5.22.0"), (
         f"transformers {transformers.__version__} detected. "
-        "The deepseek_v3 tokenizer-blocklist patch was verified against <5.20. "
+        "The deepseek_v3 tokenizer-blocklist patch was verified against <5.22. "

With that change, this PR's pin (Bridge 1ec9ce8b0, transformers 5.21.1, merged with current main) builds, and Qwen3-8B real-quant GRPO trains on GB300. That includes #5516's native FP8 and NVFP4 KV caches, colocated refit, and checkpoint resume.

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:L1 Run doctests, unit tests, and functional tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants