Write Python. Run JAX
Project description
jaxify
Write Python. Run JAX.
| ⚠️ jaxify is an experimental project under development |
|---|
| Feel free to test out and report any issues. Do not use in production. |
jaxify lets you JIT-compile functions (using JAX) that @jax.jit cannot handle. With jaxify, you can compile functions with e.g. Python if/elif/else statements (with support for other control flow structures planned for the future) that might be affected by the values of inputs.
jaxify's @jitx decorator works exclusively on the decorated function and intervenes only at tracing/compilation time; it does not have any effect at actual runtime besides the code it emits for JAX.
Installation
pip install jaxify
Getting started
import jax
import jax.numpy as jnp
from jaxify import jitx
@jax.vmap
@jitx
def absolute_value(x):
if x >= 0: # <-- If conditional in a JIT-compiled function!
return x
else:
return -x
xs = jnp.arange(-1000, 1000)
ys = absolute_value(xs) # <-- Runs at JAX speed!
print(ys)
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
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 jaxify-0.0.2.tar.gz.
File metadata
- Download URL: jaxify-0.0.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b892a54435a016bd077dd737d88c8a1c408427604a8fd37999add1e9a7962b20
|
|
| MD5 |
05e84466b81f44d13cddef37748f90ab
|
|
| BLAKE2b-256 |
e1d640bc9e22c5a0dd862ccb9543774ebcca6a7403f478a0742ea4b664a32fe7
|
File details
Details for the file jaxify-0.0.2-py3-none-any.whl.
File metadata
- Download URL: jaxify-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb9485c430a4741a884a2c18daf412757fb733afc6ffd5b683113a00ddd20ed8
|
|
| MD5 |
c8e1b4241d0e04502d4f64d347c404cd
|
|
| BLAKE2b-256 |
e89a721ac30cb888604161c0551c62b6f1fef4efef6c24f529f38f0c0b6df4f3
|