[tutorial] Using PyTorch2 with GPU on Baobab

We have been providing PyTorch on Baobab via module for a long time. This works fine, but the version we provide may be out of date from time to time. Are you stuck in this case? Not at all.

The easiest way is to run PyTorch from apptainer, a Docker like container made for hpc.

Nvidia provides several Docker images that you can run on the cluster if the version we provide doesn’t suit your needs.

Steps to do:

  1. convert the Docker image to Apptainer format (sif)
  2. create a sbatch script to run your newly created image with Apptainer
  3. launch your sbatch on the cluster
  4. enjoy!

The good news is that we have already created the sif image for PyTorch2 : you can use it from /opt/cluster/registry/pytorch_23.05-py3.sif.

We created a sbatch example to launch PyTorch2 using Apptainer and GPU on Baobab.