iris
iris copied to clipboard
Validate symmetric heap placement in CCL collectives
Summary
- Add
_ensure_symmetric()and_validate_output_symmetric()helpers toiris/ccl/utils.py - Each CCL collective now validates that remotely-accessed tensors are on the symmetric heap, based on actual kernel access patterns:
- all_gather: output validated (remote write via
iris.store), input unchecked (local read) - all_to_all: input auto-imported (remote read), output validated (remote write)
- all_reduce: variant-dependent —
one_shot/two_shotensure input,atomic/spinlock/two_shotvalidate output,ringchecks neither (workspace is internal) - reduce_scatter: input auto-imported (remote read via
iris.load), output unchecked (local write)
- all_gather: output validated (remote write via
- Input tensors that are remote-read: auto-imported via
as_symmetric()(no-op if already on heap) - Output tensors that are remote-written: must be pre-allocated on heap (auto-import would silently discard results with torch allocator)
Test plan
- [ ] Existing CCL tests pass (all tensors already on heap → no-op path)
- [ ] New
test_all_gather_rejects_non_symmetric_output— validatesValueErrorfor non-symmetric output - [ ] New
test_all_gather_non_symmetric_input_ok— validates non-symmetric input works (local-only access) - [ ] Run full CCL test suite on MI325X/MI355X:
torchrun --nproc_per_node=4 tests/run_tests_distributed.py tests/ccl/ -v
🤖 Generated with Claude Code