JAX Speed Optimizations
Project description
JAXSPD
JAXSPD (JAX Speed Optimizations) is a Python package that provides speed optimizations for JAX. This package is particularly useful for users who need to optimize their JAX code for better performance.
Features
- Optimized JIT compilation support
- Enhanced GPU support for NVIDIA GPUs
- Advanced optimization utilities
- Memory efficiency tools
- Profiling and debugging capabilities
Installation
You can install JAXSPD using pip:
pip install jaxspd
For GPU support, install with the GPU extras:
pip install jaxspd[gpu]
Usage
Basic JIT Usage
import jaxspd as jx
@jx.jit
def my_function(x):
return x * 2 + 1
# The function will be JIT-compiled
result = my_function(5)
GPU Optimizations
import jaxspd as jx
# Enable GPU optimizations
jx.enable_gpu_optimizations()
# Your GPU-optimized code here
Advanced Optimizations
import jaxspd as jx
# Auto-JIT with memory optimization
@jx.auto_jit
def optimized_function(x):
return jnp.sum(jnp.exp(x))
# Memory-efficient processing
@jx.memory_efficient(max_memory=1e9) # 1GB max memory
def process_large_array(x):
return jnp.mean(x, axis=0)
# Shape optimization
@jx.optimize_for_shape(static_shapes={"x": (1000, 1000)})
def matrix_operation(x):
return jnp.dot(x, x.T)
# Operation fusion
@jx.fused_operations(fusion_level=2)
def fused_computation(x):
return jnp.sum(jnp.exp(jnp.dot(x, x.T)))
Requirements
- Python >= 3.8
- JAX >= 0.4.13
- JAXlib >= 0.4.13
- NumPy >= 1.20.0
For GPU support:
- CUDA-compatible GPU
- CUDA toolkit
- cuDNN
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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 jaxspd-0.1.3.tar.gz.
File metadata
- Download URL: jaxspd-0.1.3.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f94424f8c5631db57db3ee07f42ce4c672455b72db7763917433945b1d1bca0c
|
|
| MD5 |
199ee6a124f9e7f3fbede28b2048f866
|
|
| BLAKE2b-256 |
7f1135ae333d85c4b8e25427dbbf73e126ba3bdd513e67f9a894478646e6f462
|
File details
Details for the file jaxspd-0.1.3-py3-none-any.whl.
File metadata
- Download URL: jaxspd-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c84d1779b392f6fb38793d98278b8e2caf7990fc7da736249a3d9f8fa566fce4
|
|
| MD5 |
80516d87f65e7087fcd420b24b2cd9e6
|
|
| BLAKE2b-256 |
1ae1b0e0a5b3934039ad332df8f1b7f2d69a42d639d2b1f42be205ad15436bf2
|