metrik-profiler
Measured latency and memory for transformer models — gated by what the device can actually measure.
Part of Metrik. Install the umbrella distribution
(metrik-ai) rather than this package directly unless you are building against it.
The problem this package is shaped around
Most machines cannot measure most of what a profile can express. A CPU-only laptop has no VRAM
timeline, no power counter, and no measured FLOP count. The tempting design is a struct of
optional floats where an unmeasurable field quietly settles at 0.0 — and a reader cannot tell
zero because idle from zero because unavailable.
So the mechanism is inverted. A capability probe records what this device was confirmed to
read; every measurement names the capability it came from; and ProfileRecord rejects any
measurement citing a capability that was not probed. Fabricating a number is a validation
error rather than a matter of discipline.
$ metrik profile --check
backend cpu
counter source none
capability state detail
wall_clock measurable perf_counter around a synchronous backend
peak_allocated not measurable host RAM has no allocator watermark
nvml_power not measurable no NVIDIA device is present
flops_measured not measurable no kernel-level counter source
A profile that measured one thing is a good artifact. A profile that measured one thing and implies four is the failure this exists to prevent.
Two statistics decisions
The interval is bootstrapped on the median, not computed on the mean. Latency is right-skewed — a slow sample can be arbitrarily slow, a fast one is bounded by the work — so the mean sits above the median and a t-interval around it can exclude the median entirely. Since the record reports a median, an interval around the mean would bound a statistic that is not there.
Below 5 samples there is no interval at all. A 95% interval of unstated construction over three points is decoration, and the schema refuses to carry one.
Install
pip install metrik-profiler # capability probe and refusal path; no ML stack
pip install "metrik-profiler[torch]" # adds torch and transformers, enough to measure
The split is deliberate: metrik profile --check answers "what can this machine measure?"
without an ML stack, which is exactly the machine where the question is worth asking.
With an NVIDIA GPU, the extra is not enough. pip install torch resolves to a CPU-only
build on Windows and Linux, which imports fine and never touches the GPU. Add the CUDA index:
pip install torch --index-url https://download.pytorch.org/whl/cu126
metrik profile --check diagnoses this case specifically rather than reporting the generic
"no CUDA device", because that wording reads like a hardware fault when the hardware is fine.
License
Apache-2.0
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 metrik_profiler-0.3.1.tar.gz.
File metadata
- Download URL: metrik_profiler-0.3.1.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b692a9a240cf2f6ca5731f236ab167d07f8da993da212c97cbac8c57e4561964
|
|
| MD5 |
0ba58fbe3bfbcd6fa15639d9e5f741db
|
|
| BLAKE2b-256 |
db0b292b43d805d2f07f3d6e27021f04982a92e5388ce8f3cb9d0cfa88cb6729
|
Provenance
The following attestation bundles were made for metrik_profiler-0.3.1.tar.gz:
Publisher:
release.yml on Asmodeus14/Metrik
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metrik_profiler-0.3.1.tar.gz -
Subject digest:
b692a9a240cf2f6ca5731f236ab167d07f8da993da212c97cbac8c57e4561964 - Sigstore transparency entry: 2339247201
- Sigstore integration time:
-
Permalink:
Asmodeus14/Metrik@9078519c34e68f42a1f80e233dbc4f3e3169bd7b -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Asmodeus14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9078519c34e68f42a1f80e233dbc4f3e3169bd7b -
Trigger Event:
push
-
Statement type:
File details
Details for the file metrik_profiler-0.3.1-py3-none-any.whl.
File metadata
- Download URL: metrik_profiler-0.3.1-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66505e8e4d9069edf46c4491187445b8f01b57d73c736704b540c532aedbee0d
|
|
| MD5 |
8b05da25ee1aa1a690382fd049054828
|
|
| BLAKE2b-256 |
d483c03715d096bbfef87da71eb2c3f1048ea2b91f40b27d7fbcb76dd6ac4a1b
|
Provenance
The following attestation bundles were made for metrik_profiler-0.3.1-py3-none-any.whl:
Publisher:
release.yml on Asmodeus14/Metrik
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metrik_profiler-0.3.1-py3-none-any.whl -
Subject digest:
66505e8e4d9069edf46c4491187445b8f01b57d73c736704b540c532aedbee0d - Sigstore transparency entry: 2339247206
- Sigstore integration time:
-
Permalink:
Asmodeus14/Metrik@9078519c34e68f42a1f80e233dbc4f3e3169bd7b -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Asmodeus14
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9078519c34e68f42a1f80e233dbc4f3e3169bd7b -
Trigger Event:
push
-
Statement type: