Skip to content

AllReduce LL128: split into flag-synced + warpsync sub-tiers (gfx1250)#8915

Open
srirajpaul wants to merge 2 commits into
ROCm:rccl/gfx1250from
srirajpaul:dda-ar-ll128-ipc_2
Open

AllReduce LL128: split into flag-synced + warpsync sub-tiers (gfx1250)#8915
srirajpaul wants to merge 2 commits into
ROCm:rccl/gfx1250from
srirajpaul:dda-ar-ll128-ipc_2

Conversation

@srirajpaul

@srirajpaul srirajpaul commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

Improve performance of Allreduce for mid sizes from 4MB to 32MB

Technical Details

Summary

  • Splits the gfx1250 DDA fabric AllReduce LL128 fast path into two size sub-tiers, keeping the shared DDA_LL128_THRESHOLD (32 MiB) untouched for the other collectives (AllGather/AllToAll/ReduceScatter):
    • size <= DDA_LL128_AR_THRESHOLD (2 MiB) -> LL128 flag-synced kernel (in-line trailing flag word, no barrier).
    • size <= DDA_LL128_AR_WARPSYNC_THRESHOLD (32 MiB) -> LL128 warpsync kernel (full 128B-line payload synced by a per-warp arrival barrier).
    • otherwise -> Simple.
  • Renames the full-line + barrier variant from the _1 suffix to _warpsync (all_reduce_dda_fabric_ll128_warpsync.h, kernel ddaAllReduceFlatLL128_warpsync).
  • Moves the warpsync host launcher into a dedicated dda_all_reduce_fabric_ll128_warpsync.cu; dda_all_reduce_fabric_ll128.cu is now flagged-only (drops the RCCL_DDA_LL128_AR_FULL_LINE runtime toggle).
  • Wires the new translation unit through src/CMakeLists.txt and the device linker (cmake/DeviceLinker.cmake).

New env knobs (AllReduce-only): RCCL_DDA_LL128_AR_THRESHOLD, RCCL_DDA_LL128_AR_WARPSYNC, RCCL_DDA_LL128_AR_WARPSYNC_THRESHOLD.

Issue Tracking

Test Plan

  • Build librccl for gfx1250 (verified locally).
  • rccl-tests all_reduce_perf (bf16/fp16/fp32) across <=2 MiB, 2-32 MiB, and >32 MiB to confirm correct tier selection and correctness.
  • Confirm AllGather/AllToAll/ReduceScatter behavior is unchanged (shared 32 MiB LL128 threshold).

Test Result

Performance improvement from size 4MB to 32MB

  time us     bandwidth GB/s
size current new   current new
128 7.03 6.7   0.03 0.03
256 7.33 7.01   0.05 0.05
512 7.45 7.07   0.1 0.11
1024 6.99 6.99   0.22 0.22
2048 7.11 7.03   0.43 0.44
4096 7.22 7.44   0.85 0.83
8192 7.59 7.47   1.62 1.65
16384 7.88 7.74   3.12 3.18
32768 7.82 7.73   6.28 6.36
65536 11.24 11.29   8.74 8.7
131072 11.4 11.55   17.24 17.02
262144 11.61 11.84   33.86 33.22
524288 11.85 11.96   66.36 65.76
1048576 12.76 12.99   123.25 121.07
2097152 19.26 19.48   163.33 161.46
4194304 27.97 25.27   224.94 248.97
8388608 38.83 35.27   324.05 356.72
16777216 77.8 55.55   323.47 452.99
33554432 148.67 96.26   338.54 522.9
67108864 161.75 161.8   622.34 622.16
134217728 221.69 221.71   908.14 908.05

Submission Checklist

srirajpaul and others added 2 commits July 20, 2026 07:05
Add a 128B-line LL128 all-reduce variant that carries payload in all 16 words of
each line (no in-line flag word) and synchronizes phase 1/2 with a separate
all-to-all, per-global-warp arrival barrier staged in a reserved 1 MiB front
region of each peer's scratch. Payload efficiency improves from 15/16 to 16/16.
The flag region is not double-buffered, so the wait uses a monotonic ">= flag"
compare to tolerate a peer racing one call ahead.

New codepath-agnostic kernel ddaAllReduceFlatLL128_1 in
all_reduce_dda_fabric_ll128_1.h. The fabric launcher selects between it and the
base flagged kernel via a useFullLine toggle (default full-line); numLines /
slot stride / scratch sizing follow the selection, and the scratch bound now
accounts for the reserved 1 MiB.

Ordering note: like the base LL128 kernel this is unfenced, but the flag now
lives in a separate scratch region from the payload -- a stronger visibility
assumption to validate on hardware (or guard with __threadfence_system()).

Co-authored-by: Cursor <cursoragent@cursor.com>
Rename the full-line + barrier LL128 all-reduce header/kernel from the
_1 suffix to _warpsync, and move its host launcher into a dedicated
dda_all_reduce_fabric_ll128_warpsync.cu (the flagged kernel stays in
dda_all_reduce_fabric_ll128.cu, now flagged-only).

Introduce AllReduce-specific LL128 sub-tiering so the shared
DDA_LL128_THRESHOLD (32 MiB) still governs the other collectives:
AllReduce uses DDA_LL128_AR_THRESHOLD (2 MiB) for the flag-synced kernel
and DDA_LL128_AR_WARPSYNC_THRESHOLD (32 MiB) for the warpsync variant.

Wire the new translation unit through CMake and the device linker.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant