Developer Tools

PyTorch skips CUDA graph introspection tests on AMD ROCm

NVIDIA-only CUDA bindings force test exclusions for 101k-star framework.

Deep Dive

PyTorch merged a pull request (PR #186383) that adds `@skipIfRocm` decorators to two test classes in `test_cuda_graph_utils.py`: `TestMarkKernels` and `TestGetGraphData`. These tests rely on NVIDIA-specific CUDA graph introspection APIs like `cudaGraphNodeGetToolsId` and `get_graph_data`, which are part of the `cuda.bindings` module. Since AMD's ROCm platform does not implement these interfaces, running the tests on ROCm causes failures.

The fix is minimal but necessary to keep the ROCm CI green on trunk and rocm-mi300 configurations. The tests continue to run on CUDA systems where `cuda.bindings` is available. The PR was approved by reviewer `jeffdaily` and was created with Cursor. This is a typical compatibility patch as PyTorch maintains support for both NVIDIA CUDA and AMD ROCm backends, but certain NVIDIA-only features have no direct ROCm equivalents.

Key Points
  • PR #186383 skips two test classes (`TestMarkKernels`, `TestGetGraphData`) on ROCm using `@skipIfRocm`.
  • Tests depend on NVIDIA-only `cuda.bindings` APIs like `cudaGraphNodeGetToolsId` with no ROCm equivalent.
  • Change keeps ROCm CI passing on AMD MI300 while preserving CUDA test coverage.

Why It Matters

Ensures PyTorch CI reliability on AMD GPUs, reflecting ongoing NVIDIA vs ROCm API fragmentation.

📬 Get the top 10 AI stories daily