Installation
We have tried to precompile the binaries for as many platforms as possible. If you are running one of the supported operating systems (which you most likely are), you can install QArray via pip:
pip install qarray
If you slip through the gaps, then the pip install will try to compile the binaries for you. This might require you to install some additional dependencies. In particular, you will need to have cmake and rust installed.
Install Rust from: https://www.rust-lang.org/tools/install
Install CMake from: https://cmake.org/download/. On macOS and Ubuntu, it may be more straightforward to install cmake using homebrew and apt, respectively.
Also, setting up JAX on macOS running on M series chips can be a bit
finicky. We outline the steps that worked for us in macOS
installation. Alternatively, just spin up a
Github Codespace and
pip install qarray for an easy route around the various issues.
macOS installation from scratch
Getting JAX to work macOS on M Series chips can be problematic. Here are the steps we used to get everything working starting from a fresh OS install.
Install homebrew from https://brew.sh and run through the install script.
Use homebrew to install miniconda:
brew install miniconda
Use homebrew to install cmake:
brew install cmake
Create a new conda environment and install pip:
conda create -n qarray python=3.11
conda activate qarray
conda install pip
Install qarray using pip:
pip install qarray
This installation script has been demonstrated to work on macOS Ventura 13.4 and Sonoma 14.4. To install directly from the repository, use the command:
pip install git+https://github.com/b-vanstraaten/qarray.git@main
Jaxlib GPU
By default we install the CPU version of JAX, with the dependency ‘jax[cpu]>=0.2’, this is done for compatibility reasons. If you want to use the GPU version of JAX, you need to install it by running:
pip install -U "jax[cuda12]"
This will install the GPU version of JAX with CUDA 12 support. If you are using a different version of CUDA, you can specify it by changing the version number in the brackets. For more instructions see here: https://jax.readthedocs.io/en/latest/installation.html