PyTorch
PyTorch is an optimized tensor library for deep learning using GPUs and CPUs.
Installing PyTorch on the HPC#
PyTorch is not currently in the standard Anaconda package provided on the HPC, but you can install it yourself using
conda
.
First, create a conda
environment (full documentation is available on our Conda page):
Warning
Inititial installation may take a while to run and use approximately 5.5G in the directory/folder in which it is installed.
- If you haven't run
conda init
yet, please refer to our instructions for how to do so - This command assumes you want to use Pytorch with GPUs. To customize the installation command, please refer to the getting started page on the official docs
Using PyTorch on the HPC#
Use the sample code from the Verification section of the PyTorch guide:
Using GPUs with PyTorch#
To run a PyTorch job on a GPU node, you need to submit a job to our job scheduler, and indicate that you want to run using GPUs.
Warning
Running torch.cuda.is_available()
on the login node will return False
. It will return True
on a GPU node.