You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(skills): Update Agent Skills Based on Observed Failures Modes in Trials (#1945)
### What does this PR do?
Type of change: documentation
Updates the agent skills based on findings from the June 5 Day-0 trials:
- Strengthens PTQ checkpoint handoff, serving-readiness, and
representative calibration guidance.
- Adds external baseline sanity checks while allowing comparisons when
no credible external score exists.
- Pins SciCode to task-level `parallelism: 8` and `num_repeats: 1`.
- Adds positional BF16 layer exclusions as a quantization-recipe search
axis.
- Keeps day-0 release decisions autonomous and maps external baseline
mismatches to an explicit failure class.
Refs:
1. https://lab-e57330.gitlab-master-pages.nvidia.com/day0_jun5_analysis/
2.
https://docs.google.com/spreadsheets/d/1H-YvO5CDwKoG2IvvNWVdDI7rViW1Kc0ayVEJAP7RH_A/edit?gid=30281591#gid=30281591&range=A2
### Usage
N/A — agent skill guidance only.
### Testing
- Ran structural validation for all five changed skill packages.
- Ran targeted pre-commit hooks on all nine changed files; all passed.
- Ran `git diff --check`.
I'll test the skill changes by re-running day 0 trials after merging.
### Before your PR is "*Ready for review*"
- 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?: N/A — documentation/skill
guidance only
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A
- Did you get Claude approval on this PR?: ❌ — not run
### Additional Information
The branch contains one signed commit and excludes WAAP state,
test-fixture changes, and example changes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Strengthened evaluation workflows with an “External Baseline Sanity
Check” requirement and clearer success/failure handling when external
verification fails or is inconclusive.
* Updated day-0 and compare-results guidance to follow the new
gate-driven sequence and to report external reference scores and sanity
status.
* Refined SciCode instructions to use fixed repeat settings and
consistent scoring output.
* Expanded PTQ checkpoint validation with downstream serving-readiness
canary requirements.
* Enhanced quantization recipe search with a layer-position axis,
positional exclusion rules, and stricter promotion criteria.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Chad Voegele <cvoegele@nvidia.com>
run IDs, and a publish recommendation (publish / do-not-publish).
151
+
Archive artifacts to the workspace.
144
152
145
153
## Triage (gate failure → decision)
146
154
@@ -154,8 +162,9 @@ Map a gate's `failure_class` to the next action:
154
162
|`DEPLOYMENT_HEALTH_FAILED`| Drop to the **deployment** skill: reproduce serving standalone (`/health` + one generation), debug flags / image / TP / env, then carry the working command into NEL's `deployment.command` and retry the eval. If it can't serve, `POINT_INFEASIBLE`. |
155
163
|`EVAL_JUDGE_FAILED`| Usually transient (auth / rate limit) — wait and retry. |
156
164
|`SAMPLE_ACCOUNTING_FAILED`| Investigate dropped/failed samples before trusting scores. |
157
-
|`USER_CONFIG_ERROR`| Stop and ask the user. |
158
-
|`UNKNOWN`| Stop and surface to the user (`NEEDS_HUMAN`). |
165
+
|`EXTERNAL_BASELINE_MISMATCH`| Investigate baseline configuration, correct it, rerun the baseline, and repeat external sanity before comparison. |
166
+
|`USER_CONFIG_ERROR`| Correct it from the request, workspace, or model/config metadata and retry; if irrecoverable, return `ANOMALOUS` with evidence. |
167
+
|`UNKNOWN`| Investigate with the owning domain skill; if unresolved, return `ANOMALOUS` with the evidence and next automated retry or patch action. |
159
168
160
169
`SYSTEMIC` (cluster down, dataset unavailable) aborts the whole run.
161
170
`POINT_INFEASIBLE` means this (model, recipe) can't work as configured.
@@ -166,7 +175,7 @@ Return a decision, not a raw artifact:
166
175
167
176
-`ACCEPT` + report + publish recommendation
168
177
-`REGRESSION` + which tasks failed the threshold and by how much
Copy file name to clipboardExpand all lines: .agents/skills/evaluation/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -409,7 +409,7 @@ Remove `limit_samples` overrides; keep canary-validated parallelism. If the cana
409
409
410
410
### Step 9 — Verify completed run
411
411
412
-
Before pulling/reporting scores, validate the run. Read `references/run-validation.md` for NEL timeout/resume behavior, completed-run validation, diagnostics, score harvesting, and the handoff to `compare-results` for baseline-vs-candidate deltas.
412
+
Before pulling/reporting scores, validate the run. Read `references/run-validation.md` for NEL timeout/resume behavior, completed-run validation, diagnostics, and score harvesting. For a baseline that will be compared with a candidate, also perform its **External Baseline Sanity Check** before a success verdict, then hand the validated runs to `compare-results` for baseline-vs-candidate deltas.
Copy file name to clipboardExpand all lines: .agents/skills/ptq/SKILL.md
+33-7Lines changed: 33 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,21 @@
1
1
---
2
2
name: ptq
3
-
description: This skill should be used when the user asks to "quantize a model", "run PTQ", "post-training quantization", "NVFP4 quantization", "FP8 quantization", "INT8 quantization", "INT4 AWQ", "quantize LLM", "quantize MoE", "quantize VLM", or needs to produce a quantized HuggingFace or TensorRT-LLM checkpoint from a pretrained model using ModelOpt.
3
+
description: >-
4
+
Use when the user asks to "quantize a model", "run PTQ", "post-training
or needs to produce a quantized HuggingFace checkpoint from a pretrained
8
+
model using ModelOpt. Do NOT use for multi-candidate recipe
9
+
exploration or optimization (use quant-recipe-search).
4
10
---
5
11
6
12
# ModelOpt Post-Training Quantization
7
13
8
14
Produce a quantized checkpoint from a pretrained model. **Read `examples/hf_ptq/README.md` first** — it has the support matrix, CLI flags, and accuracy guidance.
9
15
16
+
Use `quant-recipe-search` for multi-candidate recipe exploration or
17
+
optimization. Use this skill for each selected recipe's PTQ run.
18
+
10
19
## Step 1 — Environment
11
20
12
21
Read `skills/common/environment-setup.md` and `skills/common/workspace-management.md`. After completing them you should know:
@@ -75,6 +84,24 @@ If the source checkpoint is already quantized and the requested recipe/config re
75
84
For **listed models** (4A/4B): run full calibration directly (`--calib_size 512`).
76
85
For **unlisted models** (4C): run a smoke test first (`--calib_size 4`), wait for success, then full calibration.
77
86
87
+
### Recommended calibration datasets
88
+
89
+
-**Text-only LLM PTQ:** Prefer the representative `nemotron-post-training-v3` blend. `modelopt/torch/utils/dataset_utils.py` expands it to seven registered Nemotron SFT domains. Configure Hugging Face credentials where required.
90
+
91
+
```bash
92
+
python examples/hf_ptq/hf_ptq.py ... \
93
+
--dataset nemotron-post-training-v3
94
+
```
95
+
96
+
-**VLM PTQ:** Include image-text calibration with `--calib_with_images`. This path uses `nemotron_vlm_dataset_v2` with the current default subsets `sparsetables`, `plotqa_cot`, and `wiki_en`; `examples/hf_ptq/hf_ptq.py` and `modelopt/torch/utils/vlm_dataset_utils.py` are the source of truth.
97
+
98
+
```bash
99
+
python examples/hf_ptq/hf_ptq.py ... \
100
+
--calib_with_images
101
+
```
102
+
103
+
`--dataset` selects text-only calibration and cannot substitute for multimodal examples. Use `--dataset cnn_dailymail` only as a fallback when representative data is unavailable, such as without gated-data access or with only a local public cache.
104
+
78
105
### Which path?
79
106
80
107
```text
@@ -138,17 +165,16 @@ Report the path and size to the user.
138
165
139
166
### Post-quantization validation
140
167
141
-
This is a required gate before any deployment or evaluation submission. Do not submit an eval, start a serving job, or hand off the checkpoint as ready until the gate has passed.
168
+
This is a required gate before any deployment or evaluation submission. Do not submit an eval, start a production serving job, or hand off the checkpoint as ready until the gate, including its serving canary, has passed.
142
169
143
-
Read `references/checkpoint-validation.md` and perform all three validation groups on the exact checkpoint path that will be deployed/evaluated:
170
+
Read `references/checkpoint-validation.md` and perform all four validation groups on the exact checkpoint path that will be deployed/evaluated:
144
171
145
172
1. Check output size and estimated bits per weight against the baseline/source checkpoint.
146
173
2. Check quantized-weight coverage against the requested qformat/recipe/config.
147
174
3. Check metadata consistency against the baseline/source model.
175
+
4. Complete the required downstream handoff and serving-readiness validation.
148
176
149
-
Report the gate result before moving on. The report must include source size, output size, output/source size ratio, layer precision counts (for example NVFP4, FP8, INT4, BF16/unquantized excluded, unexpected unquantized, declaration mismatches), and metadata diffs. If the output/source ratio is >= 1.0 for a compression recipe, if any intended layer group is missing quantization, or if metadata changed unexpectedly, stop and fix the checkpoint or ask the user before proceeding.
150
-
151
-
**Next steps**: If the user wants to deploy or evaluate the quantized checkpoint, use the **deployment** or **evaluation** skill. The checkpoint workspace carries over. If the model required patches during PTQ (e.g., transformers upgrade), the same fixes will likely be needed at deployment and evaluation time.
177
+
Report the gate result before moving on. Follow the canonical report format and all blocking conditions in `references/checkpoint-validation.md`; do not hand off a checkpoint unless every required check passes.
152
178
153
179
## Key API Rules
154
180
@@ -163,7 +189,7 @@ Report the gate result before moving on. The report must include source size, ou
163
189
164
190
-**Model-specific dependencies**: Models with `trust_remote_code` may import packages not in the container (e.g., `mamba-ssm` for hybrid Mamba models). See Step 2.5. Use `EXTRA_PIP_DEPS` env var with the launcher, or install manually before running `hf_ptq.py`
165
191
-**Transformers version**: New models may need a newer version of transformers than what's installed. Check `config.json` for `transformers_version`. In containers, beware of `PIP_CONSTRAINT` blocking upgrades — see `references/slurm-setup-ptq.md` for workarounds
166
-
-**Gated datasets**: Some calibration datasets require HF authentication. Ensure`HF_TOKEN`is set in the job environment, or use `--dataset cnn_dailymail` as a non-gated alternative
192
+
-**Gated datasets**: Some calibration datasets require HF authentication. Set`HF_TOKEN` in the job environment. Use `--dataset cnn_dailymail`only as the constrained-environment fallback described in Step 4, not as the preferred calibration set
167
193
-**NFS root_squash + Docker**: See `skills/common/slurm-setup.md` section 5
0 commit comments