Skip to content
Machine Learning
Skill

/modelopt-quant-recipe-search

Use when the user asks to find, search for, or optimize the best quantization recipe for a model, including direct requests like "find the best quantization recipe and generate a PTQ checkpoint." Guides the multi-candidate loop: choose compute-vs-memory success metrics, select

From plugin
modelopt
5.6k31 skills6 agents

Claude Code

$ npx -y skills add nvidia/model-optimizer --skill modelopt-quant-recipe-search --agent claude-code

SKILL.md

modelopt-quant-recipe-search.SKILL.md
name: modelopt-quant-recipe-search
description: >-
  Use when the user asks to find, search for, or optimize the best quantization
  recipe for a model, including direct requests like "find the best quantization
  recipe and generate a PTQ checkpoint." Guides the multi-candidate loop:
  choose compute-vs-memory success metrics, select ModelOpt recipe baselines,
  design AutoQuant/manual recipe deltas, interpret sensitivity, and decide next
  candidates. Do NOT use for a single known PTQ recipe run (use modelopt-ptq), serving
  (use modelopt-deployment), creating/running evals (use modelopt-evaluation or modelopt-launching-evals),
  monitoring jobs (use modelopt-monitor), MLflow browsing (use modelopt-accessing-mlflow), or
  comparing completed baseline-vs-candidate scores only (use modelopt-compare-results).

Quant Recipe Search

Use this skill when quantization is an iterative recipe search, not a one-off PTQ run. The skill owns strategy: define success, choose the search space, sequence candidates, and decide the next iteration. It delegates checkpoint generation, serving, evaluation, monitoring, and metric comparison to the existing execution skills.

Treat a direct request such as "find the best quantization recipe and generate a PTQ checkpoint for this model" as enough to start. Recover local state first, then ask only for missing decisions that change the search.

Skill Boundaries

  • Use `modelopt-ptq` to produce and validate checkpoints.
  • Use `modelopt-deployment` to serve checkpoints and debug serving-specific flags.
  • Use `modelopt-evaluation` to create NEL configs and submit evals.
  • Use `modelopt-launching-evals` to run, resume, debug, and analyze NEL runs.
  • Use `modelopt-monitor` for active job tracking.
  • Use `modelopt-accessing-mlflow` for MLflow artifact lookup.
  • Use `modelopt-compare-results` for validated baseline-vs-candidate deltas and score-field comparability.

Do not duplicate those workflows here. This skill should leave the user with a clear recipe portfolio, success metric, experiment sequence, and next decision.

Problem

The task is to find the best recipe for a user-defined target, not merely to produce a quantized checkpoint. A generated PTQ checkpoint is only a candidate. It becomes a recommended recipe only after evaluation and comparison against the matching baseline.

Required inputs before planning candidates:

  • **Optimization goal:** compute/throughput, memory/latency, or a custom metric.
  • **Primary quantization family:** for example NVFP4, W4A16 NVFP4, FP8/W8A8,

INT4/AWQ, or a custom mixed set.

  • **Benchmark set or baseline results:** the user-defined acceptance surface.

If any of these are missing, ask for them. Do not silently default to FP8/W8A8 or call a checkpoint "best" before evaluation.

Default success rule: maximize the chosen performance objective while keeping each benchmark within 1 percentage point of the matching BF16/FP16 baseline. Near-threshold or noisy regressions require reruns before making a decision.

Search Space

Keep the search space explicit. A candidate recipe is a tuple across these axes:

  • **Numeric format:** FP8/W8A8, NVFP4/W4A4, W4A16 NVFP4, INT4/AWQ, or mixed

formats such as NVFP4+FP8.

  • **Calibration/search algorithm:** max calibration, MSE calibration, GPTQ,

AWQ, AutoQuant scoring, and calibration dataset or sample-count variants.

  • **Selection method:** manual/heuristic rules, sensitivity-guided manual

recipes, AutoQuant selection, or a hybrid of AutoQuant plus manual overrides.

  • **Module family:** attention, MLP, MoE experts, routers/gates, embeddings,

`lm_head`, adapters, vision encoders, and model-specific modules.

  • **Layer position:** first/last transformer-layer counts or explicit ordinal

ranges to keep in BF16. First 3-4 and last 1-2 layers are common starting candidate ranges, not defaults.

  • **Runtime fusion constraints:** modules fused by the inference library must

use compatible quantization. Examples: vLLM Qwen `linear_attn.in_proj_qkvz` and fused MoE expert projections such as gate/up (`w1`/`w3`).

  • **Calibration budget:** dataset mix, sample count, sequence length, and batch

settings.

Do not collapse the search to one dimension such as numeric format only. Read `references/recipe_iteration.md` when choosing concrete axes or candidates.

Design Workflow

1. **Recover state**

  • Read result tables, recipe logs, AutoQuant states, sensitivity reports, and

experiment notes before proposing new work.

  • Ask `modelopt-monitor`, `modelopt-launching-evals`, or `modelopt-compare-results` to recover active

job state and completed metrics when needed.

2. **Define the target**

  • Confirm the optimization goal, primary quantization family, benchmark set,

accuracy-loss threshold, calibration budget, and cost metric.

  • Include quantization metadata such as scale storage in active-cost or size

estimates.

3. **Pick baselines and first candidates**

  • Always include BF16/FP16 and a near-lossless FP8/W8A8 baseline unless FP8

itself is the target.

  • For ModelOpt work, start from `modelopt_recipes`: model-specific recipes

first, then general PTQ presets or recipe fragments.

  • Add an AutoQuant candidate in the requested primary family when AutoQuant

is available. Expect AutoQuant to find a better trade-off than a first manual recipe, but validate that assumption with the same evals.

  • Add at least one manual or sensitivity-guided candidate so AutoQuant can be

compared against controlled ablations and there is a fallback if AutoQuant misses the best frontier or hits runtime constraints.

  • When sensitivity or model behavior implicates boundary layers, add a

controlled first-layer, last-layer, or combined BF16 exclusion candidate. Do not preserve boundary layers without testing the trade-off.

4. **Generate candidates**

  • Delegate checkpoint generation and PTQ validation to `modelopt-ptq`.
Read more
@nvidia
Ships withmodelopt

Documentation | Roadmap | NVIDIA Model Optimizer (referred to as Model Optimizer, or ModelOpt) is a library comprising state-of-the-art model optimization techniques including quantization, pruning, Neural Architecture Search (NAS), distillation, speculative

5.6k31 skills6 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
5.6k
Star history of nvidia/model-optimizer on GitHub, a chart by star-history.com

Other skills on modelopt.

accessing-mlflow

accessing-mlflow

Compatibility name for modelopt-accessing-mlflow. Browse ModelOpt evaluation runs and artifacts in MLflow.

@nvidia@nvidiaInstall Skill
benchmark-model-kernels

benchmark-model-kernel…

Compatibility name for modelopt-benchmark-model-kernels. Inspect model shapes and benchmark GEMM or fused-MoE kernels.

@nvidia@nvidiaInstall Skill
common

common

Shared ModelOpt support files. Use only when another ModelOpt skill directs you here.

@nvidia@nvidiaInstall Skill
compare-results

compare-results

Compatibility name for modelopt-compare-results. Compare baseline and quantized evaluation results.

@nvidia@nvidiaInstall Skill
day0-release

day0-release

Compatibility name for modelopt-day0-release. Run the full ModelOpt day-0 quantization and validation workflow.

@nvidia@nvidiaInstall Skill
debug

debug

Compatibility name for modelopt-debug. Run commands through the remote Docker debugger relay.

@nvidia@nvidiaInstall Skill

More skills from other plugins.

analyze-ci

analyze-ci

Analyze failed GitHub Action jobs. Takes one or more GitHub URLs (job, workflow-run, or PR) and summarizes each failure with root…

mlflow4d29k
@mlflow@mlflowInstall Skill
hf-cli

hf-cli

Hugging Face Hub CLI (`hf`) for downloading, uploading, and managing models, datasets, spaces, buckets, repos, papers, jobs, and…

skills2w11k
@huggingface@huggingfaceInstall Skill
feast-architecture

feast-architecture

Internals of the Feast codebase — how each component works, where the key abstractions live, and the data flow through the…

feast8d7.4k
@feast-dev@feast-devInstall Skill
add-ecosystem

add-ecosystem

Add a new ecosystem and base model to basemodel.constants.ts. Use when onboarding a new model family from providers like Baidu,…

civitai5d7.3k
@civitai@civitaiInstall Skill

Questions about modelopt-quant-recipe-search.

Which coding agents can use modelopt-quant-recipe-search?
modelopt-quant-recipe-search installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.