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
Copy file name to clipboardExpand all lines: .claude/skills/ad-model-onboard/SKILL.md
+38-13Lines changed: 38 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,6 +159,21 @@ See `examples/auto_deploy/model_registry/README.md` for full documentation on th
159
159
160
160
## Phase 9 — AutoDeploy End-to-End Run
161
161
162
+
### ⚠️ MANDATORY: You MUST use `build_and_run_ad.py --use-registry` EXACTLY AS-IS ⚠️
163
+
164
+
**You MUST run the model using the model registry YAML configs. No exceptions. No workarounds. No manual `--args.yaml-extra` overrides. The command is:**
**The `--use-registry` flag resolves ALL configuration from the model's entry in `examples/auto_deploy/model_registry/models.yaml` and its referenced YAML files under `examples/auto_deploy/model_registry/configs/`. This is the production path. You MUST validate the model works through it.**
171
+
172
+
**If the run FAILS with `--use-registry`:**
173
+
1.**DO NOT bypass the registry.** DO NOT fall back to manual `--args.yaml-extra` flags.
174
+
2. Instead, **fix the registry configs** — update the model's entry in `models.yaml`, modify or create config YAMLs under `configs/`, and re-run with `--use-registry` again.
175
+
3. The registry configs are the source of truth. If they are wrong, fix them. If they are missing, add them. The model MUST work via `--use-registry` before you are done.
176
+
162
177
Invoke the `ad-run-agent` subagent to run the model through AutoDeploy on GPU. Pass it:
163
178
164
179
Step 1: Reduced num layers
@@ -175,24 +190,34 @@ Run with full num layers. The generation should be coherent in step 2.
The `--use-registry` flag automatically resolves the model's config from `models.yaml`, so no manual `--args.yaml-extra` is needed. The `ad-run-agent` will determine the required `world_size` from the registry, check GPU availability via `nvidia-smi`, select free GPUs, and wait if not enough are available.
193
+
The `ad-run-agent` will determine the required `world_size` from the registry, check GPU availability via `nvidia-smi`, select free GPUs, and wait if not enough are available.
183
194
184
195
The ad-run-agent will build+run the model, check generation quality, archive logs, and update its worklog.
185
196
186
197
If the run **fails** or produces **bad generation**:
187
198
1. Read the ad-run-agent's worklog and log file to understand the error
3. Re-invoke the ad-run-agent with an updated description reflecting the change (e.g., "retry after fixing RoPE scaling in config")
190
-
4. Repeat until the run succeeds with meaningful generation
201
+
4.**Always re-run with `--use-registry`.** Never bypass the registry.
202
+
5. Repeat until the run succeeds with meaningful generation
191
203
192
204
Do NOT proceed to Phase 10 until the step 2 with full layers reports a successful run with coherent generation.
193
205
194
206
## Phase 10 — Summary Report
195
-
Print (not file) after completion: (1) model overview + unique features, (2) tricky parts needing human review, (3) files created/modified (including any new registry configs), (4) test results table (name | validates | PASS/FAIL), (5) known limitations, (6) reviewer result (PASS + how many review iterations it took), (7) AD end-to-end run result (success/fail, number of iterations, final generation quality), (8) registry entry added/updated in `models.yaml` and any new config YAMLs created.
207
+
208
+
### ⚠️ MANDATORY: You MUST include ALL raw prompts and generated outputs from the final `build_and_run_ad.py` run ⚠️
209
+
210
+
Print (not file) after completion:
211
+
212
+
1. Model overview + unique features
213
+
2. Tricky parts needing human review
214
+
3. Files created/modified (including any new registry configs)
215
+
4. Test results table (name | validates | PASS/FAIL)
216
+
5. Known limitations
217
+
6. Reviewer result (PASS + how many review iterations it took)
218
+
7. AD end-to-end run result (success/fail, number of iterations, final generation quality)
219
+
8. Registry entry added/updated in `models.yaml` and any new config YAMLs created
220
+
9.**ALL raw prompts and their corresponding generated outputs from the final successful `build_and_run_ad.py --use-registry` run.** Copy-paste the COMPLETE prompt→output pairs verbatim from the run log. Do NOT summarize, truncate, or paraphrase them. The user needs to see exactly what the model generated to judge quality.
196
221
197
222
## Phase 11 — Prepare a Pull Request
198
223
@@ -202,13 +227,13 @@ Prepare a pull request against `origin` (https://github.com/nv-auto-deploy/Tenso
202
227
branch `feat/paperclip_maximizer`. Then, ask the user to provide feedback on the PR and wait for the
203
228
user to get back to you when the feedback has been posted. Then continue iterating according to the
204
229
user's feedback. For any comment or other post, please prepend your message with "[AGENT]" so that it is clear that this was a coding agent posting the comment.
205
-
When you post a PR, make sure to include the results from running `build_and_run_ad.py` with the configs
206
-
in the model registry as well as a reproducible command along the lines of
230
+
When you post a PR, you **MUST** include:
231
+
1.**ALL raw prompts and their complete generated outputs** from the final successful `build_and_run_ad.py --use-registry` run. Copy-paste the COMPLETE prompt→output pairs verbatim — do NOT summarize, truncate, or paraphrase. The reviewer needs to see exactly what the model generated.
to give a set of instructions for the user to reproduce the test. Also include a detailed pytest
211
-
command for the unit tests you added so they can be run by the reviewer as well.
236
+
3. A detailed pytest command for the unit tests you added so they can be run by the reviewer as well.
212
237
213
238
## Key Gotchas
214
239
-**Canonical ops first:** Always use `torch.ops.auto_deploy.torch_*` canonical ops whenever one exists for the operation. This is how AD knows what to optimize. Writing manual attention, MoE, RoPE, or normalization in plain PyTorch instead of using the canonical op will prevent AD transforms from working.
@@ -217,7 +242,7 @@ command for the unit tests you added so they can be run by the reviewer as well.
217
242
-**Reuse config classes:** Import from `transformers` or load from checkpoint whenever possible. Only bundle a config class if it truly doesn't exist anywhere.
218
243
-**Assert `position_ids`:** Always assert `position_ids is not None` — it is a required input, never optional.
219
244
-**Self-contained files only**: Never import from other AD custom models. Each `modeling_{name}.py` is a standalone translation from HF source.
220
-
- RoPE buffers: `_ad_` prefix. The `RotaryEmbedding.forward(x, position_ids)`should slice by `position_ids` once and return pre-sliced `(cos, sin)`to all layers. Do NOT pass `position_ids` through to every attention forward — that is wasteful redundant slicing.
245
+
-**RoPE cos/sin: slice ONCE, not per layer.**`_ad_` prefix for RoPE buffers. `RotaryEmbedding.forward(x, position_ids)`MUST slice by `position_ids` once and return pre-sliced `(cos, sin)`. Pass those tensors to all layers. NEVER pass `position_ids` through to each layer/attention forward to re-index — that is redundant compute that bloats the exported graph. See Phase 2 for the full pattern.
221
246
- MoE weights: use `nn.ModuleList` per-expert for checkpoint compatibility. Write test-only state_dict converters for HF stacked format.
222
247
-`noaux_tc` routers (DeepSeek-V3 style): use vanilla PyTorch (sigmoid + bias + group topk + normalize + scale). AD transforms can replace with fused `trtllm` kernels at deployment time.
223
248
- Vision towers are typically **not** exported. Keep vision logic in eager PyTorch and export only the text path unless explicitly requested otherwise.
0 commit comments