Skip to main content

Headless profiling capture for Python: per-step metrics + flame scopes to a .vor stream, read back with the Rust vor tooling.

Project description

vor

Python capture for the vor profiler. Instrument a training or inference loop, write per-step metrics (and optional flame frames) to a .vor file, and view it with the Rust vor tools.

Install

uv add vor-profile      # or: pip install vor-profile

The distribution is vor-profile (the name vor is taken on PyPI); the import is vor.

Usage

import vor

vor.enable()
vor.record_metric_unit("throughput", "tok/s")  # optional, once

@vor.profile
def train_step(batch):
    ...

for batch in loader:
    loss = train_step(batch)
    vor.record_metric("loss", loss)
    vor.frame_mark()
vor.flush()

Set VOR_RECORD to capture; leave it unset and nothing is written:

VOR_RECORD=/scratch/run.vor python train.py

VOR_RECORD_FLAME=1 also records flame frames (VOR_RECORD_EVERY=N samples 1 step in N). See examples/train.py.

API

  • enable() - turn collection on; arm capture when VOR_RECORD is set.
  • frame_mark() - end a step; writes one record.
  • record_metric(name, value) - a named scalar for this step.
  • record_metric_unit(name, unit) - label a metric's row, once.
  • flush() - write buffered records before exit.
  • @profile - flame scope per call, named module.qualname.
  • profile_scope(name) - flame scope for a with block.

Viewing a capture

Reading and replaying .vor files live in the Rust crate. From a clone:

cargo run --example replay --features viz,mac -- /scratch/run.vor  # GUI panel
cargo run --example headless -- /scratch/run.vor                   # text summary

Build from source

Needs maturin. The base build is portable (metrics only); add a platform feature for GPU rows:

maturin develop                        # metrics
maturin develop --features mac         # + Apple Silicon GPU (IOKit)
maturin build --release --features cuda  # + NVIDIA GPU (NVML)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vor_profile-0.2.0.tar.gz (91.2 kB view details)

Uploaded Source

Built Distributions

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

vor_profile-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (504.1 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

vor_profile-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (398.2 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file vor_profile-0.2.0.tar.gz.

File metadata

  • Download URL: vor_profile-0.2.0.tar.gz
  • Upload date:
  • Size: 91.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vor_profile-0.2.0.tar.gz
Algorithm Hash digest
SHA256 236d57284e03a80381fabdc1222c3a4428b535d64e1faabe888c7397cb20760b
MD5 82b96e0fda22786a24643d7d36dcddb4
BLAKE2b-256 e0ae63c47cb3c5c80b831d170d5748a5b8427649aedd35f3c06ac1cab5d16070

See more details on using hashes here.

Provenance

The following attestation bundles were made for vor_profile-0.2.0.tar.gz:

Publisher: python.yml on SConsul/vor

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

File details

Details for the file vor_profile-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vor_profile-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5e089220f96826a2a971254f1c61850fbc26630831d682c533fed0e4a385d796
MD5 1f7bfccc958d03d1d337e8f048179b89
BLAKE2b-256 6bb7dd55321790d3a7997b58e566e832b126e9dd6a899957e93c99d3e97be83b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vor_profile-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python.yml on SConsul/vor

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

File details

Details for the file vor_profile-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vor_profile-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 becf233f5807833096a473c0f7f48839a07e49bc2a0a0b97cb4dc6b61afd703e
MD5 f691d64d2e97dd2d8c718635ef1f8905
BLAKE2b-256 7f4d86efabc8e862522ef3d8ad4744c5cff7d88a7e1842be926329256544a40a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vor_profile-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: python.yml on SConsul/vor

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