quark-onnx-router
Route Quark ONNX user goals to the correct atomic skill.
Skill by amd
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/amd-quark-onnx-router
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/quark-onnx-router
What's inside
- Skill name
quark-onnx-router- Description
- Route Quark ONNX user goals to the correct atomic skill. Use when a user describes an ONNX quantization task in plain language — such as "install onnxruntime", "analyze my .onnx model", "choose a preset for my YOLO model", "plan ONNX PTQ", "quantize this .onnx with XINT8/BFP16/MXFP4", "validate my quantized .onnx", "debug a failed ONNX quantization", or any request that involves Quark's ONNX-to-ONNX flow. This is the ONNX-side entry point — trigger it whenever the user's intent involves Quark ONNX and the correct downstream skill is not immediately obvious.
- License
- MIT
- Instructions
- 140 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# quark-onnx-router
## Purpose
Translate a user's natural-language ONNX quantization goal into the smallest correct skill boundary. The router exists because Quark's ONNX flow spans install, intake, planning, execution, debug, and validation — picking the wrong skill wastes time and produces wrong artifacts. The router is the sole producer of `session_context.json` for the ONNX backend; every other artifact (env, workspace, install results, model analysis, quant plan) is produced by its own owning skill, and the router only carries forward references to those files.
## Inputs
- User goal stated in natural language
- `env_context.json` (optional, when routing depends on hardware / execution-provider facts)
- `workspace_context.json` (optional, when routing depends on validated `.onnx` / `.onnx_data` paths)
## Outputs: session_context.json
Carries the user goal, selected workflow (or atomic skill if no workflow applies), constraints with `backend = "onnx"`, `*_ref` pointers to other artifacts, and unresolved questions.
Schema: [`session_context.schema.json`](../../../shared/contracts/session_context.schema.json)
```json
{
"user_goal": "Quantize ./models/yolov8n.onnx with XINT8 and validate against the FP32 baseline",
"workflow": "quark-onnx-ptq-workflow",
"constraints": {
"backend": "onnx",
"offline": false,
"execution_mode": "interactive_execute"
},
"env_context_ref": null,
"workspace_context_ref": null,
"onnx_install_result_ref": null,
"quark_install_result_ref": null,
"model_analysis_ref": null,
"quant_plan_ref": null,
"open_questions": [
"Deployment target (CPU / CUDA / ROCm / NPU CNN / NPU Transformer) not yet confirmed — affects preset gating in quark-onnx-quant-plan"
]
}
```
Set each `*_ref` field to the path of the corresponding artifact once its producer skill has run. The router never embeds hardware, workspace, install, model, or plan facts inline — those belong in their owning artifacts. Always set `constraints.backend = "onnx"` so downstream skills and any future cross-backend orchestrator can disambiguate from the Torch flow.
## CRITICAL ROUTING RULE
**Vision / CNN `.onnx` PTQ requests MUST route to `quark-onnx-ptq-workflow`.**
Signals: model name contains `yolo`, `resnet`, `mobilenet`, `efficientnet`, etc.; inputs are image tensors `[N, C, H, W]`; preset is `XINT8` / `A8W8` / `A16W8` / `BF16` / `BFP16`; user mentions mAP / Prec@1 / NPU CNN / Ryzen AI.
Examples:
- "quantize yolov8n.onnx with XINT8 for Ryzen AI" → `quark-onnx-ptq-workflow`
- "quantize resnet50 .onnx with A8W8" → `quark-onnx-ptq-workflow`
- "run ONNX PTQ on my image-classification model" → `quark-onnx-ptq-workflow`
**NEVER invoke `quark.onnx.ModelQuantizer.quantize_model(...)` directly** from within the router. Execution belongs inside the workflow, after a confirmed `quant_plan.json` and a generated script the user has reviewed (the workflow's 4-step flow: intake → plan → manifest+script → confirmed execution).
## Skill Map
| User Intent | Target Skill | Why |
|-------------|-------------|-----|
| **Quantize a .onnx vision/CNN model** (YOLO / ResNet / MobileNet / …) | `quark-onnx-ptq-workflow` | Vision-specific: image data reader, CNN presets (XINT8 / A8W8 / BFP16), `EnableNPUCnn`, mAP / Prec@1 eval |
| Full end-to-end ONNX PTQ: from `.onnx` to quantized `.onnx` | `quark-onnx-ptq-workflow` | Multi-step workflow orchestration |
| Install ONNX Runtime, fix CPU/GPU variant, missing CUDA/ROCm EP | `quark-onnx-install` | ONNX Runtime install is separate from Quark package install |
| Install Quark, set up Quark dependencies | `quark-install` | Backend-neutral Quark package install (assumes ORT already set up) |
| Inspect a `.onnx` model, check opset / IR / op-type histogram, NPU compatibility | `quark-onnx-model-intake` | Model facts are prerequisites for planning |
| Choose preset (XINT8 / A8W8 / BFP16 / MX* / MatMulNBits), calibration method, algorithm | `quark-onnx-quant-plan` | Planning is separate from execution |
| Debug a failed ONNX quantization, ORT EP error, custom-op load failure, calibration crash | `quark-onnx-debug` | Error recovery has its own diagnostic flow |
| Validate quantized `.onnx`, verify QDQ insertion, check non-quantized initializers | `quark-onnx-result-validator` | Post-quantization byte-level + structural validation |
| Check environment, detect GPU, verify setup | `quark-env-preflight` | L0 fact collection (shared backend-neutral) |
| Validate `.onnx` / `.onnx_data` paths, output directory | `quark-workspace-validate` | L0 path validation (shared backend-neutral) |
## Routing Logic
1. **Confirm the backend.** If the user mentions `.onnx`, `quantize_static`, `ModelQuantizer`, an ONNX Runtime execution provider, opset, or QDQ, treat the request as ONNX. If they mention HuggingFace, safetensors, `transformers`, `torch._dynamo`, or `quantize_quark.py`, hand off to `quark-torch-router` instead — never silently mix backends.
2. **Extract the core intent.** Strip filler and figure out what the user actually needs. "I want to quantize yolov8n.onnx with XINT8 for CPU" → vision PTQ → `quark-onnx-ptq-workflow`.
3. **Check for L0 prerequisites.** Before routing to an L1 skill, check if downstream skills need facts that are missing:
- If hardware / accelerator / execution-provider facts are needed but unknown → run `quark-env-preflight` first.
- If the `.onnx` (and any sibling `.onnx_data`) path or output directory needs validation → run `quark-workspace-validate` first.
4. **Pick the smallest fit.** If the user only wants to inspect a `.onnx` graph, route to `quark-onnx-model-intake` — do not start the full workflow. If they only want to install ORT, route to `quark-onnx-install`. But if they say "quantize my .onnx", use `quark-onnx-ptq-workflow`.
5. **Handle ambiguity honestly.** If the goal is unclear, record the likely routes in `open_questions` and ask. Example: "I want to use Quark with my ONNX model" — does that mean inspect, plan, quantize end-to-end, or validate an already-quantized file?
## Rules
- **Do not guess deployment targets, EP availability, or paths.** If the deployment target (CPU / CUDA / ROCm / NPU CNN / NPU Transformer) is unknown, do not assume CPU — gate it as an open question. Preset gating in `quark-onnx-quant-plan` depends on this.
- **Do not load `.onnx` files in the router.** The router only reads paths and string intent; loading the model is `quark-onnx-model-intake`'s job (especially relevant for >2 GB models with external data).
- **Explain the routing.** Tell the user why you chose a particular skill: "Since you want to quantize a .onnx, I'll start with model intake, then we'll pick a preset, then I'll generate a script you confirm before running."
- **Reuse existing context.** If a `session_context.json` already exists from a previous step, read it and carry forward — do not start from scratch.
- **Refuse cross-backend mixing.** Never feed a `.onnx` into `quark-torch-*`; never feed safetensors into `quark-onnx-*`. If the user's input doesn't match this router's backend, hand off to `quark-torch-router`.
## Interaction Flow
1. **Listen**: Restate the user's goal in one sentence to confirm understanding and confirm the backend is ONNX.
2. **Assess**: Check what facts are already known vs. missing. Do L0 skills need to run first? Is the deployment target known?
3. **Route**: Name the target skill (or first link in the chain) and explain why it is the right fit. For PTQ requests, state the chain explicitly and that execution will only happen after the user confirms the generated script.
4. **Hand off**: Produce the initial `session_context.json` (with `constraints.backend = "onnx"`) and pass control to the chosen skill.
## Recovery
- If the goal is ambiguous, present the 2-3 most likely interpretations and ask the user to pick.
- If required inputs are missing, list them explicitly — do not route to a downstream skill with known gaps that will immediately fail (e.g. starting `quark-onnx-quant-plan` without a `model_analysis.json`).
- If L0 facts are unresolved, hand off a partial `session_context.json` with the gaps documented rather than forcing a premature routing decision.
- If the user pasted a Torch traceback or a HuggingFace path, do not try to repair-route — hand off to `quark-torch-router` and stop.
## Examples
### Example 1: Clear vision PTQ request
>
> User: "Quantize ./models/yolov8n.onnx with XINT8 for Ryzen AI deployment, output to ./output/yolov8n-xint8.onnx"
> Router: → `quark-onnx-ptq-workflow` (vision task family: YOLO + XINT8 + NPU CNN)
> Explain: "I'll quantize your YOLOv8 ONNX model with the vision PTQ workflow: 4 steps (intake → plan → generated script + manifest → confirmed execution)."
### Example 2: ONNX Runtime install request
>
> User: "I need to install onnxruntime-rocm 7.1"
> Router: → `quark-onnx-install` (clear ORT install intent, EP stated)From amd/Quark, MIT.
More from amd/Quark
- 0.684score
quark-skill-creator
amd
Author or restructure a Quark Agent Skill so it conforms to this project's template, contracts, and layer rules.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-torch-model-intake
amd
Inspect a target model and prepare metadata for Quark PTQ planning.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-env-preflight
amd
Collect and normalize environment facts (OS, Python, GPU, CUDA/ROCm, container state) before Quark installation or PTQ planning.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-torch-quant-plan
amd
Build a Quark Torch LLM PTQ quantization plan from model analysis and user intent.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-torch-install
amd
Install or verify the correct PyTorch build for a user's accelerator backend before Quark installation.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-torch-llm-eval
amd
End-to-end LLM accuracy evaluation on AMD ROCm (ROCm-only) — container setup, vLLM/SGLang/ATOM serving, lm-eval / lighteval / evalscope benchmarks.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-torch-debug
amd
Diagnose failed Quark installation, PTQ execution, script generation, or export attempts.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-onnx-install
amd
Install or verify the correct ONNX Runtime build (and the `onnx` package) for a user's accelerator backend before Quark's ONNX-to-ONNX flow.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-onnx-model-intake
amd
Inspect a target ONNX model and prepare metadata for Quark ONNX PTQ planning.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-install
amd
Install or verify the AMD Quark package and its dependencies.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-torch-export
amd
Prepare export and downstream evaluation handoff for a planned or completed Quark PTQ run.
SkillAFreshness: A★ 186Claude Code +9 - 0.679score
quark-torch-result-validator
amd
Validate Quark quantization output using four lightweight checks: auxiliary file copy alignment, excluded tensor MD5 byte-identity, config.json deep…
SkillAFreshness: A★ 186Claude Code +9
Signals
- Stars
- 186
- Forks
- 36
- Open issues
- 3
- Last commit (this folder)
- Jul 9, 2026 (3 months ago)
- Last release
- Sep 28, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/amd/Quark
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from amd
- 0.700score
quark-torch-llm-ptq
amd
Runs an end-to-end AMD Quark post-training quantization workflow for PyTorch / Hugging Face LLMs: inspect a Hub or local model, choose a quantization plan…
SkillAFreshness: A★ 465Claude Code +9 - 0.700score
rocprofiler-pc-sampling
amd
Profiles a target application using rocprofv3 with program counter sampling enabled and then analyzes the results.
SkillAFreshness: A★ 465Claude Code +9 - 0.700score
local-ai-use
amd
Makes this agent generate images, transcribe audio, and synthesize speech on the user's own machine through a local Lemonade Server instead of a paid cloud API.
SkillAFreshness: A★ 465Claude Code +9 - 0.700score
quark-install
amd
Installs or verifies AMD Quark and ensures the selected Python environment has an accelerator-matched PyTorch.
SkillAFreshness: A★ 465Claude Code +9 - 0.700score
lemonade-router-builder
amd
Turns a natural-language description of routing intent into a valid Lemonade `collection.router` policy JSON.
SkillAFreshness: A★ 465Claude Code +9 - 0.700score
serving-llms-on-epyc
amd
Serves an LLM on a supported AMD EPYC server CPU using vLLM with zentorch, in Docker, Podman, or conda.
SkillAFreshness: A★ 465Claude Code +9
Cite this page
quark-onnx-router skill. Agent Mart. https://agentmart.dev/skills/amd-quark-onnx-router (last updated 2026-10-24)