Installing bosk#

Please, read this guide carefully, because the package depends on the JAX, which cannot be installed automatically.

Prerequisites#

Environment#

Make sure that the python >= 3.9 environment is ready.

For example, with Anaconda the environment can be created and activated by running:

conda create -n bosk_env python=3.10
conda activate bosk_env

Graphviz installation#

Bosk uses Graphviz to vizualize computational graphs. This tool requires the binary dependency graphviz to be installed.

On Linux the graphviz can be installed with a package manager. For example, on Ubuntu the following terminal command can be used:

sudo apt install graphviz

If using Anaconda, graphviz can be installed with the command:

conda install -c conda-forge graphviz

Instructions for installing graphviz for other platforms can be found at link.

JAX installation#

If it is needed to install bosk without JAX support, go to Установка пакета.

Bosk uses JAX for GPU computations, but JAX installation is not trivial. Officially JAX is only distributed for Linux and Mac OS, so, unfortunatelly, Windows users should use WSL to install JAX and use bosk with GPU support.

CPU-only system

If there is no GPU available, install the CPU JAX version:

pip install --upgrade "jax[cpu]==0.4.10"

GPU system

Please, follow The official JAX installation guide or run the following command to install CUDA12 version:

pip install --upgrade "jax[cuda12_pip]==0.4.10" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html

Note

Notice that, according to the NVIDIA guide, Windows users must not install any NVIDIA GPU Linux driver within WSL 2. Those NTAILab participants, who uses Windows, installed CUDA Toolkit and cuDNN manually, so we only can recommend to use part of the guide where the preinstalled copy of CUDA is used to install JAX over it.

Package Installation#

To install the bosk package directly from GitHub run:

pip install git+https://github.com/NTAILab/bosk.git

Alternatively the repo can be cloned and installed manually:

git clone https://github.com/NTAILab/bosk.git
cd bosk
pip install -r requirements.txt
python setup.py install

Dev Installation#

For development purpose it is more convenient to install the package in develop mode, to automatically update package on changes (actually it uses symlinks):

git clone https://github.com/NTAILab/bosk.git
cd bosk
pip install -r requirements.txt
python setup.py develop