iris icon indicating copy to clipboard operation
iris copied to clipboard

Validate symmetric heap placement in CCL collectives

Open mawad-amd opened this issue 7 months ago • 0 comments

Summary

  • Add _ensure_symmetric() and _validate_output_symmetric() helpers to iris/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_shot ensure input, atomic/spinlock/two_shot validate output, ring checks neither (workspace is internal)
    • reduce_scatter: input auto-imported (remote read via iris.load), output unchecked (local write)
  • 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 — validates ValueError for 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

mawad-amd avatar Apr 30 '26 07:04 mawad-amd