feat(qwen): verify Qwen 3.8 27B and tune GB200 pretraining - #5587
Open
cuichenx wants to merge 10 commits into
Open
feat(qwen): verify Qwen 3.8 27B and tune GB200 pretraining#5587cuichenx wants to merge 10 commits into
cuichenx wants to merge 10 commits into
Conversation
Signed-off-by: Chen Cui <chcui@nvidia.com>
|
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. |
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
cuichenx
marked this pull request as ready for review
August 14, 2026 22:40
yaoyu-33
previously approved these changes
Aug 14, 2026
Signed-off-by: Chen Cui <chcui@nvidia.com>
Signed-off-by: Chen Cui <chcui@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds the GB200 model verification card for
Qwen/Qwen3.8-27Bat immutable Hugging Face revision1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0, fixes multimodal HF/Megatron model comparison for processors that emitmm_token_type_ids, and adds a tuned canonical 16-GB200 Qwen 3.5/3.8 27B projector-pretraining recipe.The comparison helper previously retained only the legacy
token_type_idsfield. Qwen 3.8 suppliesmm_token_type_ids, which Transformers requires alongsideimage_grid_thwto compute multimodal RoPE positions, so the HF forward failed before logits were produced. The fix preserves and forwards both fields under their exact processor keys, pads each consistently with TP-padded input IDs, and carriesmm_token_type_idsthrough the Megatron single-batch path. It does not change token selection, the required next-token match, the cosine-similarity threshold, or absolute-difference reporting.The original pretrain sanity run used the H100 canonical topology in deterministic mode. For this 48-Gated-DeltaNet-layer model, deterministic mode selects the torch-native GDN reference path instead of the fused implementation. TP4/PP4 also consumed the entire 16-GPU world as pipeline parallelism, while full activation recompute repeated expensive GDN forward work.
The canonical
qwen35_vl_27b_pretrain_16gpu_gb200_bf16_mock_confignow keeps the same projector-only objective, BF16 precision, sequence length, and global batch while using TP2/PP1/CP1, DP8, MBS4, fused GDN execution, and no activation recompute. This executes one microbatch per DP rank without pipeline bubbles. TP1/PP1 with MBS2 was rejected because cold GDN autotuning exhausted the approximately 185-GiB device memory; TP2 completed with about 11 GiB of allocated-memory headroom. Evaluation and checkpoint output remain disabled for the bounded performance run. No file undersrc/megatron/bridge/perf_recipes/is added or modified.Changelog
mm_token_type_idsand legacytoken_type_idsthrough the comparison helper without reinterpreting either field.248045, cosine similarity0.995276, maximum absolute logit difference1.125000, and mean absolute difference0.192757.pretrain_performance.GB200result so the original deterministic functional pretrain/checkpoint-resume pair remains intact.Performance result
On 16 GB200 GPUs in one NVL72 domain, the exact committed canonical recipe completed 20 steps with finite losses and gradients, zero skipped iterations, and zero NaN iterations. Steps 11–20 averaged 1,139.500 ms and 1,230.090 model TFLOP/s/GPU; peak allocated memory was 173.760 GiB. The first-iteration kernel-compilation outlier is excluded from the sustained average. This is 2.72x the prior 451.720 TFLOP/s/GPU canonical result. This mock projector-only result is throughput evidence, not full-model convergence evidence.
Validation
uv run python -m pytest tests/unit_tests/test_compare_mask_handling.py -q— 20 passed on GB200.7f9864c4712f401213ecd3c734a2bf627c306438— passed on 16 GB200 GPUs; last-10 average 1,230.090 model TFLOP/s/GPU.scripts/inference/infer.sh --task model-comparisonworkflow — passed from clean Bridge commitab905ac72ccc9e45a081153655eda9ee469fdcffon four GB200 GPUs.Before your PR is "Ready for review"
Pre checks:
Additional Information
The comparison fix does not loosen the verification goal, and the optimized performance evidence is deliberately separate from deterministic convergence/resume evidence.