Skip to content

PyTorch is a machine learning library based on the Torch library, used for applications such as computer vision and natural language processing, originally developed by Meta AI and now part of the Linux Foundation umbrella.

PyTorch provides two high-level features:

  • Tensor computing (like NumPy) with strong acceleration via GPUs
  • Deep neural networks built on a tape-based automatic differentiation system

Installation

The following directions assume a working Conda install.

NPL (AiMOSx) Cluster

Setup Python:

export http_proxy=http://proxy:8888
export https_proxy=$http_proxy
conda install python=3.10.13

Install PyTorch

module load gcc 
module load cuda/12.1
conda install pytorch

Note: It is no longer necessary to specify that CUDA by installing "pytorch::pytorch-cuda".

NGH Cluster

COMING SOON

Troubleshooting

Confirm CUDA is enabled

If CUDA is not loaded into Pytorch, performance will suffer.

To confirm pytorch has CUDA available, run:

python

import torch
torch.cuda.is_available()