quark-torch-llm-ptq-workflow
Torch LLM PTQ workflow for AMD Quark — from model selection to quantized output.
Skill by amd
Chalk Labs
Need help deploying quark-torch-llm-ptq-workflow?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
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-llm-ptq-workflow
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: data, ml, 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-torch-llm-ptq-workflow
What's inside
- Skill name
quark-torch-llm-ptq-workflow- Description
- Torch LLM PTQ workflow for AMD Quark — from model selection to quantized output. Use when the user wants a complete PTQ pipeline: model inspection, quantization planning, script generation, and optional execution. Stops at the quantized output. Trigger for "quantize my model", "run PTQ", "run model quantization", "full quantization pipeline", "quantize Llama/Qwen/Mistral with FP8/INT4", or any request that spans more than one PTQ step. When in doubt between routing to an atomic skill vs. the workflow, prefer this workflow if the user's request implies they want to go from model to quantized output.
- License
- MIT
- Instructions
- 241 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- files: referenced but missing: examples/torch/language_modeling/llm_ptq/quantize_quark.py
Files (2)
- SKILL.md
- example-fp8-qwen3-8b.md
SKILL.md (first lines)
# quark-torch-llm-ptq-workflow
## Purpose
Chain the full PTQ path — model intake → quantization planning → manifest generation → confirmed execution — while keeping the user informed at each checkpoint. This workflow orchestrates the atomic skills so the user does not have to manually chain them. It stops at the quantized output; for a run that also validates and evaluates the result, use the `quark-torch-llm-ptq-eval` recipe.
## Inputs
- Model path (HuggingFace ID or local directory)
- User goal (target precision, hardware, accuracy)
- Output directory for the quantized model
- `session_context.json` for user goal and constraints
- `env_context.json` for hardware facts
- `workspace_context.json` for validated paths
- `pytorch_install_result.json` and `quark_install_result.json` to confirm runtime is ready
## Outputs: run_manifest.yaml
Records the executed command and config. Side artifacts: quantized model files written to the user's output directory. The manifest is built in Step 3 above.
Schema: [`run_manifest.schema.json`](../../../shared/contracts/run_manifest.schema.json)
## Interaction Flow
1. **Intake** → `quark-torch-model-intake` → `model_analysis.json`
2. **Plan** → `quark-torch-quant-plan` → `quant_plan.json`
3. **Confirm** → `run_manifest.yaml` (stop for user approval)
4. **Execute** → run the confirmed command, write quantized model
## CRITICAL RULES
1. **NEVER run `quantize_quark.py` directly.** Always go through the 4 steps below.
2. **NEVER skip a step.** Even if the user provides all details upfront, execute each step in order.
3. **STOP at every checkpoint** and wait for user confirmation before continuing.
4. **Show concrete output** at each step — tables, JSON, commands — not just prose descriptions.
5. **NEVER modify Quark's own source code or examples.** The Quark repo (`quark/`, `examples/`, `tools/`, `docs/`, `tests/`) is read-only from this workflow's perspective. See *Upstream Quark Code is Read-Only* below.
## Upstream Quark Code is Read-Only
The Quark repository (`quark/`, `examples/`, `tools/`, `docs/`, `tests/`, `pyproject.toml`, `requirements.txt`) may be read freely but never modified. This includes "just to make the script accept my flag" patches to `examples/torch/language_modeling/llm_ptq/quantize_quark.py` — they break reproducibility against a clean Quark install.
**When the shipped example does not cover the user's needs**, write a fresh standalone script in the user's working directory (or `/tmp/`) that imports from `quark`:
```python
# user_workspace/my_custom_ptq.py — NOT inside the Quark repo
from quark.torch import ModelQuantizer
from quark.torch.quantization.config.config import Config
# ... user-specific logic ...
```
Reference *that* script in `run_manifest.yaml`. The shipped `quantize_quark.py` stays untouched; the run remains reproducible against any Quark version. If the user actually needs an upstream Quark change, surface it as a contribution — do not silently patch their local checkout.
## Required Artifact Flow
```text
Step 1 (Intake) ──► model_analysis.json
Step 2 (Plan) ──► quant_plan.json
Step 3 (Manifest) ──► run_manifest.yaml (contains the exact command)
Step 4 (Execute) ──► quantized model output (only after user says yes)
```
---
## Step 1: Model Intake
**Goal**: Produce `model_analysis.json`.
### Actions
1. Locate the Quark PTQ script (`quantize_quark.py`) under `<Quark repo>/examples/torch/language_modeling/llm_ptq/` — `find / -name quantize_quark.py -path "*/llm_ptq/*" 2>/dev/null | head -1` if the path is unknown. Record it for Step 3.
2. Call `quark-torch-model-intake` with the model path. It handles config parsing (no weight load), supported-template matching, and risk identification (MoE, >70B, transformers version constraints) and emits `model_analysis.json`.
### Output to Show User
Render the summary from `model_analysis.json`:
```text
Model Analysis:
Model path: Qwen/Qwen3-8B
Model type: qwen3
Hidden layers: 36
Linear layers: ~224 (quantization targets)
MoE: No
Exclude defaults: [lm_head]
Risks: <list>
Compatibility: OK
```
### >>> CHECKPOINT 1: Confirm model analysis is correct before continuing
---
## Step 2: Quantization Plan
**Goal**: Build `quant_plan.json` from the model analysis and user's stated preferences.
### Actions
1. **Determine the scheme.** If the user stated a scheme (e.g., "FP8"), use it. Otherwise, recommend based on their priority:
| Priority | Recommended Scheme | Algorithm |
|----------|--------------------|-----------|
| Best accuracy | `fp8` or `ptpc_fp8` | `smoothquant` (optional) |
| Smallest model | `int4_wo_32` | `awq` or `gptq` |
| CPU deployment | `int8` | none |
| AMD MI300X/MI355X | `fp8` or `amdfp4` | none |
| NVIDIA H100 | `fp8` | none |
| GGUF export | `uint4_wo_32` | `awq` |
2. **Fill the decision table.** Show ALL decisions with defaults:
| Decision | Value | Reason |
|----------|-------|--------|
| `global_scheme` | `fp8` | User requested FP8 |
| `kv_cache_scheme` | `fp8` | Recommended for FP8 inference |
| `exclude_layers` | `["lm_head"]` | Standard — lm_head stays full precision |
| `layer_quant_config` | `{}` | No per-pattern overrides (or e.g. `{"*self_attn*": "fp8"}` if the user asked to quantize attention with a non-global scheme) |
| `algorithm` | `null` | RTN baseline (fastest) |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)
- 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
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
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get quark-torch-llm-ptq-workflow running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
quark-torch-llm-ptq-workflow skill. Agent Mart. https://agentmart.dev/skills/amd-quark-torch-llm-ptq-workflow (last updated 2026-10-24)