Agent skill

Quark Onnx Result Validator

by amd in amd/Quark

Validate Quark ONNX quantization output using four lightweight checks: auxiliary file copy alignment, expected non-quantized initializer MD5 byte-identity (inline rawdata + external-data byte…

MITAuto-check passedAI & LLM Engineering

Install Quark Onnx Result Validator

skills CLI
$ npx skills add amd/Quark --skill quark-onnx-result-validator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install amd/Quark quark-onnx-result-validator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/amd/Quark.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator .claude/skills/quark-onnx-result-validator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
quark-onnx-result-validator
GitHub stars
181
Token cost
~2.5k tokens
SKILL.md length
766 words
Files
3
Skills in repo
37
Repo updated
First seen
Licence
MIT

At a glance

Validate Quark ONNX quantization output using four lightweight checks: auxiliary file copy alignment, expected non-quantized initializer MD5 byte-identity (inline rawdata + external-data byte…

  • Works in 5 steps: Confirm SKILL_DIR, source_model_path (if… → Run the self-test to verify scripts are… → Execute steps in cheap-to-expensive… → …
  • Validate ONNX quantization result
  • SKILL.md covers Purpose, Runtime Assumptions, Contracts and Inputs, plus 10 more sections
  • Runs Python scripts from its folder; calls python3

What it does

Quark Onnx Result Validator is an agent skill from amd/Quark. Validate Quark ONNX quantization output using four lightweight checks: auxiliary file copy alignment, expected non-quantized initializer MD5 byte-identity (inline rawdata + external-data byte ranges), model metadata equality after stripping quantization-only opset entries / Quark domains, and fuzzy node-pattern + op-type + dtype summaries with QDQ / com.amd.quark custom-op presence. Intended for post-quantization inspection of model.onnx (with or without model.onnxdata). Trigger for "validate ONNX quantization…

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `quant_validation_onnx.py` and `run_validation.py`).

It sits in AI & LLM Engineering, covering LLM inference and serving. It works with ONNX. The licence is MIT.

When your agent uses it

  • Validate ONNX quantization result
  • Check quantized .onnx output
  • Verify ONNX initializers
  • Did QDQ insertion happen

Example prompts

  • “validate ONNX quantization result”
  • “check quantized .onnx output”
  • “verify ONNX initializers”
  • “/quark-onnx-result-validator”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Confirm SKILL_DIR, source_model_path (if available), and quantized_model_path are
  2. Run the self-test to verify scripts are intact
  3. Execute steps in cheap-to-expensive order (4 → 1 → 3 → 2).
  4. Collect JSON from stdout for each step; write validation_report.md.
  5. Surface any ok: false steps with their errors / mismatches.

What it can do on your machine

Read from SKILL.md and the folder at commit 313cb0b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Quark Onnx Result Validator loads about 2.5k tokens when it runs. Until then it costs about 175 tokens; SKILL.md has 766 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~175
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from amd/Quark at commit 313cb0b, republished under its MIT licence (© amd). 766 words, ~2,534 tokens.

Download SKILL.mdSave it as .claude/skills/quark-onnx-result-validator/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
quark-onnx-result-validator
description
Validate Quark ONNX quantization output using four lightweight checks: auxiliary file copy alignment, expected non-quantized initializer MD5 byte-identity (inline `raw_data` + external-data byte ranges), model metadata equality after stripping quantization-only opset entries / Quark domains, and fuzzy node-pattern + op-type + dtype summaries with QDQ / `com.amd.quark` custom-op presence. Intended for post-quantization inspection of `model.onnx` (with or without `model.onnx_data`). Trigger for "validate ONNX quantization result", "check quantized .onnx output", "verify ONNX initializers", "did QDQ insertion happen", "are the non-quantized weights byte-identical".
layer
l1-atomic
primary_artifact
validation_report.md
source_knowledge
examples/onnx/yolo_quantization/quantize_yolo.py, examples/onnx/language_models/opt/quantize_model.py…

quark-onnx-result-validator

Purpose

Run four lightweight checks on a completed Quark ONNX quantization output. Reads only ONNX graph headers (onnx.load(..., load_external_data=False)), initializer metadata, and small auxiliary files. Raw payload bytes are only touched for the bounded MD5 spot-check (and only for tensors matched by the user's exclude rules). Results feed a structured validation_report.md.

Runtime Assumptions

All scripts (quant_validation_onnx.py, run_validation.py) live in the same directory as this SKILL.md, under .claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator/.

Resolve SKILL_DIR from the repo root before running any command:

bash
SKILL_DIR=.claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator

run_validation.py writes JSON to stdout; quant_validation_onnx.py diagnostics go to stderr with the prefix [quant-validation-onnx][tag]. Never treat stderr as structured output.

Requires the onnx Python package in the supported range (onnx>=1.21.0,<=1.22.0, per requirements.txt).

Contracts

  • Input: session_context.json, quant_plan.json (for exclude / op-type filters and model paths)
  • Output: validation_report.md
  • Schemas: shared/contracts/validation_report.schema.json

Inputs

FieldSourceRequired
source_model_pathuser or session_contextStep 2 + Step 3
quantized_model_pathuser or run_manifestAll steps
source_model_dirparent dir of source model (or session_context)Step 1
quantized_model_dirparent dir of quantized model (or run_manifest)Step 1
quant_configquant_plan.json or user-supplied JSONStep 2 only

quant_config for step 2 supports the following keys (all optional unless noted):

KeyPurposeDefault
excludeGlob list of initializer names expected to remain unchanged—
exclude_initializersAlias of exclude—
nodes_to_excludeNode names whose initializer inputs should remain unchanged—
op_types_to_quantizeWhen set, any initializer not wired into one of these op types becomes an implicit exclude—
max_samplesRandom spot-check cap for large models200
random_seed / seedDeterministic sampling seedNone

At least one of exclude / exclude_initializers / nodes_to_exclude / op_types_to_quantize must be provided; otherwise step 2 is marked skipped.

Outputs

validation_report.md with one section per executed step. Unexecuted steps are marked skipped.

Interaction Flow

  1. Confirm SKILL_DIR, source_model_path (if available), and quantized_model_path are resolvable.
  2. Run the self-test to verify scripts are intact: python3 "$SKILL_DIR/run_validation.py" self-test
  3. Execute steps in cheap-to-expensive order (4 → 1 → 3 → 2).
  4. Collect JSON from stdout for each step; write validation_report.md.
  5. Surface any ok: false steps with their errors / mismatches.

Four Validation Steps

OrderFunctionCLI subcommandPurpose
1check_auxiliary_files_copiedauxiliaryCompare non-.onnx/non-.onnx_data auxiliary files between source and quantized directories
2check_non_quantized_initializers_md5_unchangedmd5MD5 spot-check initializer payload bytes (inline raw_data or external-data byte ranges) for tensors expected to remain non-quantized
3check_model_metadata_equal_except_quantizationmetadataCompare IR version, producer, default-domain opset, and graph input/output signatures after stripping Quark-injected custom-op domains
4get_fuzzy_node_op_summaryfuzzyHeader-only summary: op-type histogram, canonical node-name patterns, initializer dtype counts per pattern, QDQ / com.amd.quark custom-op presence

Run in cost order: 4 → 1 → 3 → 2.

Agent Execution Contract

Self-Test
bash
SKILL_DIR=.claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator
python3 "$SKILL_DIR/run_validation.py" self-test

Exits 0 and prints exported symbols self-test (__all__): ok on success.

CLI Commands
bash
SKILL_DIR=.claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator

# 4. get_fuzzy_node_op_summary (cheapest — header only)
python3 "$SKILL_DIR/run_validation.py" fuzzy \
  --model-path ./quantized/model.onnx

# 1. check_auxiliary_files_copied
python3 "$SKILL_DIR/run_validation.py" auxiliary \
  --source-model-dir ./source-dir --quantized-model-dir ./quantized-dir \
  --ignore 'README*'

# 3. check_model_metadata_equal_except_quantization
python3 "$SKILL_DIR/run_validation.py" metadata \
  --source-model-path ./source/model.onnx \
  --quantized-model-path ./quantized/model.onnx

# 2. check_non_quantized_initializers_md5_unchanged (most expensive)
python3 "$SKILL_DIR/run_validation.py" md5 \
  --source-model-path ./source/model.onnx \
  --output-model-path ./quantized/model.onnx \
  --quant-config '{"exclude":["*.bias","embeddings.*.weight"],"max_samples":50}'

For md5, --quant-config accepts a JSON string or a path to a JSON file. If SKILL_DIR or model paths cannot be resolved, mark the affected step skipped.

Show full SKILL.md (313 more words)Show less

Public API (for direct Python import)

python
from quant_validation_onnx import (
    check_auxiliary_files_copied,
    check_non_quantized_initializers_md5_unchanged,
    check_model_metadata_equal_except_quantization,
    get_fuzzy_node_op_summary,
)

All four functions are in __all__. Other public-named helpers are internal utility surface.

Recovery

FailureRecovery
Self-test exits non-zeroReport script integrity failure; do not run further steps
onnx import failsHand off to quark-onnx-install; do not run any step
source_model_path missingMark steps 2, 3 as skipped; run steps 1, 4 if quantized path is available
quant_config missing exclude rulesMark step 2 as skipped
External-data file missing alongside .onnxRecorded under external_data_missing; affected tensors marked read_error in step 2; step 4 still runs against the graph proto
Quantized model has zero QDQ / Quark-custom nodesStep 4 emits a high-severity warning (quantization_did_not_run)

Report Template

text
## Validation Report — quark-onnx-result-validator

**Step 4 — fuzzy node / op summary**: ok / FAIL / skipped
  - op types: <count>, QDQ nodes: <count>, com.amd.quark nodes: <count>
  - Notable: <pattern> → <op_type_counts>
  - Quantization signal: present / **MISSING** / partial

**Step 1 — auxiliary files**: ok / FAIL / skipped
  - missing: <count>, mismatched: <count>, extra: <count>

**Step 3 — model metadata**: ok / FAIL / skipped
  - ir_version: <source> / <quantized>
  - opset_import (default domain): <source> / <quantized>
  - input/output signature diffs: <count>
  - Quark-injected opset domains: <list>

**Step 2 — MD5 spot-check (initializers)**: ok / FAIL / skipped
  - candidates: <count>, checked: <count>, sampled: true/false
  - mismatches: <count>
  - external_data_missing: <count>

Canonical Name Rules

  • Replace only pure numeric path segments with *: Conv_12 → Conv_*, model.layer.3.Conv → model.layer.*.Conv
  • Do not alter digits embedded in non-numeric names: Conv1, MatMul_w2 stay unchanged
  • op_type_counts and dtype_counts are aggregated per pattern; multiple op types / dtypes in one pattern signals partial or mixed-precision quantization

Optional Dtype Hints

Heuristics only — not mandatory pass/fail rules:

  • INT8 QDQ: initializers with INT8 / UINT8; nodes QuantizeLinear / DequantizeLinear
  • INT4 MatMulNBits: initializers with UINT8 packed-low-nibble shape; MatMulNBits op
  • BFP16 / MX / MXFP: com.amd.quark opset domain present; nodes BFPQuantizeDequantize / MXQuantizeDequantize / ExtendedQuantizeLinear
  • FP16 / BF16 keep: initializers with FLOAT16 / BFLOAT16 and no QDQ neighbors

ONNX-vs-Torch Behavioural Notes

  • Step 2 walks initializers (the ONNX analog of safetensors tensors), not safetensors entries. Inline tensors are read via tensor.raw_data; external-data tensors are read by (offset, length) from the external-data file declared in tensor.external_data.
  • Step 3 compares model-level metadata (IR / producer / opset) and graph I/O signature. ONNX has no config.json equivalent — opset comparison strips Quark's custom domains before equality so the only allowed diff is the addition of com.amd.quark (or similar) on the quantized side.
  • Step 4 is structurally similar to the Torch fuzzy summary: it groups nodes / initializers by canonical name pattern and reports op_type_counts / dtype_counts. Additionally surfaces whether quantization actually ran (QuantizeLinear / com.amd.quark presence).

© amd, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in .claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator of amd/Quark.

  • SKILL.md
  • quant_validation_onnx.py
  • run_validation.py

Open the folder on GitHubat commit 313cb0b

Compare with similar skills

Quark Onnx Result Validator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Quark Onnx Result Validator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Quark Onnx Result Validator this skillamd/Quark181—~2.5kAutomated safety check: PassMIT
Aipc Toolkitqualcomm/qai-appbuilder247—~5.7kAutomated safety check: NotesCustom licence
Matlab Use Visual Inspectionmatlab/matlab-agentic-toolkit1.1k—~3.1kAutomated safety check: PassCustom licence
Onboard Jetpack5 Inference BackendsEGalahad/sim2real145—~1.1kAutomated safety check: PassNone
Model Builderqualcomm/qai-appbuilder247—~4.1kAutomated safety check: PassBSD-3-Clause
Engine Performancescragnog/HOT-Step-CPP173—~4.9kAutomated safety check: PassMIT

Similar skills

  • Aipc Toolkit

    qualcomm/qai-appbuilder

    AIPC, AI Porting Conversion. An agent skill from qualcomm/qai-appbuilder.

    247 GitHub stars~5.7k tokensUpdated today
    AI & LLM EngineeringAuto-check: notes
  • Matlab Use Visual Inspection

    matlab/matlab-agentic-toolkit

    Build machine vision inspection systems with MATLAB Visual Inspection Toolbox.

    1.1k GitHub stars~3.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Install, convert, debug, and benchmark sim2real ONNX GPU and TensorRT inference backends on onboard JetPack 5 Orin hosts such as g1-cable.

    145 GitHub stars~1.1k tokensUpdated 11 days ago
    AI & LLM EngineeringAuto-check passed
  • Model Builder

    qualcomm/qai-appbuilder

    QAI ModelBuilder. An agent skill from qualcomm/qai-appbuilder.

    247 GitHub stars~4.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Engine Performance

    scragnog/HOT-Step-CPP

    Explains where HOT-Step generation time goes (LM/DiT/VAE), how the TensorRT paths activate, how to benchmark from logs, and which knobs trade quality for speed.

    173 GitHub stars~4.9k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Running Openmed Ondevice

    maziyarpanahi/openmed

    Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows.

    5.5k GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from amd/Quark

All 37 skills in this repo
  • Author or restructure a Quark Agent Skill so it conforms to this project's template, contracts, and layer rules.

    181 GitHub stars~3.1k tokensUpdated 11 days ago
    Auto-check passed
  • Run, resume, monitor, diagnose, and report Quark Quant-Perf workflows for PyTorch and HuggingFace transformers models.

    181 GitHub stars~3k tokensUpdated 11 days ago
    Auto-check passed
  • Author a new ShapeShifter graph-transformation pass for AMD Quark (ONNX or PyTorch) so it conforms to the pass framework's conventions and auto-registers.

    181 GitHub stars~2.9k tokensUpdated 11 days ago
    Auto-check passed
  • Collect and normalize environment facts (OS, Python, GPU, CUDA/ROCm, container state) before Quark installation or PTQ planning.

    181 GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed
  • Quark Install

    amd/Quark

    Install or verify the AMD Quark package and its dependencies.

    181 GitHub stars~1.8k tokensUpdated 11 days ago
    Auto-check: notes
  • L3 recipe that runs quark.onnx.AutoSearchPro end-to-end on a user .onnx model: intake → preset selection (or custom search space) → calibration / eval data reader → standalone autosearch script…

    181 GitHub stars~3.4k tokensUpdated 11 days ago
    Auto-check passed

Works with

Questions about Quark Onnx Result Validator

What does Quark Onnx Result Validator do?

Validate Quark ONNX quantization output using four lightweight checks: auxiliary file copy alignment, expected non-quantized initializer MD5 byte-identity (inline rawdata + external-data byte…. Quark Onnx Result Validator is an agent skill from amd/Quark.quark custom-op presence.

When should I use Quark Onnx Result Validator?

Quark Onnx Result Validator fits situations like: validate ONNX quantization result; check quantized .onnx output; verify ONNX initializers; did QDQ insertion happen.

How do I install Quark Onnx Result Validator in Claude Code?

Run `npx skills add amd/Quark --skill quark-onnx-result-validator -a claude-code`. Or copy the skill folder (.claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator in amd/Quark) into .claude/skills/quark-onnx-result-validator in your project. Claude Code loads it when a task matches its description.

How do I install Quark Onnx Result Validator in Codex?

Run `npx skills add amd/Quark --skill quark-onnx-result-validator -a codex`. Or copy the skill folder (.claude/skills-impl/l1-atomic/onnx/quark-onnx-result-validator in amd/Quark) into .agents/skills/quark-onnx-result-validator in your project. Codex loads it when a task matches its description.

Can I use Quark Onnx Result Validator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add amd/Quark --skill quark-onnx-result-validator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/quark-onnx-result-validator, .gemini/skills/quark-onnx-result-validator, .github/skills/quark-onnx-result-validator and .opencode/skills/quark-onnx-result-validator in your project.

What does Quark Onnx Result Validator need to run?

Going by SKILL.md and its folder, Quark Onnx Result Validator needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Quark Onnx Result Validator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Quark Onnx Result Validator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Quark Onnx Result Validator use?

Quark Onnx Result Validator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Quark Onnx Result Validator use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Quark Onnx Result Validator?

Skills that share tags, products or a category with Quark Onnx Result Validator: Aipc Toolkit (qualcomm/qai-appbuilder, 247 stars), Matlab Use Visual Inspection (matlab/matlab-agentic-toolkit, 1.1k stars), Onboard Jetpack5 Inference Backends (EGalahad/sim2real, 145 stars) and Model Builder (qualcomm/qai-appbuilder, 247 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Quark Onnx Result Validator?

amd (a GitHub organization) maintains it in amd/Quark, which has 181 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on September 28, 2026.

Source: amd/Quark on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.