quark-torch-ptq
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…
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-torch-ptq-49aae0
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: ml, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
quark-torch-ptq- Description
- 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, create reproducible artifacts, request execution approval, and produce a quantized model. Applies to Llama, Qwen, Mistral, and similar transformer LLM requests involving FP8, INT4, or another Quark scheme. Does not handle .onnx model inputs or ONNX PTQ.
- License
- MIT
- Instructions
- 198 lines in SKILL.md · view on GitHub
Files (11)
- SKILL.md
- evals.json · evals/
- model_analysis.schema.json · references/contracts/
- quant_plan.schema.json · references/contracts/
- run_manifest.schema.json · references/contracts/
- environment.md · references/
- example-fp8-qwen3-8b.md · references/
- model-intake.md · references/
- quant-plan.md · references/
- troubleshooting.md · references/
- skill-card.md
SKILL.md (first lines)
# Quark Torch PTQ ## Purpose Take a PyTorch / Hugging Face LLM from model identification through confirmed AMD Quark PTQ. Perform intake, planning, manifest generation, execution, and output verification as one self-contained workflow. This skill stops at the quantized model. It does not accept `.onnx` model input, train or fine-tune a model, or modify Quark package/source files. ## Prerequisites - Python 3.11 to 3.13, accelerator-matched PyTorch 2.2 or newer, `amd-quark[cli]`, and `datasets`. - The required ROCm version and GPU architecture depend on the PyTorch build and selected quantization scheme. Record the actual runtime, GPU architecture (`gfx...` from `gcnArchName` on AMD), host kernel, and driver, and verify support for the confirmed plan. - No container image is required. If running in a container, record its image name or digest when available and verify GPU device access. - Inspect and preserve `HIP_VISIBLE_DEVICES`, `CUDA_VISIBLE_DEVICES`, `HSA_OVERRIDE_GFX_VERSION`, `PYTORCH_ROCM_ARCH`, and `PYTORCH_HIP_ALLOC_CONF`. Include any required changes to device visibility, architecture, or memory allocation in the confirmed plan. ## Inputs - Model source: a Hugging Face repository ID or local model directory. - Output directory. - Quantization intent: requested precision/scheme, target hardware, accuracy priority, and optional calibration settings. - Optional environment facts: Python, PyTorch, accelerator, available memory, installed `amd-quark`, and Transformers versions. Do not require pre-existing workflow artifacts. Create all artifacts in the user's working directory by following this skill's local references: - [`references/model-intake.md`](references/model-intake.md) - [`references/quant-plan.md`](references/quant-plan.md) - [`references/environment.md`](references/environment.md) - [`references/troubleshooting.md`](references/troubleshooting.md) ## Outputs Produce these three artifacts before or during execution: 1. `model_analysis.json`, validated against [`references/contracts/model_analysis.schema.json`](references/contracts/model_analysis.schema.json). 2. `quant_plan.json`, validated against [`references/contracts/quant_plan.schema.json`](references/contracts/quant_plan.schema.json). 3. `run_manifest.yaml`, validated against [`references/contracts/run_manifest.schema.json`](references/contracts/run_manifest.schema.json). The quantized model and its configuration/tokenizer files are written under the confirmed output directory. Record actual files and the final status in the manifest. ## Interaction Flow Always complete the following four steps in order. Show concrete facts, artifacts, and commands. Stop at every checkpoint and wait for the user. ### Step 1 — Model intake 1. Confirm whether the model source is local or remote. For a local source, resolve it to an absolute path and verify that the directory and `config.json` exist. For a remote source, preserve the repository ID. 2. Follow `references/model-intake.md`. Read configuration only; do not load model weights during intake. 3. Determine `model_type`, architecture/loading hints, hidden-layer facts, multimodal or MoE signals, default exclusions, compatibility risks, and a defensible estimate of quantizable linear layers. 4. Write schema-valid `model_analysis.json` and show its summary. #### Checkpoint 1 — Confirm the model analysis Ask the user to confirm or correct the model analysis. Do not plan quantization until the user confirms. ### Step 2 — Quantization plan 1. Follow `references/quant-plan.md` and use the confirmed analysis plus the user's priorities. 2. Select and explain the global scheme, optional KV-cache scheme, per-pattern overrides, exclusions, algorithms, and calibration data. 3. Treat scheme, algorithm, and model-template support as version-dependent. Use the current installed Quark API or `quark-cli torch-llm-ptq --help` when a choice needs verification; do not rely on historical list sizes. 4. Show a decision table, write schema-valid `quant_plan.json`, and set `requires_confirmation: true` until approved. #### Checkpoint 2 — Confirm the quantization plan Ask the user to confirm or adjust the complete plan. After confirmation, update `requires_confirmation` to `false`. If the user changes a decision, rewrite and revalidate the plan before continuing. ### Step 3 — Manifest and execution confirmation Use the public `quark-cli torch-llm-ptq` command installed by `amd-quark[cli]`. Do not import its implementation module directly or locate, copy, generate, or patch another PTQ runner. Build an argument-array-safe command equivalent to: ```bash quark-cli torch-llm-ptq \ --model_dir "<MODEL_OR_ABSOLUTE_LOCAL_PATH>" \ --output_dir "<ABSOLUTE_OUTPUT_PATH>" \ --quant_scheme "<SCHEME>" \ --num_calib_data "<N>" \ --seq_len "<LENGTH>" \ --device cuda \ --no_trust_remote_code ``` Add only confirmed options: - `--dataset <NAME>` and `--batch_size <N>` when the plan changed them from the CLI defaults. - `--kv_cache_dtype <SCHEME>` for confirmed KV-cache quantization. - One `--layer_quant_scheme <PATTERN> <SCHEME>` per override. - `--quant_algo <comma-separated-list>` when required. - `--exclude_layers <patterns...>` only when overriding template defaults.
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-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-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-model-intake
amd
Inspect a target model and prepare metadata for Quark PTQ planning.
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-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-install
amd
Install or verify the AMD Quark package and its dependencies.
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-onnx-router
amd
Route Quark ONNX user goals to the correct atomic skill.
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-torch-quant-plan
amd
Build a Quark Torch LLM PTQ quantization plan from model analysis and user intent.
SkillAFreshness: A★ 186Claude Code +9
Signals
- Stars
- 186
- Forks
- 36
- Open issues
- 3
- Last commit (this folder)
- Sep 28, 2026 (1 month 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.
- 0.674score
quark-torch-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★ 186Claude Code +9 - 0.352score
quark-torch-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★ 186Claude Code +9
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-torch-ptq skill. Agent Mart. https://agentmart.dev/skills/amd-quark-torch-ptq-49aae0 (last updated 2026-10-24)