Skip to main content

A visualizer for JaxPrs

Project description

JaxPr Visualizer

Code style: black License Badge Ruff Python Version

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


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)

Uploaded Source

Built Distribution

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

jaxprvis-0.0.1-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

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

Hashes for jaxprvis-0.0.1.tar.gz
Algorithm Hash digest
SHA256 85795c6149672c1f4ae06fc28ae07d77c489fcca57efb69762aee12ed59e0f2d
MD5 6b56ab100785003ee511d79040e02a5f
BLAKE2b-256 d67d546fbce473f01b3a66eb4fc1db971ac79cf5e8f8dab2378f048b840d68a8

See more details on using hashes here.

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

Hashes for jaxprvis-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5d54225484318fa997c7f8a6fd2550a83e34ecce71d42e82b8ecf6c758a5abe
MD5 2c8a7d017c501cbcf026a86a3d382459
BLAKE2b-256 6f5d4739dc8bc95a07e832f39893104bf1295b6382fb3f9e1efff2c87325a5a1

See more details on using hashes here.

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