iris
iris copied to clipboard
Add CUDA graph capture probe for iris collectives
Summary
- Adds
tests/graph_capture_probe.py— a probe script that tests which iris operations can be captured in a CUDA graph - Uses
hipStreamBeginCapturedetection (authoritative from HIP runtime) plus fresh-data replay validation to catch stale results - Run with:
torchrun --nproc_per_node=2 --standalone tests/graph_capture_probe.py
Results (MI355X, 2 GPUs)
| Operation | Status | Blocker |
|---|---|---|
device_barrier |
CAPTURABLE | — |
host_barrier |
NOT CAPTURABLE | Uses NCCL |
ccl.all_reduce(atomic) |
NOT CAPTURABLE | refresh_peer_access CPU↔CUDA copy |
ccl.all_reduce(two_shot) |
NOT CAPTURABLE | same |
ccl.all_reduce(one_shot) |
NOT CAPTURABLE | same |
ccl.all_gather |
NOT CAPTURABLE | same |
ccl.all_to_all |
NOT CAPTURABLE | same |
ccl.reduce_scatter |
NOT CAPTURABLE | same |
ops.matmul_all_reduce |
NOT CAPTURABLE | same |
Root cause
SymmetricHeap.allocate() calls refresh_peer_access() every time, which does:
self.heap_bases[self.cur_rank] = int(all_bases_arr[self.cur_rank])
This is a CPU↔CUDA tensor copy, which is illegal during hipStreamBeginCapture. It gets triggered when any ctx.zeros() allocation happens inside the CCL launch path (workspace creation in preamble).
Fix direction
To make CCL ops graph-capturable, we need to:
- Ensure all workspace allocation happens before graph capture (pre-allocate via preamble)
- Make
get_heap_bases()return a pre-built CUDA tensor without any CPU interaction during the kernel launch path - Add
async_op=Trueto skip the trailingctx.barrier()(already supported)
🤖 Generated with Claude Code