modelopt-qad
Skill5.6k starsChanged 3 days agoApache-2.0View on GitHub
Run explicitly requested ModelOpt Quantization-Aware Distillation (QAD) through Megatron Bridge (recommended) or Hugging Face Transformers to recover a measured BF16-to-PTQ accuracy gap. Use only when the user explicitly asks for QAD, including its topology, data preparation, launch, resume, checkpoint export, or recovery decisions.
Trending
More talk lately.about the whole repository
Who's talking about NVIDIA/Model-Optimizer
- @github-trending.bsky.social“📦 NVIDIA / Model-Optimizer ⭐ 3,886 (+22) 🗒 Python A unified library of SOTA model optimization techniques …”Bluesky · Sep 25, 2026 · 5 likes
- onnxsim/onnxsim“Maintaining status of this project”GitHub · Jan 6, 2026 · 5 reactions
- vllm-project/vllm“Add LM head quantization support for ModelOpt”GitHub · May 8, 2026 · 4 reactions
- @chrisshort.net“to optimize inference speed. #devopsish”Bluesky · Sep 27, 2026 · 1 likes
- @dailygithubtrends.bsky.social“今日のGitHubトレンド NVIDIA/Model-Optimizer NVIDIA Model Optimizerは、量子化やプルーニング、蒸留などの手法を用いてモデルを高速化するためのライブラリです。 …”Bluesky · Sep 26, 2026 · 1 likes
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on GitHub and Bluesky (54 times).
On GitHub · 50
- Jan 6, 2026Maintaining status of this project — onnxsim/onnxsim5 reactions · 4 comments
- May 8, 2026Add LM head quantization support for ModelOpt — vllm-project/vllm4 reactions · 7 comments
- Apr 12, 2026Add support for ModelOpt MXFP8 non-gated MoE with ReLU2 — vllm-project/vllm1 reaction · 3 comments
- Apr 2, 2026[Bugfix] Fix NVFP4+MTP crash: force unquantized mtp.fc for Qwen3.5 — vllm-project/vllm1 reaction
- Feb 8, 2026[ModelOpt MXFP8] — sgl-project/sglang1 reaction · 5 comments
45 more on GitHub
- Jan 21, 2026ORT inference fails after upgrading model's opset from 20 to 21 — microsoft/onnxruntime1 reaction · 5 comments
- Nov 15, 2026Watch list: who to follow and where (Edge0 upstream, Qwen4, llama.cpp, MLX, the labs) — toshi38/Edge00 reactions
- Nov 14, 2026Bump nvidia-modelopt from 0.47.0 to 0.48.0 — marek-burza/shrubbery0 reactions
- Nov 11, 2026build(deps-dev): bump nvidia-modelopt from 0.47.0 to 0.48.0 — verl-project/verl0 reactions · 4 comments
- Nov 10, 2026Prepare ModelOpt catalog onboarding: original six skills plus QAD — NVIDIA/skills0 reactions
- Nov 8, 2026build(deps-dev): bump nvidia-modelopt from 0.47.0 to 0.48.0 — ysq111333/verl_jev0 reactions
- Nov 5, 2026python3Packages.nvidia-modelopt: 0.47.0 -> 0.48.0 — NixOS/nixpkgs0 reactions · 1 comment
- Nov 2, 2026claude-code-marketplaces.github.nvidia.model-optimizer: 0.47.0 → 0.48.0 — sudosubin/agents.nix0 reactions
- Nov 2, 2026codex-plugins.github.nvidia.model-optimizer: 0.47.0 → 0.48.0 — sudosubin/agents.nix0 reactions
- Nov 2, 2026claude-code-plugins.github.nvidia.model-optimizer: 0.47.0 → 0.48.0 — sudosubin/agents.nix0 reactions
- Nov 2, 2026build(deps): Update nvidia-modelopt requirement from ~=0.47.0 to ~=0.48.0 — Jonah-May-OSS/wyoming-whisper-trt0 reactions · 2 comments
- Nov 2, 2026codex-marketplaces.github.nvidia.model-optimizer: 0.47.0 → 0.48.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-plugins.github.nvidia.model-optimizer: init at 0.47.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-marketplaces.github.nvidia.model-optimizer: init at 0.47.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026[ONNX GraphSurgeon] Export fails for a single initializer larger than 2 GiB before external-data saving — NVIDIA/TensorRT0 reactions · 2 comments
- Oct 28, 2026[Bug] make_graph serializes an individual >2 GiB initializer before external-data saving — onnx/onnx0 reactions
- Oct 26, 2026build(deps-dev): bump nvidia-modelopt from 0.44.0 to 0.47.0 — WncFht/verl-opd0 reactions
- Oct 22, 2026chore(deps-dev): Bump nvidia-modelopt from 0.44.0 to 0.47.0 — yiqiu0215/verl-main0 reactions
- Oct 14, 2026Bump nvidia-modelopt from 0.44.0 to 0.47.0 — zery00568/verlxx0 reactions
- Oct 8, 2026Add native packed-cache attention tests — yingguo-trt/Model-Optimizer0 reactions
- Oct 8, 2026Add inline-media CLI HTTP tests — yeyu-nvidia/Model-Optimizer0 reactions
- Oct 8, 2026Add FP8 zero-scale and export tests — raashish1601/Model-Optimizer0 reactions
- Oct 8, 2026Add native CUDA coverage for MXFP4 packing — raashish1601/Model-Optimizer0 reactions
- Oct 8, 2026Add NVFP4 offloaded export tests and collector typing — niko4244/Model-Optimizer0 reactions
- Oct 4, 2026codex-plugins.github.nvidia.model-optimizer: init at 0.47.0 — sudosubin/agents.nix0 reactions
- Oct 4, 2026codex-marketplaces.github.nvidia.model-optimizer: init at 0.47.0 — sudosubin/agents.nix0 reactions
- Oct 2, 2026build(deps-dev): bump nvidia-modelopt from 0.44.0 to 0.47.0 — ydwhhh/gspo0 reactions
- Sep 30, 2026build(deps-dev): bump nvidia-modelopt from 0.44.0 to 0.47.0 — verl-project/verl0 reactions · 1 comment
- Sep 29, 2026Admin AI: Install skills https://github.com/mattpocock/skills https://github.com/ — mehrshadevilb-cell/ArtistYar-Website0 reactions
- Sep 29, 2026Admin AI: Install skills https://github.com/mattpocock/skills https://github.com/ — mehrshadevilb-cell/ArtistYar-Website0 reactions
- Sep 27, 2026🔥 GitHub Trending AI 早报 · 2026-09-27 · Top 6 项目 — happydog-intj/ai-xiaohongshu-daily0 reactions
- Sep 27, 2026🔥 GitHub Trending AI 早报 · 2026-09-27 · Top 6 项目 — Mystery406/ai-xiaohongshu-daily0 reactions
- Sep 27, 2026Github trending [NVIDIA/Model-Optimizer] 一站式模型量化优化加速 — web1992/github-trending0 reactions
- Sep 26, 2026🔥 GitHub Trending AI 早报 · 2026-09-27 · Top 6 项目 — Mystery406/ai-xiaohongshu-daily0 reactions
- Sep 26, 2026🔥 GitHub Trending AI 早报 · 2026-09-27 · Top 6 项目 — happydog-intj/ai-xiaohongshu-daily0 reactions
- Sep 25, 2026Github trending [NVIDIA/Model-Optimizer] 模型推理加速优化库 — web1992/github-trending0 reactions
- Sep 19, 2026Bump nvidia-modelopt from 0.46.0 to 0.46.1 — marek-burza/shrubbery0 reactions
- Sep 17, 2026Add Anima 2B support to Model Optimizer for calibrated PTQ and future NVFP4 QAT/QAD — ruwwww/Model-Optimizer0 reactions
- Sep 16, 2026build(deps-dev): bump nvidia-modelopt from 0.44.0 to 0.46.1 — verl-project/verl0 reactions · 1 comment
- Sep 15, 2026Bump nvidia-modelopt from 0.44.0 to 0.46.1 — HuipengHuang/opd-rl0 reactions
- Sep 9, 2026build(deps-dev): bump nvidia-modelopt from 0.44.0 to 0.46.0 — HuipengHuang/verl-baseline0 reactions
- Sep 9, 2026[None][docs] retarget ModelOpt examples llm_ptq paths to hf_ptq — NVIDIA/TensorRT-LLM0 reactions · 1 comment
- Sep 4, 2026DeepSeek-V4-Pro-0813-NVFP4 — Bibbleq/frontier-model-tracker0 reactions · 1 comment
- Aug 28, 2026[Doc] Broken links in READMEs referencing files removed by legacy TensorRT backend cleanup — NVIDIA/TensorRT-LLM0 reactions · 1 comment
- Aug 19, 2026Fix ModelOpt integration for the >=0.44 list quant_cfg format — huggingface/diffusers0 reactions
On Bluesky · 4
- Sep 25, 2026📦 NVIDIA / Model-Optimizer ⭐ 3,886 (+22) 🗒 Python A unified library of SOTA model optimization techniques like quantization,… — @github-trending.bsky.social5 likes and reposts
- Sep 27, 2026to optimize inference speed. #devopsish — @chrisshort.net1 likes and repost
- Sep 26, 2026今日のGitHubトレンド NVIDIA/Model-Optimizer NVIDIA Model Optimizerは、量子化やプルーニング、蒸留などの手法を用いてモデルを高速化するためのライブラリです。 Hugging… — @dailygithubtrends.bsky.social1 likes and repost
- Sep 25, 20265. NVIDIA Model-Optimizer Library for Deployment LINK 6. World Action Agent for Robot Manipulation via VLMs LINK — @hackobar.bsky.social0 likes and reposts · 1 reply
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- tools/debugger/CLAUDE.mdCLAUDE.md
- tools/launcher/CLAUDE.mdCLAUDE.md
- accessing-mlflowSkill
- benchmark-model-kernelsSkill
- commonSkill
- compare-resultsSkill
- day0-releaseSkill
- debugSkill
- deploymentSkill
- evaluationSkill
- launching-evalsSkill
- modelopt-accessing-mlflowSkill
- modelopt-benchmark-model-kernelsSkill
- modelopt-compare-resultsSkill
- modelopt-day0-releaseSkill
- modelopt-debugSkill
- modelopt-deploymentSkill
- modelopt-evaluationSkill
- modelopt-launching-evalsSkill
- modelopt-monitorSkill
- modelopt-ptqSkill
- modelopt-quant-recipe-searchSkill
- modelopt-release-cherry-pickSkill
- modelopt-run-agentxSkill
- modelopt-speculative-decodingSkill
- monitorSkill
- ptqSkill
- qadSkill
- quant-recipe-searchSkill
- release-cherry-pickSkill
- run-agentxSkill
- speculative-decodingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Use the common skill's environment-setup.md and workspace-management.md.
- Very specific: line 39
Treat the example README and --help output as authoritative for mutable flags, commands, containers, and checkpoint formats.
- Very specific: line 83
Prepare the full capped dataset once: Use suitable user-provided data, or copy examples/megatron_bridge/data/nemotron-cascade-2-blend.yaml …
- Distinctive: line 90
Run and monitor QAD: Run one training job at a time per QAD run.
- Distinctive: line 134
Start benchmark evaluation at the knee of the KD loss curve, where its steep drop ends, rounded to the next checkpoint, then evaluate every …
- Distinctive: line 140
Run noise is 2x the standard error of a benchmark's gap to BF16: paired per question when both sides score the same questions, otherwise …
- Distinctive: line 151
Pass: every benchmark of the full original PTQ suite is within 1% of BF16, each at its compare-results run floor (such as SciCode's 8 runs …
- Distinctive: line 158
After a duration exit, resume the latest QAD checkpoint in the same output directory with unchanged prepared data paths/cache, seed, …
- Very specific: line 175
On a miss, change one QAD knob: Read each missed benchmark against PTQ: worse than PTQ is drift (lower the peak LR or add matching data).
- Very specific: line 191
Before constructing commands, read examples/llm_qat/README.md, its ARGUMENTS.md, selected training/dataset/Accelerate configs, and …
- Distinctive: line 194
Follow its quantize → distill → export flow: the PTQ checkpoint is the student.
- Distinctive: line 198
Use the HF tutorial's evaluation and checkpoint resume guidance.
- Distinctive: line 203
Use HF evaluation/checkpoint intervals.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ModelOpt Quantization-Aware Distillation
QAD is expensive. Run it only when the user explicitly authorizes QAD for the target model or run, with a loop or GPU-hour budget; ask for the budget when it is missing. A Day-0, PTQ, evaluation, comparison, or recipe-search request alone is not authorization to start QAD. The authorization covers new recipes from a recipe search only when the user says so.
Confirm the gap
For both frameworks, reuse only validated, comparable BF16/PTQ results and the exact benchmark configuration from preceding evaluation or recipe search; run missing, invalid, or non-comparable baselines. Confirm the target benchmarks and their context-length needs. Stop if the PTQ gap to BF16 is already below 1%.
Follow the supported workflow
Read docs/source/guides/quantization_aware_training_and_distillation.rst
for QAD background and framework selection.
Recommend Megatron Bridge for scalable training and its model-specific tutorials.
Choose the applicable tutorial from examples/megatron_bridge/tutorials/README.md.
Honor an explicit HF choice.
Use the common skill's environment-setup.md and workspace-management.md;
for Slurm, also read slurm-setup.md and, when remote, remote-execution.md.
Treat the example README and --help output as authoritative for mutable flags,
commands, containers, and checkpoint formats. Both frameworks can run on local
GPUs or Slurm; use the user's requested environment.
Megatron Bridge execution and training policy
For Megatron Bridge, before constructing commands, read:
examples/megatron_bridge/README.md, especially PTQ, data preparation, QAD, export, and Slurm usageexamples/megatron_bridge/{quantize.py,distill.py}via--help
Execute in this order
- Reproduce PTQ and verify compatibility. In the target runtime, require
AutoBridge.can_handle()for the target model and PTQ throughquantize.pyto succeed while preserving the exact preceding PTQ config or recipe: format, layer selection, calibration data/count, sequence length, and seed. A changed quantization setting is a new PTQ candidate and must be evaluated before QAD. In the master-rank.quant_summary.txt, require finite positiveamaxfor enabled static quantizers; acceptdynamic/format-definedNoneonly when the recipe intends it. Treat the summary as rank-local under model parallelism. Choose topology explicitly. Derive the smallest fitting node count and TP/PP/CP/EP from student and teacher architecture, the chosen sequence length, and available GPU memory. Prefer CP before TP for small long-context models; keep EP=1 for dense models and ETP=1 because the current
distill.pyworkflow does not support expert tensor parallelism. For MoE require:DP = world_size / (TP * PP * CP)EDP = world_size / (EP * PP)- integral DP/EDP,
num_experts % EP == 0, andGBS % (MBS * DP) == 0
Static-block NVFP4 recipes require TP=1; use PP for memory. With PP, balance stages with
--num_layers_in_{first,last}_pipeline_stage(the first and last stages also hold the embedding and output layer) and recompute only where memory needs it (--recompute_num_layers_per_stage). In the first job's allocation, time a few iterations of each candidate layout with short launches before the run starts, and keep the fastest. Give each timing launch a scratch--output_dir:distill.pyresumes from<output_dir>/checkpoints, so a timing checkpoint there would become the run's starting point.- Prepare the full capped dataset once. Use suitable user-provided data, or
copy
examples/megatron_bridge/data/nemotron-cascade-2-blend.yamlas the default. Set the target tokenizer and workspace path, then materialize the randomly sampled subset before training. Pack the chosen sequence length; Megatron's99,1,0split creates the 1% validation holdout from the same data. Keep every source mixed across training, never ordered as a curriculum, so early stops see the whole blend. - Run and monitor QAD. Run one training job at a time per QAD run; separate runs may train in parallel. Fold startup validation into the first job; do not submit separate GPU preflight jobs or split at recovery iterations. Let training continue while evaluating saved checkpoints, and cancel it when a stop condition below is met.
Default training policy
| Setting | Default |
| Sequence length | 32768; adjust for target benchmarks |
| Peak / minimum LR | 1e-5 / 1e-6 |
| LR schedule | cosine |
LR horizon (train_iters) | 1000 iterations |
| Global batch size | 512 |
| Dataset | nvidia/Nemotron-Cascade-2-SFT-Data by default |
| Materialized token budget | 17.3B at 32K; cover train_iters at the chosen length |
| Training validation | every 25 iterations; deterministic 1% holdout; 2 batches |
| Checkpoint interval | 50 iterations |
| Loss logging | every 10 iterations |
| Recovery benchmark | from the KD-loss knee, then every checkpoint |
| Slurm duration exit | 220 minutes for a 4-hour allocation |
Run policy
train_iterssets the cosine LR horizon and is a loop knob: with 1000, the LR stays near its peak through iteration 150.distill.pyalso stops training there, with or withoutexit_interval. Stop runs by the decisions below and leaveexit_intervalunset. A run that reachestrain_iterswhile the decision is still to continue ends as a Miss from under-recovery.- On Slurm, use initial step timing to submit only enough sequential jobs to reach
a few checkpoints past the expected KD-loss knee; never submit through
train_itersupfront. At each recovery checkpoint, submit to the next only after its targeted evaluation and any triggered full suite, and only while the decision is to continue. - On Slurm, give all training jobs the same run-specific job name and
--dependency=singleton; record job IDs and, on any stop, cancel pending jobs before the active job. - Cancel on non-finite loss, repeated skipped iterations, or a sustained spike. At iteration 50, require the loss aggregate to be lower than at iteration 10.
- At each recovery checkpoint, first evaluate the one to three benchmarks with the largest PTQ drops or that failed in earlier loops. Run the remaining original PTQ suite at that checkpoint once the targeted benchmarks are within run noise of 1%, or after recovery beyond run noise.
- Start benchmark evaluation at the knee of the KD loss curve, where its steep drop ends, rounded to the next checkpoint, then evaluate every checkpoint while the scores still change. Before the knee, use loss only to catch drift; after it, judge and pick checkpoints by benchmarks alone, since KD loss keeps falling after they peak. Between near ties, the benchmark most sensitive to quantization decides.
- Run noise is 2x the standard error of a benchmark's gap to BF16: paired per question when both sides score the same questions, otherwise from both sides' per-sample standard errors, and pooled across runs once repeats exist. Repeat a benchmark only when its gap is within run noise of 1%, up to 8 runs per side; the compare-results run floors still apply before a Pass.
- Export each checkpoint to evaluate and pass the ptq skill's
references/checkpoint-validation.mdgate on it before evaluation. Run the serving canary on the run's first export only; later exports change only weights, so on those the gate passes without the canary: record its serving-canary row asskipped; first export <path> passed. - At each evaluated checkpoint, decide:
- Pass: every benchmark of the full original PTQ suite is within 1% of BF16, each at its compare-results run floor (such as SciCode's 8 runs per side). Keep the checkpoint and stop the run.
- Miss: two evaluated checkpoints past the knee bring no gain beyond run noise, or two consecutive checkpoints decline beyond it. Stop and change one QAD knob in the recipe loop.
- Otherwise continue to the next checkpoint.
- After a duration exit, resume the latest QAD checkpoint in the same output directory with unchanged prepared data paths/cache, seed, topology, optimizer, scheduler, iteration, and consumed-sample state; do not restart from PTQ.
- Report, per loop, the PTQ recipe and calibration, data sample, QAD settings, training topology, loss/state, checkpoints, and comparable BF16/PTQ/QAD results.
Recipe loop
Each run trains one PTQ recipe and differs from that recipe's control in one QAD knob. Start from the best PTQ recipe of the preceding PTQ evaluation or recipe search; its control uses the default policy. When GPUs allow, start one-knob variants as separate runs alongside the control instead of waiting for its miss. This loop chooses the QAD settings; the quant-recipe-search skill chooses the next recipe from its outcome. Stop when the QAD budget is spent and report the best result so far.
- On a miss, change one QAD knob. Read each missed benchmark against PTQ:
worse than PTQ is drift (lower the peak LR or add matching data); better
than PTQ but short is under-recovery (keep the LR high longer with a larger
train_iters). Knobs, in order of priority when GPUs are limited: peak LR,train_iters, data blend, then teacher-generated data. A changedtrain_itersis a fresh run from PTQ, with data materialized to cover it: resuming would change the decay length the checkpoint's LR scheduler expects. - Compare a knob with its control at the same checkpoints past the knee, on benchmark scores pooled over fresh runs. A rejection holds only for that PTQ recipe: rerun the control when the recipe changes.
- End the loop on a recipe with a pass, or with a clear miss once every knob has missed or as soon as QAD stays flat against PTQ or far from passing. Return the outcome, the best checkpoint, and its scores.
Hugging Face execution and training policy
Before constructing commands, read examples/llm_qat/README.md, its
ARGUMENTS.md, selected training/dataset/Accelerate configs, and
{quantize.py,train.py,export.py} --help.
Follow its quantize → distill → export flow: the PTQ checkpoint is the student;
the original unquantized model is the teacher. Adapt the QAD training and
Accelerate configs to the model and budget.
Resolve tutorial-relative commands and config paths from examples/llm_qat/.
Use the HF tutorial's evaluation and checkpoint resume guidance.
Reuse the Bridge procedure's PTQ-recipe preservation and one-training-job-at-a-time guidance. Apply the Run policy's loss-stability and benchmark-recovery stop conditions and report the same fields. Use HF evaluation/checkpoint intervals; Bridge-specific topology, data defaults, iteration thresholds, and Slurm job chaining are not HF requirements.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

