Skip to content

Commit bde96ae

Browse files
authored
Merge branch 'main' into justinchuby-add-model-request-template
2 parents 6aa86d7 + 6d87e04 commit bde96ae

8 files changed

Lines changed: 89 additions & 48 deletions

File tree

‎.agents/skills/adding-a-new-model/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ see the [quality-checklist skill](../quality-checklist/SKILL.md).
286286
- [ ] Integration test in `tests/integration_test.py` (if small checkpoint available)
287287
- [ ] L4 golden file generated and committed (`testdata/golden/`)
288288
- [ ] L5 generation golden file generated and committed
289-
- [ ] ORT GenAI test added to `tests/ort_genai_test.py` (text-generation and VLM models)
289+
- [ ] Graph-derived ORT GenAI metadata is tested; downstream load/generation is
290+
optional evidence and never an export capability gate
290291
- [ ] CLI build works (`mobius build --model ...`)
291292
- [ ] Multi-dtype correctness verified (fp32, fp16, bf16)
292293
- [ ] Pinned revision reaches every Hub/processor/weight/golden call

‎.agents/skills/diffusion-models/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,9 @@ Before advertising runtime support, execute the complete path:
363363
Verify sample/output ranks, source-vs-target token slicing, CFG semantics, and
364364
the runtime's actual scheduler identifiers/equations. Reload final metadata and
365365
verify every file path, port, preprocessing step, loop edge, and postprocess.
366-
If the runtime cannot express the dataflow, reject it before emitting artifacts;
367-
keep direct component export separate.
366+
Emit faithful component graphs and metadata even when the tested downstream
367+
runtime cannot yet express the complete dataflow. Record that runtime/version
368+
limitation separately; it must not become a Mobius export capability gate.
368369

369370
Validate required VAE statistics against latent channel count before graph
370371
construction (`len(mean) == len(std) == z_dim`, positive standard deviations).

‎.agents/skills/multimodal-models/SKILL.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,10 @@ must scale with rows/windows, not total-patches × media-count. Keep dense masks
255255
only as a portable fallback and assert optimized CUDA/DML graphs lack the
256256
quadratic construction.
257257

258-
Config generation is not runtime support. Execute real media through ORT GenAI;
259-
if it cannot supply a required encoder input or position-ID rank, reject export
260-
before writing artifacts and use the same evidence for any Foundry waiver.
258+
Config generation is not runtime support. Emit graph-derived metadata faithfully
259+
and, when useful, execute real media through ORT GenAI as a downstream probe.
260+
If it cannot supply a required encoder input or position-ID rank, record the
261+
exact runtime/version limitation without blocking Mobius export.
261262

262263
## GQA for KV-shared layers (Gemma4)
263264

‎.agents/skills/onnx-export-quantization/SKILL.md‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ Before implementing or claiming a direct conversion:
151151
pinned upstream tokenizer. A self-contained package is invalid when padding,
152152
EOS, or BOS semantics disagree.
153153
7. Require real-weight full-logit parity and deterministic multi-token
154-
generation through both ONNX Runtime and the declared GenAI runtime. Graph,
155-
config, and session creation are not acceptance evidence.
154+
generation directly through ONNX Runtime. Graph, config, and session creation
155+
alone are not acceptance evidence.
156+
8. Optionally run the same generation through the declared GenAI runtime as
157+
downstream evidence. Record its version and outcome, but do not gate direct
158+
GGUF artifacts on its acceptance.
156159

157160
Use Hub GGUF architecture metadata to fail before downloading multi-gigabyte
158161
unsupported files, then repeat the guard from the local GGUF header so local
@@ -242,6 +245,16 @@ pip install cupy-cuda12x
242245
# Olive auto-detects cupy and uses GPU when available
243246
```
244247

248+
### Isolate Olive from unrelated provider DLLs
249+
250+
Olive 0.13 may auto-register every provider DLL bundled in an ORT GPU wheel
251+
even when a weight-only pass explicitly targets CPU. A missing TensorRT DLL can
252+
then abort K-quant before the pass starts. Keep the accelerator CPU-only and,
253+
for programmatic workflows, suppress `olive.systems.local` EP-library
254+
registration around `olive.workflows.run`; restore it immediately afterward.
255+
This is safe for `OnnxKQuantQuantization`, which does not create an inference
256+
session. Still load and execute the resulting package with the intended EP.
257+
245258
### Quantizing multi-model exports
246259

247260
Quantize each sub-model independently. Typically only the decoder is
@@ -425,9 +438,9 @@ compare_golden(
425438
)
426439
```
427440

428-
### L5: End-to-end smoke test
441+
### Optional ORT GenAI downstream smoke test
429442

430-
Run inference with the quantized model through ORT GenAI:
443+
When useful, run inference with the quantized model through ORT GenAI:
431444

432445
```python
433446
import onnxruntime_genai as og
@@ -442,6 +455,10 @@ output_ids = model.generate(params)
442455
print(tokenizer.decode(output_ids[0]))
443456
```
444457

458+
ORT GenAI acceptance is not a Mobius export gate. Always validate the final
459+
quantized ONNX package directly; treat ORT GenAI load/generation as optional
460+
downstream evidence and record its version/outcome without blocking export.
461+
445462
### Numerical parity verification
446463

447464
Quantized models will have some numerical divergence from the

‎.agents/skills/ort-genai-config/SKILL.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,14 @@ processor doesn't provide. Either:
282282
1. Compute them externally and inject via NamedTensors, or
283283
2. Modify the vision model to compute them from `image_grid_thw` internally
284284

285-
### Config writes successfully but runtime cannot execute
286-
287-
Config/schema success is not runtime support. Run load plus generation through
288-
the exported contract. If the runtime cannot route required feature inputs,
289-
position-ID rank, cache state, scheduler, or multimodal metadata, reject export
290-
before writing artifacts and report the exact runtime version/limitation.
285+
### Config metadata and downstream runtime acceptance
286+
287+
Mobius owns metadata correctness, not ORT GenAI capability decisions. Emit the
288+
most accurate package from graph metadata: filenames, semantic graph inputs and
289+
outputs, every cache template the current config schema can represent, and the
290+
global cache-slot count. Preserve intrinsic schema/config validation, but do
291+
not gate or reject export based on the current GenAI model registry, runtime
292+
version, topology support, or cache executor capability.
291293

292294
### "input_ids size exceeds max length"
293295

‎.agents/skills/quality-checklist/SKILL.md‎

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ name: quality-checklist
33
description: >
44
Use this skill when verifying that a new model is truly done and ready to
55
merge. Provides a Definition-of-Done checklist covering all five test
6-
confidence levels (L1 graph build through L5 Foundry Local smoke-test),
7-
ORT GenAI runtime validation, Olive quantization compatibility, multi-dtype
8-
(f32/f16/bf16) and multi-EP (CPU/CUDA/DML) correctness, documentation
9-
requirements, and code review criteria.
6+
confidence levels (L1 graph build through L5 generation), faithful runtime
7+
metadata, optional downstream runtime probes, Olive quantization
8+
compatibility, multi-dtype (f32/f16/bf16) and multi-EP (CPU/CUDA/DML)
9+
correctness, documentation requirements, and code review criteria.
1010
---
1111

1212
# Skill: Quality Checklist
1313

1414
## When to use
1515

1616
Use this checklist before marking a new model addition as **done**.
17-
Every item must be checked — or explicitly waived with a written reason —
18-
before the PR is merged.
17+
Every required item must be checked — or explicitly waived with a written
18+
reason — before the PR is merged.
1919

2020
---
2121

@@ -148,12 +148,6 @@ python examples/<model>_text_generation.py --compare-hf --dtype bf16
148148
opt-in via `MOBIUS_ORT_LOWER_OPSET_FOR_EP=1`)
149149
- [ ] Dead graph inputs removed after EP-aware optimization
150150
(`RemoveDeadGraphInputsPass` in Stage 4 of `optimize_model()`)
151-
- [ ] For models with dual head_dim (e.g. Gemma4: 256 for sliding,
152-
512 for full attention), verify whether ORT GenAI requires
153-
`search.past_present_share_buffer=false` because GenAI allocates
154-
uniform KV cache shapes; if so, explicitly override the generated
155-
`genai_config.json` before runtime validation rather than assuming
156-
the default generated setting is correct
157151
- [ ] Vision/audio graph inputs match the real processor (normally float32);
158152
reduced-precision encoders cast once at graph entry
159153
- [ ] Representative graph evidence covers raw/post-Mobius/post-weight and
@@ -162,30 +156,42 @@ python examples/<model>_text_generation.py --compare-hf --dtype bf16
162156
- [ ] Final fusion claims use loaded weights/constants; no-weight graphs cannot
163157
prove initializer folding
164158

165-
### 9. ORT GenAI runtime
159+
### 9. ORT GenAI metadata and downstream runtime
166160

167-
- [ ] Model can be loaded with `ort_genai.Model(output_dir)` without error
168-
- [ ] Actual generation with required media/features produces coherent output;
169-
schema/config emission alone is not runtime support
170-
- [ ] ORT GenAI test added to `tests/ort_genai_test.py`
171-
(or confirmed covered by an existing parametrized test)
172-
- [ ] Structurally unsupported contracts fail before artifacts are emitted and
173-
have a version-specific, evidence-based waiver
161+
- [ ] Generated metadata faithfully reflects graph filenames, semantic I/O,
162+
representable cache templates, and global cache-slot indices
163+
- [ ] Intrinsic schema/config errors are tested without inferring downstream
164+
runtime capability
165+
166+
Downstream evidence:
167+
168+
- [ ] If ORT GenAI load/generation is run, record the exact runtime version and
169+
result. Failures document limitations but never gate Mobius export based
170+
on the runtime registry, topology support, or cache executor capability.
171+
- [ ] If ORT GenAI validation is run for a model with dual head dimensions,
172+
determine whether that runtime requires
173+
`search.past_present_share_buffer=false` for its uniform KV-cache
174+
allocation, and override the generated config only for that probe.
175+
- [ ] Add an ORT GenAI integration test when useful, but do not require one for
176+
export acceptance.
177+
178+
Omitting these downstream probes requires no waiver or TODO.
179+
180+
181+
Waiver needed if any of the steps are not possible.
174182

175183
Run the ORT GenAI integration test:
176184

177185
```bash
178186
python -m pytest tests/ort_genai_test.py -m integration_slow -k "<model>" -sv
179187
```
180188

181-
### 10. Foundry Local smoke test
182-
183-
- [ ] Model exported package can be loaded and run in Foundry Local
184-
- [ ] At minimum, verify that the `genai_config.json` and all ONNX files
185-
are present and the model responds to a short prompt
189+
### 10. Foundry Local package check
186190

187-
> If Foundry Local is not available in the current environment, document the
188-
> skip with a `# TODO: verify with Foundry Local` comment in the PR.
191+
- [ ] `genai_config.json` and all ONNX files are present and internally
192+
consistent
193+
- [ ] If Foundry Local is available, record its version and load/generation
194+
result as optional downstream evidence; limitations do not block export
189195

190196
### 11. Olive quantization compatibility
191197

@@ -223,8 +229,8 @@ novel weight layouts (e.g. fused QKV, non-standard expert routing).
223229
after optimization or rebase changes
224230
- [ ] Rebase linearly onto `origin/main`; resolve shared registries/helpers
225231
semantically, run shared-surface tests, and push with `--force-with-lease`
226-
- [ ] After rebase, rerun config generation and actual runtime load/generation;
227-
parity-only tests do not catch changed cache/runtime contracts
232+
- [ ] After rebase, rerun metadata generation and intrinsic config validation.
233+
If downstream runtime evidence is included, rerun that exact probe too.
228234
- [ ] Confirm the remote PR head SHA, mergeability, replacement lint, and
229235
architecture checks after the final push
230236
- [ ] Triage red CI at check/job/test granularity against the exact base SHA;
@@ -236,14 +242,13 @@ novel weight layouts (e.g. fused QKV, non-standard expert routing).
236242

237243
## Waiver policy
238244

239-
Any item that cannot be completed must be waived explicitly in the PR
245+
Any required item that cannot be completed must be waived explicitly in the PR
240246
description:
241247

242248
```
243249
**Waivers:**
244250
- L5 golden: Model is 70B — generating golden data exceeds CI resources.
245251
skip_reason added to YAML.
246-
- Foundry Local: Not available in this environment. Tracked in issue #NNN.
247252
```
248253

249254
Unchecked items without a waiver are grounds to request changes before merge.

‎.agents/skills/writing-tests/SKILL.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,20 @@ integration test alongside any new custom function or Scan op.**
266266
runner termination from a model assertion failure.
267267
- Reference goldens must come from an independently invoked upstream pipeline,
268268
never from the implementation under test or ad-hoc intermediate features.
269+
- When the checkpoint is too large, HTTP-range-read safetensors headers and the
270+
exact tensors for a production-dimension reduced fixture. Cover every layer
271+
family and cache contract, record the source layer/row derivation, and create
272+
L4/L5 goldens from the independently invoked HuggingFace model. Treat this as
273+
reduced real-weight evidence, not as a claim of full-checkpoint parity.
274+
- Before accepting an architecture xfail, verify config vocabulary, epsilon,
275+
and layer-kind translation. A stale `mlp`->`moe` mapping can look like an SSM
276+
numerical failure while loading the wrong weights entirely.
277+
- Compare full prefill and every token-by-token prompt/decode logit on the
278+
target EP. Fused cache kernels can match multi-token prefill yet diverge on
279+
the first reused-state step. If full-precision and quantized packages fail at
280+
the same reused-state step, suspect source cache semantics rather than Olive.
281+
Test the equivalent standard-ONNX cache graph before assigning blame; prefer
282+
the portable graph when it restores the numeric gate.
269283

270284
### Recurrent state ≠ KV cache
271285

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
lintrunner-adapters>=0.14.0
22
# RUFF, RUFF-FIX
3-
ruff==0.16.1
3+
ruff==0.16.2

0 commit comments

Comments
 (0)