This repository contains convenient bash scripts to install JAX on Intel GPUs with a pip installation, using the Intel® Extension for OpenXLA plug-in.
To install JAX with Intel GPU support, simply run:
./install.sh
./setup.sh To verify that JAX is correctly installed and the Intel GPU is detected, run:
python -c "import jax; print(jax.devices())"It should give somthing like
[sycl(id=0), sycl(id=1)]It also contains a sample script jaxexample.py to verify that some key JAX features are functioning correctly:
- Device Info Check - Confirming GPU is being used.
- Basic JAX Operations - Element-wise operations, random number generation.
- JIT Compilation - Speedup using
jax.jit. - Automatic Differentiation - Using
jax.gradandjax.vjp. - Parallel Computation - Using
jax.pmap. - Vectorisation - apply functions over entire arrays without for-loops using
jax.vmap. - Array Manipulation - Advanced indexing, slicing, and reshaping.
- Linear Algebra - Matrix operations.
- Random Number Generation - Using the new
jax.randomPRNG. - Distributed Computing - Basic test for
jax.lax.pmeanandpmapover multiple devices.