Skip to content

docs: add AutoQuant KV mixed-precision quantization blog - #2712

Merged
meenchen merged 5 commits into
mainfrom
docs/autoquant-kv-blog
Oct 12, 2026
Merged

meenchen merged 5 commits into
mainfrom
docs/autoquant-kv-blog

Conversation

@meenchen

@meenchen meenchen commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Type of change: documentation

Introduce AutoQuant KV as a general mixed-precision KV cache quantization feature. The blog explains isolated layer scoring and budget-constrained format selection with a diagram and compact equation, demonstrates the Python API and CLI, and shows how KV search follows GEMM AutoQuant.

The scoring explanation makes explicit that GEMM formats and scales stay fixed in the reference and every trial. Deployment guidance recommends scoring on the intended GEMM configuration, covers BF16 and already-quantized KV-only use cases, and explains that NVFP4-K/FP8-V is excluded by the current export path rather than an accuracy comparison.

A Qwen3-8B case study compares default-scale recipes against BF16 across seven benchmarks, including Native 6.25 and AutoQuant 5.33/5.76. At 5.76 effective bits, AutoQuant uses 64% less calculated KV payload than BF16 with a −1.04 percentage-point RULER-128K change. Every recipe difference is result minus BF16.

Three vector SVG figures, the CSV, and evaluation settings accompany the article. The case study uses BF16 weights and a development runtime with asymmetric K/V candidates; the shipped starter example uses a different candidate menu. Payload savings are calculated, accuracy differences are point estimates, and unmatched controls are withheld.

Usage

No new API or flag. The article demonstrates modelopt.torch.quantization.auto_quantize and the shipped general/auto_quantize/kv_fp8_nvfp4_cast_kl_div_at_5p4bits recipe, plus the composed GEMM/KV recipe.

Testing

  • Scoped pre-commit hooks and git diff --check passed.
  • Focused Sphinx HTML build passed with warnings treated as errors; all three SVG figures parsed successfully and contain no embedded raster images.
  • Verified seven BF16 scores and 40 recipe differences against 47 saved records, including response coverage and two withheld cells.
  • Statically checked Python example syntax and API keywords, nine CLI flags, and both recipe paths. Enumerated all 16 allocations in the illustrative diagram.
  • Confirmed the install pin 1d392999b45626f9c06ff0bc9797b03529fe24e3 is the merge commit for [OMNIML-5570] 2/2 Compose GEMM and KV-cache AutoQuant workflows #2273, includes [OMNIML-5570, OMNIML-5569] 1/2 Add layer-wise KV-cache AutoQuant with forward KL #2272, and is an ancestor of main.
  • Chrome checks passed at 1440 px and 390 px: figures and math render, the mobile table scrolls without page overflow, and the announcement filter works.

No new GPU evaluation or full API documentation build was run.

Before your PR is "Ready for review"

  • Is this change backward compatible?: ✅ Documentation only.
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A. No new project dependency or copied implementation.
  • Did you write any new necessary tests?: N/A. Documentation and rendered data were validated locally.
  • Did you update Changelog?: N/A. This documents already-merged functionality.
  • Did you get Claude approval on this PR?: ✅ Claude bot review marked 158c3ba LGTM; the follow-up documentation clarifications were validated locally.

Additional Information

Documents #2272 and #2273. Follows the announcement and asset conventions used by #1979 and #2417. The generated diagram and saved-result artifacts are included with the article so reviewers can check its methodology and claims together.

Summary by CodeRabbit

  • New Features
    • Added AutoQuant KV support for searching per-layer key/value cache formats within a memory budget and composing the results with GEMM AutoQuant.
    • Added a Qwen3-8B case study reporting accuracy and modeled KV-payload results, with evaluation details and study qualifications.
    • Added documentation covering candidate formats, layer selection, checkpoint reuse, API usage, and export workflows.
    • Added an announcement page, a KV cache filter for browsing related updates, and a Latest News link to the AutoQuant KV article.

Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
@meenchen
meenchen requested review from a team as code owners October 8, 2026 17:13
@meenchen
meenchen requested a review from cjluo-nv October 8, 2026 17:13
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/Model-Optimizer/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 71a495d2-4e72-4fd4-acdf-dd9cae287e71

📥 Commits

Reviewing files that changed from the base of the PR and between 6f9d008 and 87f27b2.


⛔ Files ignored due to path filters (4)
  • docs/source/announcements/assets/autoquant-kv-qwen3-8b-accuracy-memory.svg is excluded by !**/*.svg
  • docs/source/announcements/assets/autoquant-kv-qwen3-8b-layer-allocation.svg is excluded by !**/*.svg
  • docs/source/announcements/assets/autoquant-kv-qwen3-8b-results.csv is excluded by !**/*.csv
  • docs/source/announcements/assets/autoquant-kv-search.svg is excluded by !**/*.svg

📒 Files selected for processing (1)
  • docs/source/index.rst

🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/source/index.rst

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



📝 Walkthrough

Walkthrough

The changes add documentation for KV AutoQuant workflows, GEMM composition, Qwen3-8B results, and study methods. The announcement is linked from the index and README.

Changes

AutoQuant KV documentation

Layer / File(s) Summary
KV AutoQuant workflow and API
docs/source/announcements/autoquant-kv.rst
Describes candidate scoring, bit-budget search, checkpoint reuse conditions, and API and Hugging Face workflows.
GEMM composition and study results
docs/source/announcements/autoquant-kv.rst, docs/source/announcements/assets/autoquant-kv-qwen3-8b-methods.json
Documents sequential GEMM and KV quantization, Qwen3-8B comparisons, layer allocations, and study qualifications. The JSON records model and runtime details, search setup, accuracy and payload definitions, benchmark parameters, and availability caveats.
Announcement discovery links
docs/source/index.rst, README.md
Adds a KV cache filter and dated announcement card to the index, and a dated news link to the README.

Priority: ⬇️ Low

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

Change: Other


Merge Risk: ⚪ Minimal · up to 87f27

The announcement discovery changes are mergeable after normal documentation checks.

Pre-merge checks · Passed 6
Passed Passed checks (6 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding an AutoQuant KV mixed-precision quantization blog.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 authoritative PR diff changes documentation and data/assets only. It adds no files under modelopt/ or Python example files, and it changes no pyproject.toml or requirements.txt manifes…

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.61%. Comparing base (5b01d53) to head (87f27b2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2712      +/-   ##
==========================================
+ Coverage   69.46%   71.61%   +2.14%     
==========================================
  Files         647      649       +2     
  Lines       71679    71739      +60     
==========================================
+ Hits        49794    51377    +1583     
+ Misses      21885    20362    -1523     
Flag Coverage Δ
unit 59.89% <ø> (+<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.

Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 8, 2026 •

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

Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>

@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 (bedrock-claude-opus-5-5) — DM the bot to share feedback.

LGTM: this docs-only blog is correct and internally consistent. The size budget doesn't apply because there's no core logic, but a human should sign off on the 1.8k lines of generated figures and the public claims.

Needs action:

  • Sign off as a human on the published claims and the rendered preview. The bulk of the diff is generated SVG plus CSV/JSON study data, and the results come from an undistributed development vLLM runtime.
  • Confirm that pinned commit 1d392999b45626f9c06ff0bc9797b03529fe24e3 in the install snippet is on main and contains #2272/#2273.

No action needed:

  • The design-review gate fired on line count only. The PR adds no new subsystem, abstraction or dependency.
  • I verified both recipe paths in modelopt_recipes/general/auto_quantize/, the --kv_auto_quantize_checkpoint flag in hf_ptq.py, and cost_model: kv_cache in the recipe.
  • The headline numbers match the CSV:
    • The 64.0% payload cut (5.764/16).
    • 7.8% less payload than Native 6.25.
    • 4.50 GiB of BF16 KV payload at 32K tokens.
    • The ±0.63-point claim across five benchmarks.
    • The half-up rounding, e.g. −1.875 → −1.88.
  • There's no licensing change and no test code is affected.

K/V (8 bits) and NVFP4 K/V (4.5 bits including block scales). The case study
also includes FP8 K with NVFP4 V (6.25 bits for equal K/V widths).

**Score each choice.** Compare each isolated layer/candidate trial against a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hi @meenchen , shall we refine this section further. At first reading it may not be very clear whether the GEMM are quantized always or not when computing the KL Divergence. For the two cases for fp8 KV vs NVFP4 KV, we will have two choices for layer X KV$.

  1. output using the bf16 KV$ in layer X- do GEMM stay quantized here?
  2. output using the fp8 KV$ in layer X- do GEMM stay same quantized here?
  3. output using the NVFP4 KV$ in layer X- do GEMM stay same quantzied here?

Then we compute KL divergence between 1 and 2 and 1 and 3.

May be helpful to confirm if for #1 GEMM is quantized and stays in same precision as 2 and 3

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.

Addressed in 6f9d008. The scoring paragraph and diagram now explicitly keep GEMM formats and scales fixed in the reference and every candidate trial. Starting from BF16 preserves BF16 GEMMs; starting from a quantized model preserves that same GEMM configuration throughout. Each trial changes only the selected layer's K/V pair, and both candidate outputs are compared with the same reference.

K/V (8 bits) and NVFP4 K/V (4.5 bits including block scales). The case study
also includes FP8 K with NVFP4 V (6.25 bits for equal K/V widths).

**Score each choice.** Compare each isolated layer/candidate trial against a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hi @meenchen , shall we refine this section further. At first reading it may not be very clear whether the GEMM are quantized always or not when computing the KL Divergence. For the two cases for fp8 KV vs NVFP4 KV, we will have two choices for layer X KV$.

  1. output using the bf16 KV$ in layer X- do GEMM stay quantized here?
  2. output using the fp8 KV$ in layer X- do GEMM stay same quantized here?
  3. output using the NVFP4 KV$ in layer X- do GEMM stay same quantzied here?

Then we compute KL divergence between 1 and 2 and 1 and 3.

May be helpful to confirm if for #1 GEMM is quantized and stays in same precision as 2 and 3

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.

Addressed in 6f9d008. The scoring paragraph and diagram now explicitly keep GEMM formats and scales fixed in the reference and every candidate trial. Starting from BF16 preserves BF16 GEMMs; starting from a quantized model preserves that same GEMM configuration throughout. Each trial changes only the selected layer's K/V pair, and both candidate outputs are compared with the same reference.


**Prepare candidates.** The starter recipe uses constant scales and offers FP8
K/V (8 bits) and NVFP4 K/V (4.5 bits including block scales). The case study
also includes FP8 K with NVFP4 V (6.25 bits for equal K/V widths).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we mention a line whether the case of NVFP4 K and FP8 V makes sense, or why we excluded that?

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.

Addressed in 6f9d008. Added a note under candidate preparation explaining that the current export path does not support NVFP4 K with FP8 V. The study did not evaluate that pair's accuracy; the documented exclusion is an export limitation.

weight/activation quantizers and calibrated tensors, then runs forward-KL KV
search. Its 5.4-bit weight and 5.4-bit KV targets constrain separate storage
domains; this is a sequential search, not one joint bit budget.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we add a recommendation for users to always run the KV$ autoquantize alongside the GEMM scores- I see little value if we run the mixed precision on KV$ alone as we may not get a good signal if the GEMM is not quantized.

Do we actually have cases where we may want to run the KV$ AutoQuantize only?

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.

Addressed in 6f9d008. The GEMM composition section now recommends scoring KV candidates on the GEMM configuration intended for deployment, applying GEMM AutoQuant or fixed PTQ first when GEMMs will be quantized. It also explains the KV-only use cases: BF16 deployments, controlled KV studies such as this case study, and adding KV compression to an already-quantized model. Changing GEMM settings still requires recomputing KV sensitivity.

@shengliangxu shengliangxu 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.

LGTM

Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
@meenchen

Copy link
Copy Markdown
Contributor Author

/ok to test 87f27b2

@meenchen
meenchen merged commit ff45849 into main Oct 12, 2026
33 checks passed
@meenchen
meenchen deleted the docs/autoquant-kv-blog branch October 12, 2026 21:23
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.

4 participants