A lightweight profiling framework for JAX
Project description
⚡ Performax
A lightweight profiling framework for JAX that makes it easy to measure execution time of your functions.
✨ Features
- 🎯 Simple decorator API - Just add
@trackto functions you want to profile - 🚀 Minimal overhead - Uses JAX's built-in Perfetto tracing
- 📊 Detailed statistics - Get total time, call counts, and averages
- 📁 Multiple output formats - Pretty tables, dictionaries, pandas DataFrames, and more
- 🎨 Flexible loggers - Rich tables, JSON, CSV, Markdown, and plain text output
- 🔒 Thread-safe - Prevents concurrent profiling conflicts
📦 Installation
pip install performax
Or install from source:
git clone https://github.com/noahfarr/performax.git
cd performax
pip install -e .
🚀 Quick Start
import jax.numpy as jnp
from performax import track, profile
@track
def matmul(a, b):
return jnp.dot(a, b)
@track(name="forward")
def forward(x, weights):
for w in weights:
x = matmul(x, w)
return x
def main():
x = jnp.ones((1000, 512))
weights = [jnp.ones((512, 512)) for _ in range(5)]
return forward(x, weights)
result, stats = profile(main)
print(stats)
Output:
Function | Total (ms) | Calls | Avg (ms)
-----------------------------------------
forward | 125.432 | 1 | 125.432
matmul | 98.765 | 5 | 19.753
📋 Requirements
- Python >= 3.12
- JAX >= 0.4.0
- rich (optional, for
RichLogger) - pandas (optional, for
to_dataframe())
🛠️ Development
pip install -e ".[development]"
pytest
pytest --cov=performax
pytest -m "not slow"
📄 License
MIT
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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
performax-0.1.0.tar.gz
(11.8 kB
view details)
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 performax-0.1.0.tar.gz.
File metadata
- Download URL: performax-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
247f664ff2ca8635c705cfeaffb8c2ff5e49d4bdbebcc05047a2e416f894395a
|
|
| MD5 |
46e012420b330ace31615993609a5db6
|
|
| BLAKE2b-256 |
25951f057dd350d3b3ea55ddcc14278a110f6a0c922b7e484fcd2fc70191220e
|
File details
Details for the file performax-0.1.0-py3-none-any.whl.
File metadata
- Download URL: performax-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5efd30a18afff4a63ba9060d652f2be6d56870a7f7257c146f629c45533a86b1
|
|
| MD5 |
daec58726fd8f9cdf0688aad75c17c36
|
|
| BLAKE2b-256 |
99067ff8d3b0359dc8e0781a1dca8d7db63f85397735b86b4e1a21753650dfe9
|