Skip to content

feat(models): add Qwen3.8-27B Megatron support - #3678

Merged
sharonyu-115 merged 13 commits into
NVIDIA-NeMo:mainfrom
zpqiu:feat/qwen3.8-27b-mcore
Aug 31, 2026
Merged

feat(models): add Qwen3.8-27B Megatron support#3678
sharonyu-115 merged 13 commits into
NVIDIA-NeMo:mainfrom
zpqiu:feat/qwen3.8-27b-mcore

Conversation

@zpqiu

@zpqiu zpqiu commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds initial functional support for Qwen/Qwen3.8-27B on the Megatron/MCore backend.

  • Adds a 2-node, 8-GPU-per-node GRPO recipe using Megatron TP4 + PP2 + CP2 and vLLM TP4.
  • Inherits the Qwen3.5-9B Megatron recipe and overrides only the settings needed for Qwen3.8-27B. The effective rollout batch is 32 prompts x 8 generations = 256 samples, matching the global batch size of 256.
  • Adds a 10-step nightly driver with checkpointing enabled and the same metric checks as the Qwen3.5-9B Megatron nightly.
  • Documents the Qwen3.8 support status and registers the new model guide.
  • AutoModel backend support will be validated in a follow-up PR.

Issues

Progress toward #3675. This PR covers the Megatron/MCore backend; AutoModel backend validation will follow in a separate PR.

Usage

uv run examples/run_grpo.py \
  --config examples/configs/recipes/llm/grpo-qwen3.8-27b-2n8g-megatron-tp4pp2cp2.yaml

Validation

  • bash -n tests/test_suites/llm/grpo-qwen3.8-27b-2n8g-megatron-tp4pp2cp2.sh
  • TEST_DRYRUN=1 bash tests/test_suites/llm/grpo-qwen3.8-27b-2n8g-megatron-tp4pp2cp2.sh
  • python3 tools/config_cli.py minimize-check examples/configs/recipes/llm/grpo-qwen3.8-27b-2n8g-megatron-tp4pp2cp2.yaml
  • git diff --check

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 run the relevant functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

Wandb Link: https://wandb.ai/nvidia/nemorl-pr3678 (including 100-step run and nightly test run).

@copy-pr-bot

copy-pr-bot Bot commented Aug 17, 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.

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Aug 17, 2026
@zpqiu
zpqiu force-pushed the feat/qwen3.8-27b-mcore branch from 6f168ee to 2118cf1 Compare August 18, 2026 06:56
@zpqiu
zpqiu marked this pull request as ready for review August 19, 2026 00:35
@zpqiu
zpqiu requested review from a team as code owners August 19, 2026 00:35

@zpqiu zpqiu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review of the Qwen3.8-27B Megatron recipe. Nice addition - the recipe itself is clean, it inherits rather than duplicating the 9B settings, and the guide/model-support.md/toctree wiring is all consistent.

One blocking item: the new nightly puts the suite over the GPU-hour cap, so a unit test that runs in L0 CI fails. Details inline, with the fix that matches how previous nightly-adding PRs handled it.

Verified correct, no action needed:

  • Both nightly metric thresholds hold on real 10-step runs (numbers inline).
  • NUM_MINUTES=60 matches fleet convention for 2n8g/10-step Megatron nightlies and has ~43% headroom over measured runtime.
  • The guide's "context parallelism requires sequence packing" claim is backed by a hard assert at nemo_rl/models/megatron/setup.py#L862. (docs/model-quirks.md#L29 says the opposite, but it's scoped to the FSDP2 section - no conflict.)
  • TP4 x PP2 x CP2 = 16 = 2 nodes x 8 GPUs; make_sequence_length_divisible_by: 16 is consistent with TP x CP x 2.
  • Recipe naming, CONFIG_PATH derivation via common.env, and nightly.txt accounting all check out - the other 11 tests in test_recipes_and_test_suites.py pass.
  • Docs: > [!NOTE] matches the dominant convention (28 files, incl. qwen3-5.md); all added links resolve; the PNG is 344K, small relative to sibling assets.
  • No missing model registration - the qwen3_5 special-cases in policy/utils.py and vllm_worker.py are VLM-only, and Qwen3.8-27B is dense text-only.

Generated by Claude Code

Comment thread tests/test_suites/nightly.txt
Comment thread tests/test_suites/llm/grpo-qwen3.8-27b-2n8g-megatron-tp4pp2cp2.sh
@zpqiu
zpqiu requested review from sharonyu-115 and yuki-97 August 19, 2026 03:47
@zpqiu
zpqiu force-pushed the feat/qwen3.8-27b-mcore branch 5 times, most recently from 73ff19a to 8753083 Compare August 24, 2026 15:16
Comment thread tests/unit/test_recipes_and_test_suites.py Outdated
Comment thread tests/test_suites/llm/grpo-qwen3.8-27b-2n8g-megatron-tp4pp2cp2.sh
Comment thread docs/guides/models/qwen/qwen3-8.md Outdated
zpqiu added 10 commits August 29, 2026 03:44
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
Signed-off-by: Zhaopeng Qiu <alexq@nvidia.com>
@zpqiu
zpqiu force-pushed the feat/qwen3.8-27b-mcore branch from 8753083 to fdc6805 Compare August 29, 2026 10:46
zpqiu and others added 2 commits August 30, 2026 09:53
Co-authored-by: sharonyu-115 <shuangy@nvidia.com>
Signed-off-by: alexchiu <qiuzhaopeng@foxmail.com>
@zpqiu
zpqiu requested a review from sharonyu-115 August 30, 2026 01:54
@sharonyu-115
sharonyu-115 enabled auto-merge (squash) August 31, 2026 02:55
@zpqiu
zpqiu requested a review from sharonyu-115 August 31, 2026 05:30
@sharonyu-115 sharonyu-115 added the CI:L1 Run doctests, unit tests, and functional tests label Aug 31, 2026
@sharonyu-115

Copy link
Copy Markdown
Contributor

/ok to test 38a9f71

@sharonyu-115
sharonyu-115 merged commit e09e977 into NVIDIA-NeMo:main Aug 31, 2026
101 checks passed
@tdene tdene mentioned this pull request Aug 31, 2026
4 tasks
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 Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants