Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 2.31 KB

INSTALLATION.md

File metadata and controls

79 lines (54 loc) · 2.31 KB

Installation Guidelines

There are three ways to install SPU: using official Docker image, installing from PyPI, and building from source.

Environment

Linux

SPU has been tested with the following settings:

  • Ubuntu 22.04
  • Python 3.10 and 3.11

macOS

We have conducted some successful preliminary testings on macOS Monterey 14.1 with Apple Silicon.

Docker Image

Please check official Docker image.

Installing From PyPI

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

Building From Source

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 for pip install (can be checked using pip -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

Build with GPU support

This requires CUDA Toolkit to be installed.

bazelisk build //:spu_wheel -c opt --config=gpu

Build with specified python version

# 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