Skip to content

perf(recipe): add an 8-GPU GB300 MXFP8 pretrain recipe for Qwen3.5-VL 35B-A3B - #6413

Merged
malay-nagda merged 5 commits into
mainfrom
lifuz/qwen35-35b-8gpu-gb300-mxfp8-recipe
Oct 13, 2026
Merged

malay-nagda merged 5 commits into
mainfrom
lifuz/qwen35-35b-8gpu-gb300-mxfp8-recipe

Conversation

@tomlifu

@tomlifu tomlifu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Add qwen35_vl_35b_a3b_pretrain_8gpu_gb300_fp8mx_library_config, an MXFP8 Qwen3.5-VL 35B-A3B pretraining recipe for 8 GB300 GPUs. It starts from qwen35_vl_35b_a3b_pretrain_16gpu_gb300_bf16_config, keeps its parallel layout, CUDA graphs, recompute, batch shape and real routing, and adds:

  • MXFP8 with FP8 parameter all-gather (bf16_with_mxfp8_mixed);
  • Transformer Engine's CuTe DSL fused grouped MLP: the op fuser, the 32-wide GLU interleave and the NVTE_CUTEDSL_FUSED_GROUPED_MLP gate, which only work together;
  • 32 flex-dispatcher SMs, with HybridEP's fused permute off: it requires identical dispatch, combine and preprocessing chunk sizes, and this recipe uses 64/128/64;
  • the HybridEP preprocessing SMs, dispatch/expert-wgrad overlap, dispatch and preprocessing chunk sizes and cuDNN normalization of the configuration it was tuned on, which the 16-GPU recipe does not carry over;
  • cuDNN GDN (gdn_kernel_backend="transformer_engine"), set only when Megatron-Core declares the field (Re-add fused GDN TransformerEngine integration NVIDIA/Megatron-LM#7583), with the same guard as _enable_gdn_conv_fusion.

Changelog

  • Add specific line by line info of high level changes in this PR.

GitHub Actions CI

See the CI section in the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

If you haven't finished some of the above items you can still open "Draft" PR.

Additional Information

  • Related to # (issue)

… 35B-A3B

Add qwen35_vl_35b_a3b_pretrain_8gpu_gb300_fp8mx_library_config, an MXFP8 Qwen3.5-VL 35B-A3B
pretraining recipe for 8 GB300 GPUs. It starts from
qwen35_vl_35b_a3b_pretrain_16gpu_gb300_bf16_config, keeps its parallel layout, CUDA graphs,
recompute, batch shape and real routing, and adds:

- MXFP8 with FP8 parameter all-gather (bf16_with_mxfp8_mixed);
- Transformer Engine's CuTe DSL fused grouped MLP: the op fuser, the 32-wide GLU interleave and the
  NVTE_CUTEDSL_FUSED_GROUPED_MLP gate, which only work together;
- 32 flex-dispatcher SMs, with HybridEP's fused permute off: it requires identical dispatch, combine
  and preprocessing chunk sizes, and this recipe uses 64/128/64;
- the HybridEP preprocessing SMs, dispatch/expert-wgrad overlap, dispatch and preprocessing chunk
  sizes and cuDNN normalization of the configuration it was tuned on, which the 16-GPU recipe does
  not carry over;
- cuDNN GDN (gdn_kernel_backend="transformer_engine"), set only when Megatron-Core declares the
  field (NVIDIA/Megatron-LM#7583), with the same guard as _enable_gdn_conv_fusion.

The name carries a _library suffix because qwen35_vl_35b_a3b_pretrain_8gpu_gb300_fp8mx_config is
already a perf recipe.

Transformer Engine reads NVTE_CUTEDSL_FUSED_GROUPED_MLP once, when it registers the fused MLP at
import time, and run_recipe.py applied a library recipe's env_vars after that import, so the gate
was ignored. Add the variable to IMPORT_TIME_RECIPE_ENV_VARS, so that a recipe declaring it goes
through the existing re-exec bootstrap, as for NVTE_CPU_OFFLOAD_V1. Through run_recipe.py this
also changes two existing GB200 library recipes that declare the gate and no other import-time
variable: qwen35_text_35b_a3b_sft_long_context_16gpu_gb200_fp8mx_config, which enables the op
fuser and the GLU interleave, now runs the fused MLP instead of the unfused grouped GEMM (not
measured here), and qwen3_30b_a3b_pretrain_8gpu_gb200_fp8mx_config, which keeps the op fuser off,
now re-executes once.

Tests check the recipe's settings, the exact set of model fields and environment variables in which
it differs from the 16-GPU recipe, that building it leaves the 16-GPU recipe unchanged, that cuDNN
GDN is selected for a model config that declares the field and that no attribute is created on one
without it, and that the bootstrap covers both import-time variables.

Signed-off-by: tomlifu <lifuz@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 12, 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.

@tomlifu
tomlifu requested a review from cuichenx October 12, 2026 06:21
@tomlifu tomlifu self-assigned this Oct 12, 2026
@tomlifu
tomlifu requested a review from malay-nagda October 12, 2026 06:21
@cuichenx cuichenx added feature New capabilities, enhancements, or enablement work area:recipe Training recipes and launch configs needs-review PR is ready for code review and waiting on a reviewer labels Oct 12, 2026
Comment thread src/megatron/bridge/recipes/qwen_vl/gb300/qwen35_vl.py Outdated
@cuichenx cuichenx added waiting-on-customer Waiting on the original author to respond and removed needs-review PR is ready for code review and waiting on a reviewer labels Oct 12, 2026
tomlifu and others added 3 commits October 12, 2026 10:02
Address review: qwen35_vl_35b_a3b_pretrain_8gpu_gb300_fp8mx_library_config no longer edits the
env_vars it inherits from qwen35_vl_35b_a3b_pretrain_16gpu_gb300_bf16_config. It declares its whole
environment in one cfg.env_vars literal, COMMON_RECIPE_ENV_VARS first, right before it returns, as
hardware recipes do, so the recipe shows every variable it sets.

The environment is unchanged: the five variables the recipe used to overwrite or add
(NVTE_CUTEDSL_FUSED_GROUPED_MLP, the dispatch and preprocessing chunk sizes and the two cuDNN
normalization flags) keep their values, and every other variable keeps the 16-GPU value.

test_representative_recipe_environment_is_visible now covers this recipe, so a recipe that edits
inherited env_vars again fails there.

Signed-off-by: tomlifu <lifuz@nvidia.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tomlifu

tomlifu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f062cb9

@github-actions

Copy link
Copy Markdown
Contributor

Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing:

/review

Add model=claude to use a Claude reviewer (the default is model=codex). mode=light|strict selects the review depth; for example, /review model=claude mode=strict. Comment /review help for all options.

@tomlifu
tomlifu requested a review from malay-nagda October 12, 2026 22:23
@cuichenx cuichenx added the r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. label Oct 12, 2026
@malay-nagda
malay-nagda merged commit 6dd02c4 into main Oct 13, 2026
86 checks passed
@malay-nagda
malay-nagda deleted the lifuz/qwen35-35b-8gpu-gb300-mxfp8-recipe branch October 13, 2026 04:10

This branch was successfully deployed

1 active deployment
test — f062cb9a Deployed Oct 12, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #22792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:recipe Training recipes and launch configs feature New capabilities, enhancements, or enablement work r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants