Skip to content

[NVBug 6980192] Fix NVFP4 Conv3d activation quantization disable state - #3033

Merged
Zhehao-Hu merged 1 commit into
mainfrom
zhehaoh/fix-6980192-conv3d-disable-quant
Oct 26, 2026
Merged

Zhehao-Hu merged 1 commit into
mainfrom
zhehaoh/fix-6980192-conv3d-disable-quant

Conversation

@Zhehao-Hu

@Zhehao-Hu Zhehao-Hu commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: Bug fix

Calling input_quantizer.disable_quant() previously left activation
quantization active in the fused NVFP4 Conv3d kernel because dispatch
checked only is_enabled.

Check both is_enabled and _if_quant before enabling activation
quantization in the kernel. This fixes regular Conv3d and Wan causal
Conv3d while preserving independent weight quantization.

Usage

Existing calls now behave as expected:

model.input_quantizer.disable_quant()
output = model(x)  # Fused Conv3d skips activation quantization.

Testing

Validated using the real CUDA kernel on RTX 6000 Ada with PyTorch
26.07 and Diffusers 0.39.0:

  • 80 focused checks passed, including existing convolution tests.
  • Six new GPU cases cover regular Conv3d and Wan Conv3d with and
    without cached frames, with weight quantization enabled or disabled.
  • Each case verifies equivalence to bypassing the activation quantizer
    and restoration of the original output after re-enabling.
  • All six cases fail with the fix reverted and pass after restoration.
  • All pre-commit checks passed.

B300 and full-model video generation were not tested.

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 (e.g. avoiding hardcoded trust_remote_code=True, torch.load(..., weights_only=False), pickle, etc.).

  • 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 - Not yet run

Additional Information

Fixes NVBug 6980192.

Summary by CodeRabbit

  • Bug Fixes
    • Conv3D now correctly respects the activation quantizer’s active state when applying quantization, making disabled activation quantization behave as expected.
  • Tests
    • Added GPU regression coverage for NVFP4 Conv3D behavior, including activation quantization toggling and optional Wan convolution variants.

Honor both is_enabled and _if_quant when selecting activation
quantization in the fused Conv3d kernel. Previously, disable_quant()
left is_enabled true, so activation quantization continued.

Add GPU regression coverage for regular and Wan Conv3d, including
cached frames, independent weight quantization, and re-enabling.

NVBug: 6980192
Signed-off-by: Zhehao Hu <[email protected]>
@copy-pr-bot

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

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0b953a3 and 73ff1f2.

Files selected for processing: 2
  • modelopt/torch/quantization/nn/modules/quant_conv.py
  • tests/gpu/torch/quantization/test_quant_conv_gpu.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

Walkthrough

The Conv3d implicit-GEMM call now enables activation quantization only when the input quantizer is enabled and _if_quant is true. A GPU regression test checks disabling and restoring input QDQ.

Changes: Conv3d activation quantization

Layer / File(s) Summary
Activation quantization gating and regression test
modelopt/torch/quantization/nn/modules/quant_conv.py, tests/gpu/torch/quantization/test_quant_conv_gpu.py
The implicit-GEMM call checks both input_quantizer.is_enabled and _if_quant. The GPU test covers regular Conv3d and optional Wan variants, with weight quantization enabled or disabled. It verifies output behavior when input QDQ is disabled and restored.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 73ff1

No actionable merge-blocking risk is established for the Conv3d activation-quantization fix; it is mergeable after normal checks.

Pre-merge checks: Passed 6
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns Passed PASS. The pull request changes only quant_conv.py and adds a GPU regression test. The changes add no torch.load(..., weights_only=False), numpy.load(..., allow_pickle=True), hardcoded `trust_rem…
Title check Passed The title names the main change: fixing the NVFP4 Conv3d activation quantization disable state. The raw summary says the Conv3d implicit-GEMM kernel's quant_act now also checks the quantizer's _if_qua…
Full details: Security Anti-Patterns

Explanation

PASS. The pull request changes only quant_conv.py and adds a GPU regression test. The changes add no torch.load(..., weights_only=False), numpy.load(..., allow_pickle=True), hardcoded trust_remote_code=True, external-input eval()/exec(), or # nosec comments. The diff adds no package dependencies.

Full details: Title check

Explanation

The title names the main change: fixing the NVFP4 Conv3d activation quantization disable state. The raw summary says the Conv3d implicit-GEMM kernel's quant_act now also checks the quantizer's _if_quant state, which matches the title. The title also includes an NVBug ID, which is acceptable as a tracking reference. The title is specific and concise.

Finishing Touches: 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cjluo-nv cjluo-nv 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.

Bot review (gpt-6.1-sol) — DM the bot to share feedback.

Approve: the fused kernel now respects activation quantization state, with focused regression tests covering Conv3d, Wan cached frames, and independent weight settings.

No action needed.

@Zhehao-Hu
Zhehao-Hu marked this pull request as ready for review October 26, 2026 19:31
@Zhehao-Hu
Zhehao-Hu requested review from a team as code owners October 26, 2026 19:31
@Zhehao-Hu
Zhehao-Hu requested a review from kaix-nv October 26, 2026 19:31
@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.02%. Comparing base (c2c2b49) to head (73ff1f2).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3033      +/-   ##
==========================================
+ Coverage   77.50%   79.02%   +1.52%     
==========================================
  Files         661      661              
  Lines       74949    75375     +426     
==========================================
+ Hits        58088    59565    +1477     
+ Misses      16861    15810    -1051     
Flag Coverage Δ
examples-diffusers 19.90% <ø> (-0.01%) ⬇️
examples-gpt-oss 13.44% <ø> (-0.01%) ⬇️
examples-hf_ptq 23.34% <ø> (-0.04%) ⬇️
examples-llm_distill 13.52% <ø> (-0.01%) ⬇️
examples-llm_eval 17.17% <ø> (-0.01%) ⬇️
examples-llm_qat 17.34% <ø> (-0.03%) ⬇️
examples-llm_sparsity 16.76% <ø> (-0.01%) ⬇️
examples-megatron_bridge 26.48% <ø> (-0.22%) ⬇️
examples-specdec_bench 13.23% <ø> (-0.01%) ⬇️
examples-speculative_decoding 17.42% <ø> (-0.07%) ⬇️
examples-torch_onnx 21.21% <ø> (-0.03%) ⬇️
examples-torch_trt 15.15% <ø> (-0.01%) ⬇️
examples-vllm_serve 17.38% <ø> (-0.01%) ⬇️
gpu 59.04% <ø> (+7.99%) ⬆️
regression 15.04% <ø> (-0.01%) ⬇️
unit 61.16% <ø> (+<0.01%) ⬆️

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.

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-26 20:20 UTC

@Zhehao-Hu Zhehao-Hu changed the title Fix NVFP4 Conv3d activation quantization disable state [NVBug 6980192] Fix NVFP4 Conv3d activation quantization disable state Oct 26, 2026
@Zhehao-Hu
Zhehao-Hu merged commit c6fa613 into main Oct 26, 2026
56 of 57 checks passed
@Zhehao-Hu
Zhehao-Hu deleted the zhehaoh/fix-6980192-conv3d-disable-quant branch October 26, 2026 20:20
kevalmorabia97 added a commit that referenced this pull request Oct 28, 2026
#2928 #2885 #2908 #2929 #2950 #2972 #2877 #2951 #2816 #3005 #3012 #2971 #3015 #3006 #3026 #2988 #3028 #1860 #3030 #2612 #3033 #2653 #2599 #2655 #2618 #2868 #3032 #3027 #2869 #2984 #2975 #2345 #3020 #2997 (#3072)

## Cherry-picked PRs

- #2817
- #2671
- #2892
- #2876
- #2910
- #2911
- #2919
- #2904
- #2937
- #2928
- #2885
- #2908
- #2929
- #2950
- #2972
- #2877
- #2951
- #2816
- #3005
- #3012
- #2971
- #3015
- #3006
- #3026
- #2988
- #3028
- #1860
- #3030
- #2612
- #3033
- #2653
- #2599
- #2655
- #2618
- #2868
- #3032
- #3027
- #2869
- #2984
- #2975
- #2345
- #3020
- #2997

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Diffusion exports now offer more control over attention-quantizer
metadata and preserve sparse-attention settings in a format compatible
with downstream tooling.
* Model loading better handles select bundled model implementations, and
Docker guidance now covers writable CUDA-extension cache locations.
* **Bug Fixes**
* Improved reliability for model export and checkpoint saving,
quantization across devices, ONNX processing, and calibration.
* Temporary TensorRT and autotuning artifacts now use private
directories by default.
* **Documentation**
* Updated installation guidance, compatibility notes, and links;
corrected typos across guides and examples.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Chad Voegele <[email protected]>
Signed-off-by: Rohan Joshi <[email protected]>
Signed-off-by: LinCanNerd <[email protected]>
Signed-off-by: Keval Morabia <[email protected]>
Signed-off-by: weimingc <[email protected]>
Signed-off-by: Noey Yang <[email protected]>
Signed-off-by: Kai Xu <[email protected]>
Signed-off-by: Zhehao Hu <[email protected]>
Signed-off-by: noeyy-mino <[email protected]>
Signed-off-by: joe-nv <[email protected]>
Signed-off-by: yingguo-trt <[email protected]>
Signed-off-by: Shengliang Xu <[email protected]>
Signed-off-by: Chenjie Luo <[email protected]>
Signed-off-by: anmaurya001 <[email protected]>
Signed-off-by: Connor Baker <[email protected]>
Signed-off-by: wiederse <[email protected]>
Signed-off-by: Vu Dinh <[email protected]>
Signed-off-by: Pratik Gandhi <[email protected]>
Signed-off-by: Michael Rusu <[email protected]>
Signed-off-by: Michael-Rusu <[email protected]>
Signed-off-by: namgyu-youn <[email protected]>
Signed-off-by: Sylvester Kaczmarek <[email protected]>
Signed-off-by: Javier de Jesus <[email protected]>
Signed-off-by: javierdejesusda <[email protected]>
Signed-off-by: Zhiyu Cheng <[email protected]>
Signed-off-by: Juhi Mittal <[email protected]>
Signed-off-by: Dmitry Rantovov <[email protected]>
Signed-off-by: h-guo18 <[email protected]>
Co-authored-by: Chad Voegele <[email protected]>
Co-authored-by: LinCanNerd <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Keval Morabia <[email protected]>
Co-authored-by: Wei-Ming Chen <[email protected]>
Co-authored-by: noeyy-mino <[email protected]>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: kaix-nv <[email protected]>
Co-authored-by: Zhehao Hu <[email protected]>
Co-authored-by: joe <[email protected]>
Co-authored-by: yingguo-trt <[email protected]>
Co-authored-by: Shengliang Xu <[email protected]>
Co-authored-by: Chenjie Luo <[email protected]>
Co-authored-by: anmaurya001 <[email protected]>
Co-authored-by: Connor Baker <[email protected]>
Co-authored-by: Jiao Mingyang <[email protected]>
Co-authored-by: Vu Dinh <[email protected]>
Co-authored-by: Pratik Gandhi <[email protected]>
Co-authored-by: Michael R <[email protected]>
Co-authored-by: Michael-Rusu <[email protected]>
Co-authored-by: namgyu-youn <[email protected]>
Co-authored-by: Sylvester Kaczmarek <[email protected]>
Co-authored-by: Javier De Jesus <[email protected]>
Co-authored-by: Zhiyu <[email protected]>
Co-authored-by: Juhi Mittal <[email protected]>
Co-authored-by: Dmitry Rantovov <[email protected]>
Co-authored-by: h-guo18 <[email protected]>
@rohansjoshi rohansjoshi added the cherry-pick-done Added by bot once PR is cherry-picked to the release branch label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-0.48.0 cherry-pick-done Added by bot once PR is cherry-picked to the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants