ROCm Lab 3 on an MI300X: rocBLAS, MIOpen, rocFFT and ResNet-18 in one notebook

I just finished Lab 3 of the ROCm Certified Associate track on AMD Developer Cloud, running on an AMD Instinct MI300X (191.7 GB, PyTorch 2.10 with ROCm 7.2). Here is what the numbers looked like.

rocBLAS SGEMM, 1024 x 1024 x 1024: 0.032 ms, about 68 TFLOPS, roughly 42% of the FP32 peak. A matrix this small finishes before the GPU is fully busy, so bigger sizes should push that number up.

MIOpen convolution (32x64x224x224 input, 128 filters of 3x3): 5.3 seconds on the very first run while MIOpen searched for the fastest algorithm, then 3 ms per run once the choice was cached. Lesson: never time the first run.

rocFFT round trip, 8,192 points: max error 9.5e-07, pass.

ResNet-18 on CIFAR-10, 2 epochs: loss fell from 1.88 to 1.07, about 6 seconds per epoch, 1.6 GB of GPU memory.

Debugging: setting HIP_VISIBLE_DEVICES=99 hides the GPU and PyTorch fails with “No HIP GPUs are available”. Setting it to 0, or unsetting it, brings it back. Worth checking first whenever a container says it cannot find the GPU.

One tip for anyone doing this lab: run the %%writefile cell before the compile cell. If you skip it, hipcc fails with “no such file” and it looks like a ROCm problem when it is not.

On to Module 4, HIP programming and porting CUDA.