Skip to main content

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

metrik_profiler-0.3.0.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metrik_profiler-0.3.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file metrik_profiler-0.3.0.tar.gz.

File metadata

  • Download URL: metrik_profiler-0.3.0.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for metrik_profiler-0.3.0.tar.gz
Algorithm Hash digest
SHA256 71db55ace70584a4d5f54703c92015887f93184fb20b771af1f8278013e5f1f9
MD5 878155fbeed477076bdc2b0b139bba97
BLAKE2b-256 78d30659fbebb4bb27030f34dc52ef2448efc4a989175fc542e69ef93756dd19

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_profiler-0.3.0.tar.gz:

Publisher: release.yml on Asmodeus14/Metrik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metrik_profiler-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for metrik_profiler-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac4de703074c54e8edd771201b57361e0eab22e8d6f21971a518170a144be084
MD5 140a9f97a641512b78c6322af3bab817
BLAKE2b-256 4fee4d392d4d9ca0aa3b9907a717fea9d61f0abde3564423d596846dbf260944

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_profiler-0.3.0-py3-none-any.whl:

Publisher: release.yml on Asmodeus14/Metrik

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page