The Heterogeneous Interface for Portability (HIP) provides a programming framework for harnessing the compute capabilities of multicore processors such as the AMD MI250X GPU’s on Setonix. In this course we focus on the essentials of developing HIP applications, with a focus on supercomputing.
- course_material - contains the course material.
- deployment - contains tools for deploying course material to Github and managing users.
- resources - helpful tools and information for use within the course.
In this course we cover the following topics. Each topic is a subfolder in course_material.
- Lesson 1 - Introduction to HIP and high level features
- Lesson 2 - How to build and run applications on Cray AMD systems like Frontier and Setonix
- Lesson 3 - A complete example of matrix multiplication, explained line by line
- Lesson 4 - Debugging HIP applications
- Lesson 5 - Measuring the performance of HIP applications with profiling and tracing tools
- Lesson 6 - Memory management with HIP
- Lesson 7 - Strategies for improving the performance of HIP kernels
- Lesson 8 - Strategies for optimising application performance with concurrent IO.
- Lesson 9 - Porting CUDA applications to HIP
Lessons are in the form of Jupyter notebooks which can be viewed on the student's machine with JupyterLab or with a web browser. All exercises may be performed on the command line using an SSH connection to a remote server that has ROCM installed.
A recent version of Anaconda Python is helpful for viewing the notebook files. Once Anaconda is installed create a new environment
conda create --name hip_course python=3.10 nodejs=18.15.0
conda activate hip_course
A list of helpful packages for viewing the material may then be installed with this command when run from the HIP_Course folder.
pip install -r deployment/requirements.txt
then run
jupyter-lab
from the command line to start the Jupyter Lab environment. The command
conda activate hip_course
is to enter the created environment, and the command
conda deactivate
will leave the environment.
In order to use the material in this course a full installation of ROCM is advised. It is the path of least pain to use a distribution of Linux that ROCM officially supports. The AMD utility amdgpu-install can install ROCM packages. This command will install the ROCM tools.
sudo amdgpu-install -y --usecase=opencl,hip,rocm,openclsdk,hip,hiplibsdk,rocmdevtools,rocmdev
It is advisable to use an AMD graphics card that ROCM supports. Other AMD GPU's work unofficially, but you can expect the occasional undefined behaviour and things not working like they should.
HIP can also use a CUDA backend. In that case install both ROCM and a compatible version of CUDA. Usually a safe choice for CUDA is the previous major release. Then the course may be run on a CUDA backend with a recent NVIDIA graphics card. In such instances the environment variable HIP_PLATFORM must be set to nvidia.
export HIP_PLATFORM=nvidia
If either the AMD or NVIDIA backend is not available, then the HIP CPU runtime is a header-only library that provides a way to develop HIP applications on a CPU.