Torch

This section is currently under development.

Following the Torch documentation, we create an environment that installs Torch and its dependencies. Torch no longer directly creates Conda packages. Instead we use Conda to create the environment and then Pip to install the relevant Torch packages (including for working with the GPU):

module load cuda/12.6
conda create --name my_torch_env
conda activate my_torch_env
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126

You can verify successful installation by launching a short “interactive” job on one of the GPU nodes like shown below.

(my_torch_env) [ada ~]$ srun --time=1:00:00 --partition=gpu-short --gres=gpu:1 --pty bash -i
[node020 ~]$ python3
Python 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True