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.1.tar.gz (24.8 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.1-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

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

Hashes for metrik_profiler-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b692a9a240cf2f6ca5731f236ab167d07f8da993da212c97cbac8c57e4561964
MD5 0ba58fbe3bfbcd6fa15639d9e5f741db
BLAKE2b-256 db0b292b43d805d2f07f3d6e27021f04982a92e5388ce8f3cb9d0cfa88cb6729

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_profiler-0.3.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for metrik_profiler-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66505e8e4d9069edf46c4491187445b8f01b57d73c736704b540c532aedbee0d
MD5 8b05da25ee1aa1a690382fd049054828
BLAKE2b-256 d483c03715d096bbfef87da71eb2c3f1048ea2b91f40b27d7fbcb76dd6ac4a1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrik_profiler-0.3.1-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