Skip to content

fix(fp8): support Qwen3.5 blockwise FP8 rollout and training - #2744

Merged
yuki-97 merged 39 commits into
NVIDIA-NeMo:mainfrom
MarkXCloud:codex-qwen35-fp8-rollout-training
Aug 22, 2026
Merged

yuki-97 merged 39 commits into
NVIDIA-NeMo:mainfrom
MarkXCloud:codex-qwen35-fp8-rollout-training

Conversation

@MarkXCloud

@MarkXCloud MarkXCloud commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

  • Add Qwen3.5 DAPO Megatron recipes for BF16 and FP8 rollout/training.
  • Fix grouped MoE expert FP8 refit for weights that do not end with .weight, so block quantization is applied instead of skipped.
  • Re-emit grouped MoE experts through vLLM's per-expert refit path so FP8 scale_inv tensors are loaded correctly.
  • Support both vLLM Ray executor module paths for older and newer vLLM versions.
  • Use Megatron Bridge provider freeze_config to keep unused VL vision parameters out of Megatron FP8 distributed training buckets for text-only runs.

@copy-pr-bot

copy-pr-bot Bot commented Jun 9, 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.

@MarkXCloud MarkXCloud changed the title feat(grpo): support Qwen3.5 FP8 rollout and training fix(fp8): support Qwen3.5 FP8 rollout and training Jun 9, 2026
@zpqiu zpqiu self-assigned this Jun 11, 2026
@MarkXCloud
MarkXCloud force-pushed the codex-qwen35-fp8-rollout-training branch from 5b91d2f to 3e80bbb Compare June 25, 2026 09:28
@MarkXCloud
MarkXCloud marked this pull request as ready for review June 25, 2026 09:51
@MarkXCloud
MarkXCloud requested review from a team as code owners June 25, 2026 09:51
@MarkXCloud
MarkXCloud marked this pull request as draft June 25, 2026 09:52
@zpqiu
zpqiu force-pushed the codex-qwen35-fp8-rollout-training branch from 8460de1 to e04bf9a Compare August 11, 2026 08:35
zpqiu
zpqiu previously requested changes Aug 11, 2026
zpqiu and others added 6 commits August 11, 2026 17:48
…cipe

vLLM profiles VL models with dummy multimodal inputs; the vision tower's
fc2 (vision intermediate_size=4304, not divisible by the [128,128] fp8
block) hits 'last dimension of x 4304 must be divisible by group_size 128'
at engine init. Mirror the 35B recipe's quantization_ignored_layer_kws.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Zili Wang <[email protected]>
…B fp8

Sequence packing produces variable-length packs per DP rank (pack counts
are equalized by the packer's bin_count_multiple=shards, lengths are not).
The allgather MoE dispatcher requires uniform shapes across the TP*EP
group and deadlocks on the first packed microbatch (NCCL watchdog SIGABRT
on EXPERT_TENSOR_AND_MODEL_PARALLEL); alltoall exchanges variable-size
splits explicitly. Verified: step-1 gen_kl_error 0.0023 (same band as the
dynamic-batching run), no numerics change.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Zili Wang <[email protected]>
The grouped-expert branch in load_weights quantized every
mlp.experts.{gate_up,down}_proj slab unconditionally, before the
_is_fp8_weight module probe ever ran, so ignored_layers
(num_{first,last}_layers_in_bf16 / quantization_ignored_layer_kws) had
no effect on experts. vLLM builds ignored RoutedExperts as unquantized
bf16 MoE without *_weight_scale_inv params, so the per-expert FP8 +
scale entries emitted for such a layer have no matching param to load
into and the refit fails.

Probe the target RoutedExperts first and only expand+quantize when its
weights are actually FP8; otherwise pass the grouped bf16 slab through
untouched (vLLM's fused expert mapping loads it directly, same as a
bf16 refit).

Signed-off-by: Zili Wang <[email protected]>
@zpqiu
zpqiu dismissed their stale review August 12, 2026 13:44

resolved

@zpqiu
zpqiu marked this pull request as ready for review August 12, 2026 14:59
@zpqiu
zpqiu requested a review from a team as a code owner August 12, 2026 14:59
@zpqiu zpqiu added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Aug 12, 2026

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @MarkXCloud @zpqiu ! LGTM, left two minor comments. also you need to rebase main since there's a conflict.

MarkXCloud and others added 2 commits August 19, 2026 19:43
…pying

The gate/up shards are dim-1 slices of the grouped slab, so the
.contiguous() here materialized a full extra copy (0.5 GiB on the
35B-A3B gate_up shard) held across the whole quantization call — right
at the refit peak 5844fae was reducing. The callee only ever indexes
per-expert 2D slices, which stay contiguous as long as the export side
hands over a contiguous slab (it does on both bridge paths), and each
slice is upcast-copied to fp32 before the cast anyway, so the output is
bitwise identical.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Zili Wang <[email protected]>
The traversal branch that descends from the language_model CausalLM
wrapper into its .model to find .layers had no unit coverage: the
grouped-expert fixture put layers at the top level, so only the
synthetic-"model."-prefix skip ever fired. That wrapper shape
(model.language_model.layers.N...) is what both FP8 recipes actually
refit at vLLM 0.25.1, and a traversal miss silently bf16-loads into fp8
params. Parametrize both grouped-expert tests over the flat and
VL-wrapper key shapes.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Zili Wang <[email protected]>
MarkXCloud and others added 2 commits August 19, 2026 20:06
Signed-off-by: Zili Wang <[email protected]>

# Conflicts:
#	tests/unit/test_recipes_and_test_suites.py
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Zili Wang <[email protected]>
@zpqiu
zpqiu requested a review from yuki-97 August 20, 2026 03:19
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-customer Waiting on the original author to respond label Aug 20, 2026
@yuki-97

yuki-97 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

/ok to test a0abbc6

yuki-97
yuki-97 previously approved these changes Aug 20, 2026
@yuki-97
yuki-97 enabled auto-merge (squash) August 20, 2026 09:57
Signed-off-by: Zhaopeng Qiu <[email protected]>
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-customer Waiting on the original author to respond label Aug 20, 2026
@zpqiu
zpqiu requested a review from yuki-97 August 20, 2026 13:15
yuki-97
yuki-97 previously approved these changes Aug 20, 2026
@yuki-97

yuki-97 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

/ok to test ce99d2c

@yuki-97

yuki-97 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

/ok to test e3ab356

@yuki-97
yuki-97 merged commit 4311929 into NVIDIA-NeMo:main Aug 22, 2026
123 of 125 checks passed
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-customer Waiting on the original author to respond label Aug 22, 2026
shuyixiong pushed a commit that referenced this pull request Sep 1, 2026
Backport the required FP8 refit pieces from NVIDIA-NeMo/RL PR #2744 to
daf46ff.

Resolve the wrapped Qwen3.5 parameter hierarchy before FP8 classification.
Also expand packed Megatron-Bridge expert slabs into per-expert block-FP8
weights and scales; unlike the former 41352f7 source fork, this pin no longer
splits them on the default collective-refit path.

Initialize the FP8 configuration inside RayExecutorV2 workers before model
construction. RayExecutorV2 has no pre-load collective_rpc hook, so pass the
configuration through its inherited environment and consume it when the
NeMo-RL worker extension is imported.
ZhiyuLi-Nvidia added a commit that referenced this pull request Sep 4, 2026
The three nightly entries this branch adds bring the suite from 4138 to
4266 GPU hours:

  +32  vlm_grpo-nemotron-omni-30ba3b-clevr-2n8g-megatron-tp8ep8.v1
  +32  vlm_grpo-nemotron-omni-30ba3b-clevr-2n8g-...v1-tq_mooncake
  +64  vlm_grpo-qwen3.5-35ba3b-geo3k-2n8g-automodel-ep16-tq_simple

Two of those are the VLM data-plane coverage itself; the third is the
2-node base the mooncake wrapper delegates to, which exists because the
recipe does not fit on one node.

Follows the convention for adding nightly coverage -- the cap has moved
4048 -> 4139 -> 4149 -> 4157 -> 4181 -> 4197 as recipes landed (#2744,
#3773, #3768, #3727, #3678).

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Zhiyu Li <[email protected]>
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) community-request Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants