A visualizer for JaxPrs
Project description
JaxPr Visualizer
This project provides interactive visualizations of JAX computations. Composite nodes can be expanded using left-click and contracted using right-click. Space pauses the simulation.
Usage Example
import jax.numpy as jnp
from jax import make_jaxpr
from jax.core import ClosedJaxpr
import jaxprvis as jvis
def visualize_loop_unroll_jaxpr(iter: int) -> ClosedJaxpr:
example_args = jnp.zeros((2, 2))
def f(x, y):
z = x
for i in range(iter):
z = (z + y) / x
return z
closed_jaxpr: ClosedJaxpr = make_jaxpr(f)(example_args, example_args)
jvis.visualize(closed_jaxpr)
Installation
For Users
Install from Pypi:
#Create and activate virtual environment (if not present yet)
python -m venv --upgrade-deps ./venv
source ./venv/bin/activate
pip install --upgrade build
# Install your JAX version
#e.g. pip install --upgrade "jax[cpu]"
pip install --upgrade jaxprvis
Install from source:
# Clone
git clone https://github.com/PSilvestre/jaxprvis
cd jaxprvis
#Create and activate virtual environment
python -m venv --upgrade-deps ./venv
source ./venv/bin/activate
pip install --upgrade build
python -m build
pip install -e .
For Developers
Similar to the above, but instead install the dev requirements. Run the following to install:
# Clone
git clone https://github.com/PSilvestre/jaxprvis
cd CORAL
#Create and activate virtual environment
python -m venv --upgrade-deps ./venv
source ./venv/bin/activate
pip install --upgrade build
python -m build
pip install -e ".[dev]"
#Run the tests
pytest
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
jaxprvis-0.0.1.tar.gz
(22.5 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
jaxprvis-0.0.1-py3-none-any.whl
(22.7 kB
view details)
File details
Details for the file jaxprvis-0.0.1.tar.gz.
File metadata
- Download URL: jaxprvis-0.0.1.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85795c6149672c1f4ae06fc28ae07d77c489fcca57efb69762aee12ed59e0f2d
|
|
| MD5 |
6b56ab100785003ee511d79040e02a5f
|
|
| BLAKE2b-256 |
d67d546fbce473f01b3a66eb4fc1db971ac79cf5e8f8dab2378f048b840d68a8
|
File details
Details for the file jaxprvis-0.0.1-py3-none-any.whl.
File metadata
- Download URL: jaxprvis-0.0.1-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5d54225484318fa997c7f8a6fd2550a83e34ecce71d42e82b8ecf6c758a5abe
|
|
| MD5 |
2c8a7d017c501cbcf026a86a3d382459
|
|
| BLAKE2b-256 |
6f5d4739dc8bc95a07e832f39893104bf1295b6382fb3f9e1efff2c87325a5a1
|