Skip to content

Skill for searching quantization recipes#1593

Open
meenchen wants to merge 15 commits into
mainfrom
weimingc/quant-recipe-loop-skill
Open

Skill for searching quantization recipes#1593
meenchen wants to merge 15 commits into
mainfrom
weimingc/quant-recipe-loop-skill

Conversation

@meenchen
Copy link
Copy Markdown
Contributor

@meenchen meenchen commented Jun 1, 2026

What does this PR do?

Type of change: New skill

Adds a quant-recipe-search skill for guiding iterative quantization recipe development. The skill focuses on choosing compression objectives, starting from existing ModelOpt recipe baselines, planning AutoQuant/manual recipe candidates, interpreting sensitivity results, and deciding the next experiments while delegating PTQ, deployment, eval launching, monitoring, and result comparison to the existing dedicated skills.

Default search goal: find the best-performing recipe for the chosen objective while keeping each benchmark’s accuracy loss under 1pp versus the matching baseline, with reruns for noisy or near-threshold regressions.

Usage

User can ask: "Find the best quantization recipe and generate a PTQ checkpoint for this model."

The skill will:

  1. Recover existing recipes, checkpoints, evals, and AutoQuant/sensitivity state.
  2. Ask for missing search constraints such as compute-vs-memory objective, benchmark set, and acceptable accuracy loss.
  3. Start from ModelOpt recipe baselines.
  4. Plan AutoQuant/manual recipe candidates.
  5. Delegate checkpoint generation to the ptq skill.
  6. Delegate eval launch/monitoring/comparison to the existing eval skills.
  7. Recommend promote/rerun/reject decisions until a recipe satisfies the target.

Testing

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?: ✅ / ❌ / N/A
  • 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?: ✅ / ❌ / N/A
  • Did you update Changelog?: ✅ / ❌ / N/A
  • Did you get Claude approval on this PR?: ✅ / ❌ / N/A

Additional Information

Summary by CodeRabbit

  • Documentation
    • Added guidance for orchestrating multi-candidate quantization recipe-search workflows: staged core loop, gating/validation, and responsibility boundaries with related skills.
    • Added a Qwen3.6 case study summarizing a representative exploration, sensitivity findings, and operational runbook notes.
    • Added a recipe-iteration reference covering candidate types, default targets/metrics, validation/regression rules, cost accounting, and practical defaults.

meenchen added 5 commits June 1, 2026 14:39
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Jun 1, 2026

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
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Review 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
📝 Walkthrough

Walkthrough

Adds documentation for a quantization recipe search skill: skill metadata, responsibility mapping to related skills, a staged core iteration loop, practical defaults, and two supporting reference documents (recipe iteration guide and Qwen3.6 case study).

Changes

Quant Recipe Search Skill Documentation

Layer / File(s) Summary
Skill definition and core workflow
.claude/skills/quant-recipe-search/SKILL.md
Front-matter and metadata, explicit use vs do-not-use guidance, responsibility boundaries with related skills (ptq, deployment, evaluation, launching-evals, monitor, accessing-mlflow, compare-results), staged core loop (recover state → define objectives/acceptance → generate candidates → gate/validate → staged evaluation with comparability checks → refresh portfolio table → decide next iteration), and practical defaults plus references.
Reference documentation: recipe iteration and Qwen3.6 case study
.claude/skills/quant-recipe-search/references/recipe_iteration.md, .claude/skills/quant-recipe-search/references/qwen36_case_study.md
Recipe-iteration guide covering candidate taxonomy, target/metric defaults, delegation mapping, ModelOpt PTQ orchestration, baseline selection, AutoQuant/manual checklists, active-cost accounting, and validation rules; Qwen3.6 case study summarizing observed recipe patterns, sensitivities (e.g., LCB), and runtime-parameter tracking guidance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • kaix-nv
🚥 Pre-merge checks | ✅ 6
✅ 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 'Skill for searching quantization recipes' clearly and directly summarizes the main change—adding a new skill for quantization recipe search, which is the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 PR adds only skill documentation files (.md). No Python code changes in modelopt package or examples directories. Security anti-pattern check only applies to Python changes, which are absent.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch weimingc/quant-recipe-loop-skill

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

@meenchen meenchen requested a review from shengliangxu June 1, 2026 22:35
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
@meenchen meenchen force-pushed the weimingc/quant-recipe-loop-skill branch from ec55ea0 to eda36e9 Compare June 1, 2026 22:36
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.claude/skills/quant-recipe-search/references/qwen36_case_study.md (1)

22-22: 💤 Low value

Consider expanding "LCB" on first use.

"LCB" appears twice (lines 22 and 28) without being spelled out. While readers familiar with the quantization benchmark suite will recognize "LiveCodeBench," first-time readers of this case study may need the expansion for clarity.

📝 Suggested expansion
-- Self-attention NVFP4 hurt LCB for modest active-byte savings.
+- Self-attention NVFP4 hurt LiveCodeBench (LCB) for modest active-byte savings.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/quant-recipe-search/references/qwen36_case_study.md at line
22, Expand the acronym "LCB" on first use in qwen36_case_study.md by replacing
the first occurrence of "LCB" with "LiveCodeBench (LCB)" (or "LCB
(LiveCodeBench)" if preferred) so readers unfamiliar with the benchmark
understand the term, and leave subsequent mentions as "LCB" or ensure any later
standalone occurrences are consistent with that expansion (notably the second
occurrence currently at line 28).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.claude/skills/quant-recipe-search/references/qwen36_case_study.md:
- Line 22: Expand the acronym "LCB" on first use in qwen36_case_study.md by
replacing the first occurrence of "LCB" with "LiveCodeBench (LCB)" (or "LCB
(LiveCodeBench)" if preferred) so readers unfamiliar with the benchmark
understand the term, and leave subsequent mentions as "LCB" or ensure any later
standalone occurrences are consistent with that expansion (notably the second
occurrence currently at line 28).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0c1047e1-7a25-42e1-bfac-6096be290a4f

📥 Commits

Reviewing files that changed from the base of the PR and between 905259f and ec55ea0.

📒 Files selected for processing (3)
  • .claude/skills/quant-recipe-search/SKILL.md
  • .claude/skills/quant-recipe-search/references/qwen36_case_study.md
  • .claude/skills/quant-recipe-search/references/recipe_iteration.md

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.09%. Comparing base (f0d2237) to head (80fd336).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1593      +/-   ##
==========================================
- Coverage   73.23%   73.09%   -0.15%     
==========================================
  Files         479      480       +1     
  Lines       52435    53744    +1309     
==========================================
+ Hits        38401    39284     +883     
- Misses      14034    14460     +426     
Flag Coverage Δ
unit 53.75% <ø> (+0.12%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

meenchen added 6 commits June 1, 2026 16:16
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
@meenchen meenchen requested a review from hychiang-git June 2, 2026 16:45
Copy link
Copy Markdown
Collaborator

@shengliangxu shengliangxu left a comment

Choose a reason for hiding this comment

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

Approve to unblock. We definitely will keep iterating.

Copy link
Copy Markdown
Contributor

@Edwardf0t1 Edwardf0t1 left a comment

Choose a reason for hiding this comment

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

Thanks @meenchen for adding this skill. I think we need to address the overlap with bigpareto. Our design doc places recipe search in bigpareto (the “strategy/search” layer, with its own /sweep-* skills). This skill is also recipe search, so they need an explicit “when to use which”. Here’s my take:

  • bigpareto = automated breadth sweep, fan-out N configs, Pareto frontier — best for well-supported models you can blind-sweep.
  • quant-recipe-search = interactive depth loop, one candidate at a time with sensitivity interpretation + debugging — best for novel models where each

Does it align with your thoughts?

meenchen added 2 commits June 2, 2026 11:11
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Signed-off-by: weimingc <17592131+meenchen@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@hychiang-git hychiang-git left a comment

Choose a reason for hiding this comment

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

Approve to unblock. Do we have a comparison on the hand-craft recipe and the recipe tune by the agents?

@meenchen
Copy link
Copy Markdown
Contributor Author

meenchen commented Jun 2, 2026

Thanks @meenchen for adding this skill. I think we need to address the overlap with bigpareto. Our design doc places recipe search in bigpareto (the “strategy/search” layer, with its own /sweep-* skills). This skill is also recipe search, so they need an explicit “when to use which”. Here’s my take:

  • bigpareto = automated breadth sweep, fan-out N configs, Pareto frontier — best for well-supported models you can blind-sweep.
  • quant-recipe-search = interactive depth loop, one candidate at a time with sensitivity interpretation + debugging — best for novel models where each

Does it align with your thoughts?

@Edwardf0t1 I think these two should be orthogonal. Bigpareto validates how recipes perform for a given model, and quant-recipe-search generates good recipes. I feel we should keep recipe development in ModelOpt and iterate on the skill over time.

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