Skip to content

Add unscaled E5M2 fake quantization and Slurm eval support - #2019

Draft
ChenhanYu wants to merge 9 commits into
mainfrom
chenhany@nvidia.com/omniml-5492
Draft

Add unscaled E5M2 fake quantization and Slurm eval support#2019
ChenhanYu wants to merge 9 commits into
mainfrom
chenhany@nvidia.com/omniml-5492

Conversation

@ChenhanYu

@ChenhanYu ChenhanYu commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change: new feature

Adds an unscaled E5M2 fake-quantization configuration for weights, activations, and KV cache. It also adds a Qwen3-4B vLLM fake-quant evaluation example and completes the ModelOpt MCP handoff needed to run and monitor it on Slurm.

The MCP changes:

  • preserve resolved container_mounts and srun_args from cluster inventory;
  • use the explicit NEMORUN_HOME when configured, otherwise NeMo Run's native ~/.nemo_run default consistently across submission and status;
  • retrieve terminal task logs in-process through the stored NeMo Run tunnel; and
  • return the final log tail from wait_for_experiment by default.

The previous log reader spawned uv run nemo. In an installed uv tool environment, that child command resolved against the MCP working directory instead of the tool environment, so it could report Failed to spawn: nemo even though nemo-run was installed with modelopt-mcp. Loading the experiment and using its tunnel in-process removes that PATH dependency and uses the MCP's declared nemo-run dependency directly.

Using one canonical NEMORUN_HOME is also necessary because the tunnel and executor configuration are stored in the local experiment sidecar. Submission, status, wait, and log retrieval must resolve the same sidecar directory.

The Slurm evaluation path additionally:

  • selects python3 with a python fallback because the vLLM image does not expose a python alias;
  • packages ModelOpt's pyproject.toml and LICENSE_HEADER, allowing the source-only launcher payload to create valid nvidia-modelopt distribution metadata;
  • installs ModelOpt in editable mode so its runtime dependencies are present without upgrading an already-compatible Torch installation; and
  • installs the lm_eval[api] extra required by the local OpenAI-compatible completion client.

Usage

uv run --with-editable tools/launcher modelopt-launcher \
  --yaml tools/launcher/examples/Qwen/Qwen3-4B/vllm_fakequant_eval.yaml \
  --dryrun --yes

The example expects Qwen3-4B at /hf-local/Qwen/Qwen3-4B and uses E5M2_DEFAULT_CFG for a 20-sample GSM8K smoke evaluation.

Testing

  • uv run --project tools/mcp --with pytest pytest -q tools/mcp/tests — 69 passed
  • uv run --project tools/launcher --with pytest pytest -q tools/launcher/tests/test_examples_resolve.py — 59 passed
  • Repository pre-commit hooks on all changed files — passed
  • bash -n tools/launcher/common/vllm/fakequant_eval.sh — passed
  • Launcher dry run at commit e6700897609f49c7401b0ba0b522effbbb206ab2 with resolved mounts and --mpi=pmix — passed
  • Computelab Slurm job 3288165 / experiment cicd_1785097664 — completed successfully in 5m21s
  • Qwen3-4B unscaled E5M2 fake-quant GSM8K smoke result: 15/20 exact match (0.75, strict and flexible extraction)

Before your PR is "Ready for review"

Make sure you read and follow Contributor guidelines and your commits are signed (git commit -s -S).

Make sure you read and follow the Security Best Practices.

  • Is this change backward compatible?: ✅
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A
  • Did you write any new necessary tests?: ✅
  • Did you update Changelog?: N/A
  • Did you get Claude approval on this PR?: N/A

Additional Information

Related work item: OMNIML-5492.

Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 26, 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.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0054b403-cd81-481f-830a-31a40571b547

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chenhany@nvidia.com/omniml-5492

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://NVIDIA.github.io/Model-Optimizer/pr-preview/pr-2019/

Built to branch gh-pages at 2026-07-26 22:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.19%. Comparing base (d143276) to head (4957170).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
modelopt/torch/quantization/tensor_quant.py 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2019      +/-   ##
==========================================
- Coverage   75.79%   75.19%   -0.60%     
==========================================
  Files         518      519       +1     
  Lines       58658    59687    +1029     
==========================================
+ Hits        44459    44884     +425     
- Misses      14199    14803     +604     
Flag Coverage Δ
unit 54.90% <93.75%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant