iris icon indicating copy to clipboard operation
iris copied to clipboard

Fix hardcoded lock value in fused GEMM+CCL operations

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

Summary

  • Replace hardcoded lock signal value 1 in fused GEMM+CCL producer-consumer signaling with a monotonically increasing call_counter on FusedWorkspace
  • Each call to matmul_all_reduce or matmul_reduce_scatter increments the counter and passes it to both producer (atomic_xchg) and consumer (spin loop) sides
  • Eliminates the need to zero locks between calls for one_shot, two_shot, and reduce_scatter variants
  • spinlock variant is unaffected (uses CAS mutex pattern that self-resets)
  • signal_value parameter defaults to 1 for backward compatibility with existing test kernels

Test plan

  • [x] 25/25 fused ops tests pass on MI300X (8 GPUs)
  • [x] 54/54 context CCL tests pass on MI300X (8 GPUs)
  • [x] Custom workspace reuse test: 5 consecutive calls without lock zeroing, all correct (max_diff=0.125, call_counter=1→5)

Closes #465

🤖 Generated with Claude Code

mawad-amd avatar May 02 '26 15:05 mawad-amd