|
Download tasks/data/reverse/abdelstark__turboquant.5a40487/environment/docs/cli.md from Lego-X/ProgramGen: direct link, hf CLI and curl.
- Browser
- Download file 3.08 kB
-
https://huggingface.co/datasets/Lego-X/ProgramGen/resolve/main/tasks/data/reverse/abdelstark__turboquant.5a40487/environment/docs/cli.md
- Command line
-
hf download hf://datasets/Lego-X/ProgramGen/tasks/data/reverse/abdelstark__turboquant.5a40487/environment/docs/cli.md
-
curl -L -o cli.md https://huggingface.co/datasets/Lego-X/ProgramGen/resolve/main/tasks/data/reverse/abdelstark__turboquant.5a40487/environment/docs/cli.md
3.08 kB
TurboQuant Command Reference
Quick reference for the commands documented in usage.md.
Benchmark CLI (benchmark example)
cargo run --release --example benchmark -- [FLAGS]
| Flag | Values | Used with |
|---|---|---|
--workload |
synthetic | trace | real-model |
all |
--quick |
flag | synthetic |
--trace <PATH> |
safetensors file | trace |
--real-model-dir <DIR> |
ONNX bundle dir | real-model |
--prompt <TEXT> |
prompt string | real-model |
--real-eval-mode |
exact | quantized | compare |
real-model |
--bits <N> |
integer bit width (keys) | quantized/compare |
--value-bits <N> |
integer bit width (values) | compare |
--real-key-strategy |
prod | mse |
quantized/compare |
--top-k <N> |
integer | compare |
--max-new-tokens <N> |
integer | real-model |
Output: a benchmark report whose source field is one of synthetic, trace, or real-model. real-model mode reports logit RMSE, top-k agreement, token match/divergence rates, cross-entropy/perplexity, latency, tokens/sec, and exact vs quantized KV memory usage.
ONNX Decoder Export (scripts/export_hf_decoder_onnx.py)
python3 scripts/export_hf_decoder_onnx.py [--preset NAME | --model ID] --output-dir DIR
--preset:distilgpt2orsmollm2-135m-instruct(verified presets)--model: explicit HuggingFace model id--output-dir: destination for the exported ONNX bundle- Exports target
text-generation-with-past, dtypefp32(verified on the CPU ONNX Runtime path)
One-Command Eval Orchestrator (scripts/run_real_model_eval.py)
python3 scripts/run_real_model_eval.py [FLAGS]
| Flag | Meaning |
|---|---|
--preset <NAME> |
verified export preset |
--model-dir <DIR> |
reuse an existing ONNX bundle |
--bits <N...> |
bit widths to sweep |
--strategies <S...> |
prod, mse |
--prompts <FILE> |
JSONL prompt suite (default: scripts/prompts/real_model_eval_prompts.jsonl) |
--max-prompts <N> |
limit prompts |
--max-new-tokens <N> |
generation length |
--top-k <N> |
top-k metric window |
Output: raw JSON plus a markdown summary report under artifacts/real-model-evals/.
KV Trace Export (scripts/export_hf_kv.py)
python3 scripts/export_hf_kv.py \
--model <HF_MODEL_ID> \
--input <PROMPTS_FILE> \
--output <OUT.safetensors> \
--layer <N> \
--head <N>
Output: a per-head safetensors trace consumable by the benchmark example with --workload trace --trace <PATH>.
Environment Variables
| Variable | Meaning |
|---|---|
TURBOQUANT_REAL_MODEL_DIR |
directory of an exported ONNX bundle used by the manual real-model smoke test |
Setup Prerequisites
- Rust
1.87.0+(newer stable may be needed for the experimentalgpufeature) - Python 3 venv with the pinned dependencies in
assets/requirements-real-model.txtfor the export/eval helper scripts - ONNX Runtime CPU binaries are fetched automatically by the
ortcrate on first Rust build