iris
iris copied to clipboard
Cache hip.get_num_xcc() to eliminate 14ms Config overhead
Summary
- Root cause:
Config.__post_init__callediris.hip.get_num_xcc()(a ctypes call into the HIP runtime) on every collective invocation, adding ~14ms overhead per call. This caused all collectives to show constant 10-12ms latency regardless of message size. - Fix:
functools.lru_cacheon the XCC query since it never changes during a process lifetime. - Added simplified PULL-model kernels for all_gather, reduce_scatter, and all_to_all that use linear tile indexing instead of GROUP_SIZE_M swizzle + chiplet_transform, which caused poor codegen on MI300X.
Results (MI300X, 8 GPUs, bfloat16)
| Size | all_gather | reduce_scatter | all_to_all | all_reduce |
|---|---|---|---|---|
| 32KB | 1.08x | 1.10x | 1.50x | 1.11x |
| 128KB | 1.19x | 1.01x | 1.39x | 1.10x |
| 512KB | 1.37x | 0.81x | 1.49x | 0.93x |
| 2MB | 1.62x | 0.57x | 1.58x | 0.90x |
| 8MB | 1.87x | 0.35x | 1.62x | 0.99x |
| 32MB | 2.04x | 0.23x | 1.77x | 1.22x |
| 128MB | 2.13x | 0.17x | 1.97x | 1.15x |
ratio = iris/RCCL, bold = iris wins
reduce_scatter beats RCCL by 3-6x at medium/large sizes. all_reduce beats RCCL at 512KB-8MB.
Test plan
- [x] All 4 collectives pass correctness checks (8 GPUs, MI300X)
- [x] Performance benchmarked against RCCL across 7 message sizes
- [ ] CI tests pass
🤖 Generated with Claude Code