Skip to content
Agentmart
Submit a tool

quark-torch-export

Prepare export and downstream evaluation handoff for a planned or completed Quark PTQ run.

Skill by amd

IndexedMIT★ 186
Write a review

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-export

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.

We use your email only for this newsletter. Privacy

About

Prepare export and downstream evaluation handoff for a planned or completed Quark PTQ run. Use when the user wants to export a quantized model to HuggingFace SafeTensors, ONNX, or GGUF format, package for deployment, or set up post-quantization evaluation. Trigger for "export model", "save quantized model", "convert to GGUF", "export quantized model", "export to HuggingFace format", or when the user has a completed or planned PTQ run and needs deployment outputs.

Use cases: ml

No 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-export

What's inside

Skill name
quark-torch-export
Description
Prepare export and downstream evaluation handoff for a planned or completed Quark PTQ run. Use when the user wants to export a quantized model to HuggingFace SafeTensors, ONNX, or GGUF format, package for deployment, or set up post-quantization evaluation. Trigger for "export model", "save quantized model", "convert to GGUF", "export quantized model", "export to HuggingFace format", or when the user has a completed or planned PTQ run and needs deployment outputs.
License
MIT
Instructions
150 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# quark-torch-export

## Purpose

Translate a confirmed quantization plan into export expectations and downstream evaluation requirements. Export is a post-quantization step — the model must be quantized first (or have a plan to be quantized) before export decisions make sense. This skill ensures the right export format is chosen and evaluation is properly configured.

## Inputs

- `quant_plan.json` from quark-torch-quant-plan
- `workspace_context.json` for the output directory
- `run_manifest.yaml` (optional, existing manifest to extend)

## Outputs: run_manifest.yaml

Export does not own this artifact — it updates the workflow's manifest with export and evaluation config.

Schema: [`run_manifest.schema.json`](../../../shared/contracts/run_manifest.schema.json)

(Export updates the workflow's `run_manifest.yaml` with export and evaluation fields rather than producing a new artifact.)

```yaml
export:
  formats:
    - hf_format
  output_dir: ./output/qwen3-8b-fp8
  weight_format: real_quantized
  custom_mode: quark

evaluation:
  skip: false
  metrics:
    - ppl
  dataset: wikitext
  tasks: null
  batch_size: auto
```

## Supported Export Formats

### 1. HuggingFace SafeTensors (`hf_format`) — Default

- Produces: `config.json` + `*.safetensors` files with `quantization_config` metadata
- Compatible with: HuggingFace transformers loading, vLLM, TGI
- CLI flag: `--model_export hf_format`
- Weight format options:
  - `real_quantized` (default) — compressed, actual quantized weights
  - `fake_quantized` — full-precision weights with quantization metadata only

### 2. ONNX (`onnx`)

- Produces: `quark_model.onnx` with optimization passes applied
- Compatible with: ONNX Runtime, TensorRT (with conversion)
- CLI flag: `--model_export onnx`
- Supports INT4/UINT4 conversion pass automatically

### 3. GGUF (`gguf`)

- Produces: GGUF format file for llama.cpp and compatible inference engines
- Requires: `gguf>=0.10.0` package and tokenizer path
- CLI flag: `--model_export gguf`
- Best with: `uint4_wo_32` scheme + AWQ algorithm

Multiple formats can be exported simultaneously: `--model_export hf_format --model_export gguf`

## Export CLI Arguments

```bash
python quantize_quark.py \
  --model_dir /path/to/model \
  --output_dir /path/to/output \
  --quant_scheme fp8 \
  --model_export hf_format \                    # Export format(s)
  --export_weight_format real_quantized \        # Compression mode
  --custom_mode quark \                          # Export mode: quark|awq|fp8
  --pack_method reorder                          # Weight packing: order|reorder
```

## Evaluation Options

Post-quantization evaluation can be configured as part of the export step:

### Perplexity (PPL)

- Default dataset: `wikitext`
- Flag: included by default unless `--skip_evaluation` is set

### Task-Based Evaluation (via lm-eval harness)

```bash
--tasks hellaswag,winogrande,arc_easy
--eval_batch_size auto
--num_fewshot 0
```

### ROUGE/METEOR (for generation models)

```bash
# Evaluated on cnn_dailymail by default
--use_mlperf_rouge  # For MLPerf-compatible ROUGE scoring
```

### KV Cache Evaluation

```bash
--use_ppl_eval_for_kv_cache
--ppl_eval_for_kv_cache_context_size 1024
--ppl_eval_for_kv_cache_sample_size 512
```

### Skip Evaluation

```bash
--skip_evaluation  # Skip all post-quantization evaluation
```

## Model Reload for Separate Evaluation

If quantization and evaluation are done in separate steps:

From amd/Quark, MIT.

More from amd/Quark

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
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from amd

Cite this page

quark-torch-export skill. Agent Mart. https://agentmart.dev/skills/amd-quark-torch-export (last updated 2026-10-24)