There are three ways to install SPU: using official Docker image, installing from PyPI, and building from source.
SPU has been tested with the following settings:
- Ubuntu 22.04
- Python 3.10 and 3.11
We have conducted some successful preliminary testings on macOS Monterey 14.1 with Apple Silicon.
Please check official Docker image.
You could install SPU via the official PyPI package. Note that SPU current only support Python 3.10 and 3.11.
pip install spu
It is recommended to install in a virtual environment, e.g.,
conda create -n my-env python=3.11
conda activate my-env
pip install spu
- Install dependencies listed here.
- For CentOS 7 or Ubuntu 22.04, use corresponding dockerfile below as a reference:
- At the root of repo, run
bazelisk build //:spu_wheel -c opt
pip install bazel-bin/spu-*.whl --force-reinstall
- Note that:
- This will build with Python 3.11 by default. See below for specifing Python version when building.
- The Python version used for building (specified in
bazelisk
) must match the Python version used forpip install
(can be checked usingpip -V
). It is recommended to install in a virtual environment.
- Once GCC/bazel/python/Xcode version or other environment settings have changed, please run the following command to ensure a clean build
bazelisk clean --expunge
This requires CUDA Toolkit to be installed.
bazelisk build //:spu_wheel -c opt --config=gpu
# build with python 3.10
bazelisk build //:spu_wheel -c opt --@rules_python//python/config_settings:python_version=3.10
# build with python 3.11
bazelisk build //:spu_wheel -c opt --@rules_python//python/config_settings:python_version=3.11