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 bindings for the vor profiler.
Instrument a training or inference loop, write per-step metrics (and
optional flame frames) to a .vor file, and read it back in Python with
vor.Reader. The GUI replay panel stays in the Rust 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 whenVOR_RECORDis 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, namedmodule.qualname.profile_scope(name)- flame scope for awithblock.Reader(path)- iterate a capture; eachFramehas.system(aligned toreader.columns),.user(dict of named scalars), and.flame(raw puffin bytes orNone).
Reading a capture
import vor
reader = vor.Reader("/scratch/run.vor")
for frame in reader:
step_ms = frame.system[0] # columns are reader.columns
loss = frame.user.get("loss")
Into a DataFrame for plotting (no pandas dependency in this package):
import pandas as pd
reader = vor.Reader("/scratch/run.vor")
cols = [name for name, _unit in reader.columns]
df = pd.DataFrame(
{**dict(zip(cols, f.system)), **f.user} for f in reader
)
df["loss"].rolling(50).mean().plot()
The GUI replay panel stays in the Rust crate:
cargo run --example replay --features viz,mac -- /scratch/run.vor
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
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 Distributions
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 vor_profile-0.2.1.tar.gz.
File metadata
- Download URL: vor_profile-0.2.1.tar.gz
- Upload date:
- Size: 92.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30d4bc8c8837a117e1b4e99bf2bfb153a35aee851c77768872c90a64f23d2eb3
|
|
| MD5 |
b6b179a5e4bb7b3ca93101f258aed271
|
|
| BLAKE2b-256 |
0318d639c04ccbc28c20a0a8102072f616e7765ae7a74e9e4643aaa4216ba1fb
|
Provenance
The following attestation bundles were made for vor_profile-0.2.1.tar.gz:
Publisher:
python.yml on SConsul/vor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vor_profile-0.2.1.tar.gz -
Subject digest:
30d4bc8c8837a117e1b4e99bf2bfb153a35aee851c77768872c90a64f23d2eb3 - Sigstore transparency entry: 1704801643
- Sigstore integration time:
-
Permalink:
SConsul/vor@79987015ce141d2d6d42826fbab9239591c0ef70 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/SConsul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@79987015ce141d2d6d42826fbab9239591c0ef70 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vor_profile-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: vor_profile-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 535.5 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86bf52855ea2f29765b7d5696469f1d8136d13e24f4d40ced9ef0c261a9cd3f8
|
|
| MD5 |
6261be314f1375de0c3828e34c7900a2
|
|
| BLAKE2b-256 |
1cf1ff4427888bf72faa9bc38541065bb1f9278aeec08c88c1b8584b5e02bf27
|
Provenance
The following attestation bundles were made for vor_profile-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
python.yml on SConsul/vor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vor_profile-0.2.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
86bf52855ea2f29765b7d5696469f1d8136d13e24f4d40ced9ef0c261a9cd3f8 - Sigstore transparency entry: 1704801664
- Sigstore integration time:
-
Permalink:
SConsul/vor@79987015ce141d2d6d42826fbab9239591c0ef70 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/SConsul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@79987015ce141d2d6d42826fbab9239591c0ef70 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vor_profile-0.2.1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: vor_profile-0.2.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 425.9 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3de480a3462a7f84373ff20174da06a1e3d58ed4871ef8e068df418cbbd8b16
|
|
| MD5 |
229d8b21061e4061cd2a05b2d6398628
|
|
| BLAKE2b-256 |
5d7df02439a9884eeff6daa16bd522b9b90f137da8a4ce3bd325702eb0998dbc
|
Provenance
The following attestation bundles were made for vor_profile-0.2.1-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
python.yml on SConsul/vor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vor_profile-0.2.1-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
f3de480a3462a7f84373ff20174da06a1e3d58ed4871ef8e068df418cbbd8b16 - Sigstore transparency entry: 1704801652
- Sigstore integration time:
-
Permalink:
SConsul/vor@79987015ce141d2d6d42826fbab9239591c0ef70 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/SConsul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@79987015ce141d2d6d42826fbab9239591c0ef70 -
Trigger Event:
push
-
Statement type: