Excerpt |
---|
PyTorch is an optimised tensor library for deep learning using GPUs and CPUs. |
Column | ||||||
---|---|---|---|---|---|---|
|
...
$ docker pull quay.io/pawsey/pytorch:2.2.0-rocm5.7.3
The container can be also pulled using singularity:
...
Note that when requesting the interactive allocation, users should use their correct project name instead of the "yourProjectCode
" place holder used in the example. Also notice the use of the "-gpu
" postfix to the project name in order to be able to access any partition with GPU-nodes. Please refer to the page Example Slurm Batch Scripts for Setonix on GPU Compute Nodes for a detailed explanation of resource allocation on GPU nodes.
Installing additional Python packages
There are at least two ways on which users can install additional Python packages that are required and the container lacks. The first way is to build a user's own container image from the Pawsey PyTorch container. The second way is the use of a virtual environment saved on Setonix itself, on which the user can install this additional Python packages and be loaded from there. This second way is our recommended procedure.
The trick is to create a virtual environment using the Python installation within the container. This ensures that your Packages are installed considering what is already installed on the container and not on Setonix. However, the virtual environment will be created on the host filesystem, ideally Setonix's /software
. Filesystems of Setonix are mounted by default on containers, are writable from within the container, and hence pip
can install additional packages. Additionally, virtual environments can be preserved from one container run to the next. We recommend to install this virtual environments in some understandable path under $MYSOFTWARE/manual/software
.
To do so, you will need to open a BASH shell within the container. Thanks to the installation of the PyTorch container as a module, there is no need to explicitly call the singularity
command. Instead, the containerised installation provides the bash
wrapper that does all the work for the users and then provide an interactive bash session inside the Singularity container. Here is a practical example that installs xarray
package into a virtual environment named myenv
:
Column | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
as you can see, the environment stays on the filesystem and can be used in later runs.
Column | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
Writing PyTorch code for AMD GPUs
...