Skip to content

feat(modelopt): support real NVFP4 QAT rollout - #2592

Merged
terrykong merged 6 commits into
NVIDIA-NeMo:mainfrom
HollowMan6:real_quant
Jun 25, 2026
Merged

terrykong merged 6 commits into
NVIDIA-NeMo:mainfrom
HollowMan6:real_quant

Conversation

@HollowMan6

@HollowMan6 HollowMan6 commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do ?

Support QAT rollout real quant for ModelOpt NVFP4 W4A16.

This PR adds the real-quant rollout path for vLLM + Megatron QAT, including:

  • exporting packed NVFP4 weights and scale tensors from Megatron policy workers, now this is at Add ModelOpt NVFP4 HF weight export support Megatron-Bridge#4102
  • configuring vLLM with ModelOpt quantization_config for W4A16
  • patching vLLM ModelOpt NVFP4 reload handling for rollout refits
  • supporting real-quant generation config knobs: real_quant, real_quant_mode, real_quant_group_size, and real_quant_ignore
  • adding Qwen3-8B DAPO recipe variants for W4A16
  • adding unit coverage for vLLM ModelOpt NVFP4 config and exporter behavior

Issues

N/A

Usage

policy:
  quant_cfg: examples/modelopt/quant_configs/nvfp4_a16.yaml
  generation:
    quant_cfg: examples/modelopt/quant_configs/nvfp4_a16.yaml
    real_quant: true

Example recipes:

uv run ./examples/run_grpo.py \
  --config examples/configs/recipes/llm/grpo-qwen3-8b-base-dapo-2n8g-long-megatron-qa-nvfp4-w4a16.yaml

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 unit tests and 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

Adds tests/unit/models/generation/test_vllm_modelopt_real_quant_config.py for focused regression coverage.

Experiment results

image image image image

@copy-pr-bot

copy-pr-bot Bot commented May 27, 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.

@HollowMan6 HollowMan6 changed the title QAT rollout real quant support for w4a8 & w4a16 feat(modelopt): support real NVFP4 QAT rollout May 27, 2026
@HollowMan6
HollowMan6 marked this pull request as ready for review May 27, 2026 22:41
@HollowMan6
HollowMan6 requested a review from a team as a code owner May 27, 2026 22:41
Copilot AI review requested due to automatic review settings May 27, 2026 22:41
@HollowMan6
HollowMan6 requested review from a team as code owners May 27, 2026 22:41
@copy-pr-bot

copy-pr-bot Bot commented May 27, 2026

Copy link
Copy Markdown

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

Contributors can view more details about this message here.

@mxinO
mxinO self-requested a review June 24, 2026 05:52
Comment thread nemo_rl/modelopt/utils.py Resolved
Comment thread nemo_rl/modelopt/utils.py Resolved
Comment thread nemo_rl/modelopt/utils.py Resolved
@HollowMan6
HollowMan6 requested a review from mxinO June 24, 2026 08:58
@HollowMan6

Copy link
Copy Markdown
Contributor Author

/ok to test 15541d9

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agent-team review (rl-expert, test-agent, bug-finder, comment-reviewer, devil-advocate). This is a substantial, well-tested feature and the existing maintainer threads are all addressed — nice work. Three inline items below: one must-fix test bug, one author-intent question, and one doc nit.

  • pre-commit run --all-files passes; new source files are type-checked.
  • All 27 prior inline threads verified resolved at head or maintainer-acknowledged future work — no replies needed.

Generated by Claude Code

Comment thread docs/guides/quantization-aware-rl.md Resolved
@HollowMan6
HollowMan6 requested a review from terrykong June 25, 2026 16:55
@HollowMan6

Copy link
Copy Markdown
Contributor Author

/ok to test 6543aa7

@HollowMan6

Copy link
Copy Markdown
Contributor Author

/ok to test bee8598

@HollowMan6

Copy link
Copy Markdown
Contributor Author

/claude review

@terrykong
terrykong enabled auto-merge (squash) June 25, 2026 21:34
@terrykong
terrykong merged commit d2a24cb into NVIDIA-NeMo:main Jun 25, 2026
131 of 137 checks passed
@HollowMan6
HollowMan6 deleted the real_quant branch June 26, 2026 00:42
ashors1 pushed a commit that referenced this pull request Jun 27, 2026
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 Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants