Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
streamk gemm kernel is using spinning lock to implement multiple buffer method to replace atomic_add,
The PR 4431 cause data racing when using atomics_xchg and atomics_cas together to implement [spinning lock.] atomic cas uses shared memory but atomics_xchg doesn't.(https://github.com/ROCm/triton/blob/624335ff569562d5db26bea337e3c6de2bd6b0dc/python/perf-kernels/streamk/streamk_kernel.py#L173C12-L205C1)
In Triton, atomic operations are performed at the block level, where each block can consist of multiple waves. The purpose of adding synchronization is to ensure that waves wait until the current wave has completed its execution.