Quantization report cards for PyTorch models headed to the edge
Project description
quantcard
Quantization report cards for PyTorch models headed to the edge.
You trained a model and you want it smaller and faster on-device. torchao gives
you a dozen quantization configs; ExecuTorch consumes them; but nothing tells
you, for your model, what each config costs in accuracy and buys in size and
latency. quantcard answers that with one command:
pip install quantcard
quantcard report my_model.py
| config | top-1 acc | acc delta | weights | size ratio | latency (ms) | speedup |
|--------------|-----------|-----------|----------|------------|--------------|---------|
| fp32 | 98.44% | +0.00% | 100 KiB | 1.00x | 0.05 | 1.00x |
| int8wo | 98.44% | +0.00% | 33 KiB | 0.33x | 0.05 | 1.05x |
| int8da-int8w | 98.24% | -0.20% | 33 KiB | 0.33x | 0.06 | 0.90x |
Your model file just needs two functions:
# my_model.py
def get_model(): # -> torch.nn.Module (trained, ready for eval)
...
def get_eval_batches(): # -> iterable of (inputs, targets)
...
Configs
fp32 (baseline) · int8wo · int8da-int8w · int4wo · int8da-int4w
(the classic ExecuTorch 8da4w recipe) · qat-int8da-int4w (QAT prepare
step — what the fake-quant numerics cost before any training). Run
quantcard report model.py --configs all for everything.
ExecuTorch export column
With the executorch package installed (pip install quantcard[pte]),
--pte adds a column with the exported .pte program size — and tells you
honestly when a config can't export yet:
| config | ... | .pte |
| fp32 | ... | 102 KiB |
| int8wo | ... | 32 KiB |
| int8da-int4w | ... | export failed (RuntimeError) |
Status
Early alpha, deliberately narrow: torchao configs, CPU
accuracy/size/latency, .pte export size, markdown reports. Planned next:
robustness rows (input noise, quantized-vs-float disagreement rate),
QAT convert deltas after a training hook, and device latency via
ExecuTorch runners.
Development
pip install -e .[dev]
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantcard-0.1.0a1.tar.gz.
File metadata
- Download URL: quantcard-0.1.0a1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c20f1ab9c13072c72de11a2e27b25c82c30460b5b8712c8a2f246d2a925d06b9
|
|
| MD5 |
0b3ee81d517162624fc78bc04a54c917
|
|
| BLAKE2b-256 |
37dd6a6f3aae0be41ae86ec0c9d6407cdf9d9655961fa686d07cc0bb29aa5a9d
|
Provenance
The following attestation bundles were made for quantcard-0.1.0a1.tar.gz:
Publisher:
release.yml on JPL11/quantcard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantcard-0.1.0a1.tar.gz -
Subject digest:
c20f1ab9c13072c72de11a2e27b25c82c30460b5b8712c8a2f246d2a925d06b9 - Sigstore transparency entry: 2112713556
- Sigstore integration time:
-
Permalink:
JPL11/quantcard@e3445248dc7374a9228c0b0ab4d2edd481e92647 -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/JPL11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e3445248dc7374a9228c0b0ab4d2edd481e92647 -
Trigger Event:
release
-
Statement type:
File details
Details for the file quantcard-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: quantcard-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee5620cadea9090f68af4094ebc7e6802b0bc732f029edb83ff1f042db715e9
|
|
| MD5 |
b967714a27416865fe02e1385a3597dc
|
|
| BLAKE2b-256 |
92e78cc17b962b7fe12f40a32b1a0deaec6f5daf1940d73aa0142995ed0a627b
|
Provenance
The following attestation bundles were made for quantcard-0.1.0a1-py3-none-any.whl:
Publisher:
release.yml on JPL11/quantcard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantcard-0.1.0a1-py3-none-any.whl -
Subject digest:
2ee5620cadea9090f68af4094ebc7e6802b0bc732f029edb83ff1f042db715e9 - Sigstore transparency entry: 2112713568
- Sigstore integration time:
-
Permalink:
JPL11/quantcard@e3445248dc7374a9228c0b0ab4d2edd481e92647 -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/JPL11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e3445248dc7374a9228c0b0ab4d2edd481e92647 -
Trigger Event:
release
-
Statement type: