PyTorch

PyTorch is commonly used at ZI, especially on Axon. With version 2, it has become more complex to install in our preferred method (Conda environments.) While in the past simply pointing to the proper channel (aka repo) and installing conda installing pytorch was sufficient, however now the conda packages available are compiled for specific versions of Python, cudatoolkit, and sometimes even CUDNN depending on the channel.

For instance at the time of writing these are the available versions of 2.0.1 in the main (default) and pytorch channels:

pytorch                        2.0.1 cpu_py310hab5cca8_0  pkgs/main           
pytorch                        2.0.1 cpu_py310hdc00b08_0  pkgs/main           
pytorch                        2.0.1 cpu_py311h53e38e9_0  pkgs/main           
pytorch                        2.0.1 cpu_py311h6d93b4c_0  pkgs/main           
pytorch                        2.0.1 cpu_py38hab5cca8_0  pkgs/main           
pytorch                        2.0.1 cpu_py38hdc00b08_0  pkgs/main           
pytorch                        2.0.1 cpu_py39hab5cca8_0  pkgs/main           
pytorch                        2.0.1 cpu_py39hdc00b08_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py310h7799f5a_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py310he342708_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py311h7668aad_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py311hce0f3bd_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py38h7799f5a_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py38he342708_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py39h7799f5a_0  pkgs/main           
pytorch                        2.0.1 gpu_cuda118py39he342708_0  pkgs/main           
pytorch                        2.0.1    py3.10_cpu_0  pytorch             
pytorch                        2.0.1 py3.10_cuda11.7_cudnn8.5.0_0  pytorch             
pytorch                        2.0.1 py3.10_cuda11.8_cudnn8.7.0_0  pytorch             
pytorch                        2.0.1    py3.11_cpu_0  pytorch             
pytorch                        2.0.1 py3.11_cuda11.7_cudnn8.5.0_0  pytorch             
pytorch                        2.0.1 py3.11_cuda11.8_cudnn8.7.0_0  pytorch             
pytorch                        2.0.1     py3.8_cpu_0  pytorch             
pytorch                        2.0.1 py3.8_cuda11.7_cudnn8.5.0_0  pytorch             
pytorch                        2.0.1 py3.8_cuda11.8_cudnn8.7.0_0  pytorch             
pytorch                        2.0.1     py3.9_cpu_0  pytorch             
pytorch                        2.0.1 py3.9_cuda11.7_cudnn8.5.0_0  pytorch             
pytorch                        2.0.1 py3.9_cuda11.8_cudnn8.7.0_0  pytorch  

This shows a package name, a version number, a build and a channel, with the build giving the info about what Python, cudatoolkit and cudnn are needed as well as if it was compiled with GPU support.

This can be installed as follows:

conda install package=version=build -c channel

#example, note that it isn't needed to specify a channel for main
conda install pytorch=2.0.1=gpu_cuda118py39he342708_0

Note that it is still the preferred method to install the necessary CUDA in the case of this example (cudatools 11.8) and a CUDNN that is compatible with cudatools 11.8, using conda. In this case the commands would be:

conda install cudatoolkit=11.8.0
conda install cudnn=8.9.2.26