Repository navigation
[FlyDSL] [CI] One stage and two-stage ring all-reduce kernels for PCIe interconnects - #5461
Conversation
Drop unused wave-join and single-wave fanout compiles; default and test the fp16 codec.
Compile-only and cache warming belong in developer scripts, not pytest or QRInt4QuadFanout.compile. Co-authored-by: Cursor <[email protected]>
inttoptr + make_buffer_tensor (nbytes OOB) and BufferCopy128b tiled copies replace the tile/atom/tid arithmetic for local dwordx4 loads and stores. IPC/XGMI fanout stays global_store_dwordx4 nt.
…hey were not FlyDSL-main originals.
…peline so the public API is QRInt4.
… measured keeper; drop unused codec/force_super/bf16 ALU and qr_int4_mem, compiling via flyc.compile. Co-authored-by: Cursor <[email protected]>
…R does the same), and time QRInt4 with run_perftest.
…; WORLD=8 stays kRankAtoms=1. Co-authored-by: Cursor <[email protected]>
…aiter vendored dual header. Co-authored-by: Cursor <[email protected]>
gfx942 already lowers vector<2xf16> to v_pk_max/min/mul/add/fma, so the llvm.inline_asm helpers and f32 absmax round-trip are unnecessary.
The two-shot NT fanout and last-sector handshake are unchanged; gfx942 SQNR vs fp32 all-reduce still passes at TP 2/4/8. Co-authored-by: Cursor <[email protected]>
TP2 ST=8 was packing the next tile into LDS while wave 0 still loaded the previous one. Also match aiter FlyDSL dtype/device checks and stop sorting IPC group ranks. Co-authored-by: Cursor <[email protected]>
Each rank already scored vs its local fp32 NCCL all-reduce. The parent kept rank 0 only, so a broken all-gather on a non-zero rank could pass. Co-authored-by: Cursor <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fail SQNR on NaN or a zero-power reference with error. Drop the NCCL fallback for Gloo object gather. Reject a rank or world_size that does not match the process group. Co-authored-by: Cursor <[email protected]>
Extend arch support to gfx950, parameterize inbox/launch grid_cap (default 1216 to match HIP QR), and tighten the canonical test bench with --grid-cap and optional JSON export. Co-authored-by: Cursor <[email protected]>
IPC inbox setup needs CPU broadcast_object_list and node-local HIP IPC handles. Fail fast before allocating buffers, matching QuickAllReduce.
Co-authored-by: Cursor <[email protected]>
Clamp persistent grids to conservative residency limits, harden resource cleanup, and validate lossy collective results across ranks. Co-authored-by: Cursor <[email protected]>
Co-authored-by: samremes <[email protected]>
Fix CI Black failures in qr_int4_kernel.py and test_flydsl_qr_int4.py. Co-authored-by: Cursor <[email protected]>
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
|
@zufayu @TennyWang1223 Thanks for the reviews. The new head is
1. The first launch is no longer inside graph capture (93ee607)
The fused all-reduce + RMSNorm has the same guarantee (52ffba5).
2. Ranks agree before they build any engine (785ac2d)Each rank first computes a plan locally: flydsl version, arch, link, world size, the policy after the
3. gfx950/xGMI (7da3ee6, plus data)Each ladder table now has a row only where the policy table enables that algorithm. An 4. PCIe (MI350P)8× MI350P (gfx950, PCIe) at
Logs: test_flydsl_one_shot_allreduce.log · test_flydsl_quick_allreduce_int4.log · 5. INT4 at decode sizes (Tenny 3)DeepSeek-V4-Pro, TP8 on 8× MI350P, GSM8K (all 1319 questions, 5-shot, greedy). The reference is stock Aiter DeepSeek-V4-Pro-Base has GSM8K score of 92.6 % (exact match, 8-shot) according to the Base Model table of the
|
…sed QR RMSNorm, gfx950/xGMI retune) Ported: - FAMILY_POLICIES gfx950/xGMI TP2 one-shot window 64 MiB -> 4 MiB. - MESH_ST_LADDER gfx950/xGMI retune (one b256 rung per TP). - Policy test import fix (strict CustomAllreduce is_weak_contiguous). - main: Gluon gfx1250 fused AR+RMSNorm hooks in communicator_cuda. Superseded by this branch's fused design, not ported: - QuickAllReduceInt4 fused RMSNorm (rmsnorm_hidden, compile_rmsnorm, runtime eps, MESH_NORM_LADDER): replaced by FlyQuickAllReduceRMSNorm, whose eps is already a launch argument, whose widths are prepared by FlyDSLAllReduceRMSNorm (hiddens / AITER_FLY_AR_FUSED_HIDDENS / prime), and whose ladders come from fused_allreduce_ladders.json. - #6404 12-atom tiles for hidden 6144: the row-block geometry builds 6144 natively (block 768) at TP2/4/8, and rows are addressed per row in i64. - quick_allreduce_int4.py kernel/host and its RMSNorm test: deleted here. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
@TennyWang1223 The CI is green and the PR is mergeable. As the primary reviewer, could you please confirm whether this is ready to merge? |
Conflict resolution only. Upstream #5461 moved the FlyDSL INT4 quick all-reduce kernel to kernels/comm/ and rewrote the host class, so this takes main's host file and accepts the deletion of kernels/quick_allreduce_int4.py. The reduce-scatter / all-gather modes are not on the tree after this commit (the new op test does not run here); the next commit ports them onto main's mesh kernel. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…odes onto the #5461 mesh kernel Re-apply the sequence-parallel modes of this PR on the kernel and host that #5461 rewrote (per-rank binaries, peers-only publish/wait, runtime n_blocks, inbox memory modes, engines keyed by (super_tile, block)) and on the E5M2 group scale of #7258. Kernel (kernels/comm/quick_allreduce_int4.py): make_quick_allreduce_int4_kernel takes mode="ar" | "rs" | "ag". "rs" and "ag" run one phase of the INT4 mesh on its own, for super_tile=1, the 8-atom tile and no fused norm. Rank d owns a contiguous block of N / world_size bytes; the tile machinery is unchanged and only the HBM address of an atom moves, through a full / shard layout local to the mesh kernel (_sp_payload_io) with the runtime n_blocks stride. Both modes send through the all-gather slots and start every round with a payload-free `ready` flag, since a single phase has no second-phase guard against inbox reuse. Unlike the all-reduce, which adds its own share from registers, "rs" quantizes this rank's own partial through the codec and accumulates every rank in rank order with the same dequant, so a row's value does not depend on which rank owns it. The JIT symbol gets an `_rs` / `_ag` suffix and the single-phase builds pin waves_per_eu to the plain kernel's residency. Host (quick_allreduce_int4.py): reduce_scatter(inp, out), all_gather(inp, out) and compile_sp(full, shard). They run on the super_tile=1 engine at the default block (shared inbox and colors) and raise for the ring, an inbox other than "uncached", or a ladder without that engine. There is no min_bytes floor. compile_sp now loads both builds with preload_launcher like preload: it checks the shapes, launches nothing and overwrites nothing, and takes no stream. A single-phase launch under CUDA graph capture raises unless its build is loaded. check_tensors is split out of check_payload (same behaviour and signature) for the pair check. README documents the modes. The op test imports from kernels.comm and builds its engine from a one-rung ladder instead of super_tile / grid_cap. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Rony Leppänen <[email protected]>
Resolve the conflict in custom_all_reduce.py by keeping both _fits_custom_ar_size (this branch) and _should_fly_oneshot (main, #5461). Port test_flydsl_allreduce_rank_agreement.py from the removed _resolve_car_max_size to _resolve_custom_sizes(...).ar. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged with c3a44c0 (the tip of the already squash-merged #5461 branch) as the merge base, so only the fused branch's own commits are compared against main. Resolutions: - Port #7258 (E5M2 group scale, RS_INT6_MIN_WORLD=4, SCALE_CODEC_TAG) into the renamed quick_allreduce{,_mesh,_ring}.py, test_flydsl_quick_allreduce.py and allreduce_policy.py. - Keep both test entries in .github/scripts/split_tests.sh. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ROCm/aiter#5461 replaced QuickAllReduceInt4.compile(inp, out) with preload(). AITER v0.1.28.post1 has it, and vLLM's INT4 QuickReduce init still calls compile(), so with VLLM_ROCM_USE_AITER=1 and VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4 every worker dies at start-up with AttributeError. Keep compile() when the class has it; otherwise call preload() and run one warm-up all-reduce, as compile() did. Adds a two-GPU test that builds the FlyDSL INT4 QuickReduce and runs a BF16 all-reduce on it. Signed-off-by: Sriram Kumar <[email protected]>
ROCm/aiter#5461 replaced QuickAllReduceInt4.compile(inp, out) with preload(). AITER v0.1.28.post1 has it, and vLLM's INT4 QuickReduce init still calls compile(), so with VLLM_ROCM_USE_AITER=1 and VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4 every worker dies at start-up with AttributeError. Keep compile() when the class has it; otherwise call preload() and run one warm-up all-reduce, as compile() did. Adds a two-GPU test that builds the FlyDSL INT4 QuickReduce and runs a BF16 all-reduce on it. Signed-off-by: Sriram Kumar <[email protected]>
ROCm/aiter#5461 replaced QuickAllReduceInt4.compile(inp, out) with preload(). AITER v0.1.28.post1 has it, and vLLM's INT4 QuickReduce init still calls compile(), so with VLLM_ROCM_USE_AITER=1 and VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4 every worker dies at start-up with AttributeError. Keep compile() when the class has it; otherwise call preload() and run one warm-up all-reduce, as compile() did. Adds a two-GPU test that builds the FlyDSL INT4 QuickReduce and runs a BF16 all-reduce on it. Signed-off-by: Sriram Kumar <[email protected]> Co-authored-by: Rony Leppänen <[email protected]>
* Land INT4 quad-fanout QR in aiter FlyDSL ops with a TP8 correctness test. * Use layout views for LDS pack and ST inbox without regressing ST=8 wall. Drop unused wave-join and single-wave fanout compiles; default and test the fp16 codec. * Stop QR INT4 tests and host from mutating COMPILE_ONLY. Compile-only and cache warming belong in developer scripts, not pytest or QRInt4QuadFanout.compile. Co-authored-by: Cursor <[email protected]> * Model local HBM payload as FlyDSL views; keep remote NT stores explicit. inttoptr + make_buffer_tensor (nbytes OOB) and BufferCopy128b tiled copies replace the tile/atom/tid arithmetic for local dwordx4 loads and stores. IPC/XGMI fanout stays global_store_dwordx4 nt. * New QR kernel/host/test files should use aiter MIT + AMD 2026 only; they were not FlyDSL-main originals. * Drop the quad_fanout variant suffix from the only INT4 QuickReduce pipeline so the public API is QRInt4. * Default QRInt4 to ST=8 and keep only ST∈{1,8} so the host matches the measured keeper; drop unused codec/force_super/bf16 ALU and qr_int4_mem, compiling via flyc.compile. Co-authored-by: Cursor <[email protected]> * Skip color 0 after wrap so it never matches the unset sentinel (HIP QR does the same), and time QRInt4 with run_perftest. * Compile QRInt4 WORLD∈{2,4,8} via HIP-style kRankAtoms so TP4/TP2 work; WORLD=8 stays kRankAtoms=1. Co-authored-by: Cursor <[email protected]> * IPC helper is a FlyDSL copy so keep Apache-2.0 copyright 2025; match aiter vendored dual header. Co-authored-by: Cursor <[email protected]> * Replace QR INT4 packed-math inline asm with native FlyDSL f16x2 ops. gfx942 already lowers vector<2xf16> to v_pk_max/min/mul/add/fma, so the llvm.inline_asm helpers and f32 absmax round-trip are unnecessary. * Spell out QR INT4 RS/AG and lower the flag wait as a Python while. The two-shot NT fanout and last-sector handshake are unchanged; gfx942 SQNR vs fp32 all-reduce still passes at TP 2/4/8. Co-authored-by: Cursor <[email protected]> * Reduce torch surface in qrint4 kernel * Join ST sub-tiles before LDS reuse and tighten QRInt4 host checks. TP2 ST=8 was packing the next tile into LDS while wave 0 still loaded the previous one. Also match aiter FlyDSL dtype/device checks and stop sorting IPC group ranks. Co-authored-by: Cursor <[email protected]> * Assert QRInt4 SQNR on every rank. Each rank already scored vs its local fp32 NCCL all-reduce. The parent kept rank 0 only, so a broken all-gather on a non-zero rank could pass. Co-authored-by: Cursor <[email protected]> * Apply suggestions from ruff Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Match black wrapping and apply small Copilot host/test guards. Fail SQNR on NaN or a zero-power reference with error. Drop the NCCL fallback for Gloo object gather. Reject a rank or world_size that does not match the process group. Co-authored-by: Cursor <[email protected]> * Enable gfx950 FlyDSL QRInt4 with configurable grid cap. Extend arch support to gfx950, parameterize inbox/launch grid_cap (default 1216 to match HIP QR), and tighten the canonical test bench with --grid-cap and optional JSON export. Co-authored-by: Cursor <[email protected]> * Run black on qr_int4_kernel.py after merging main. * Reject NCCL and multi-node groups in QRInt4 with explicit errors. IPC inbox setup needs CPU broadcast_object_list and node-local HIP IPC handles. Fail fast before allocating buffers, matching QuickAllReduce. * Shorten QRInt4 process-group rejection messages. Co-authored-by: Cursor <[email protected]> * Fix QR INT4 launch safety and validation Clamp persistent grids to conservative residency limits, harden resource cleanup, and validate lossy collective results across ranks. Co-authored-by: Cursor <[email protected]> * Address QR INT4 review feedback Co-authored-by: samremes <[email protected]> * Apply Black formatting after merging origin/main. Fix CI Black failures in qr_int4_kernel.py and test_flydsl_qr_int4.py. Co-authored-by: Cursor <[email protected]> * Fix QR INT4 E4M3 boundary encoding * Reject >32bit offset Co-authored-by: Copilot Autofix powered by AI <[email protected]> * Add automatic QRInt4 cleanup * Avoid QRInt4 AOT import cycle * Harden QRInt4 validation and test collection * Fix QR INT4 E4M3 reserved-zero underflow after exponent clamp. Reserve byte 0x00 for true +0 only after packing so clamped positive scales cannot collapse, and add TP2 fill cases for underflow, overflow, and zero. Co-authored-by: Cursor <[email protected]> * Drop duplicate QRInt4 lazy-import key after merging main. Co-authored-by: Cursor <[email protected]> * Spawn QRInt4 test ranks instead of re-entering the file with --rank. Match HIP QR: Pool + spawn, return row dicts, keep argparse on main() only. Drop PYTHONPATH/arch env overrides and out.zero_(); time spawn workers with cuda.Event. Co-authored-by: Cursor <[email protected]> * Make QRInt4 test comments self-contained. State what each threshold, fill, and CLI flag does today, and record why the spawn ranks must time with cuda events instead of the profiler timer. Co-authored-by: Cursor <[email protected]> * Resolve the QRInt4 device index before set_device. torch.cuda.set_device rejects torch.device("cuda") without an index, so the current-device fallback in _cuda_index was unreachable. Resolve the index first, select that integer, and keep self.device as the resolved cuda:N. Co-authored-by: Cursor <[email protected]> * Rename FlyDSL QR INT4 to QuickAllReduceInt4 and drop leftover globals/asm. Move host and IPC out of kernels/, export QuickAllReduceInt4 only, and keep module constants that actually couple host tile math, LDS, and codec layout. Use fx.min, llvm.StoreOp(nontemporal=True) for NT fanout, llvm.amdgcn.s.setreg for FP16_OVFL, and inline readfirstlane at the inbox descriptor. Leave buffer_inv sc1 as inline asm: the flag poll is a non-atomic sc1 buffer_load (L2 bypass, not L1), so the miss path still needs an L1 invalidate, and llvm.amdgcn.buffer.wbinvl1.sc cannot select on gfx942/gfx950. * Format QuickAllReduceInt4 host and tests with ruff and black. * Move FlyDSL QR INT4 tests to multigpu_tests and fix HIP alloc rounding. Collect the suite with the 8-GPU job instead of single-GPU op_tests. Round uncached HIP mallocs to 4 KiB so small grid_cap inboxes still export, and feed MODE setreg through as_ir_value instead of fx.arith. * [FlyDSL] Extract quick-allreduce transport and codec into shared modules The ring and one-shot schedules that follow need the same tile geometry, inbox cache policy, peer store/load primitives and wire codec that the mesh kernel had inlined. Split them out so all three agree byte for byte rather than carrying three copies of the same magic numbers: quick_allreduce_shared geometry, _INBOX_POLICY, peer store/load, LDS quick_allreduce_codec INT4/INT6/FP16 wire formats and the E4M3 scale The mesh kernel becomes codec- and inbox-policy-generic as a result, and is renamed to match its new module. Two behavioural changes ride along. Fix the buffer cache-modifier encoding. These are LLVM CPol bits, which the backend renames for CDNA: bit 0 (GLC) prints as `sc0`, bit 1 (SLC) as `nt`, bit 4 (SCC) as `sc1`; bit 2 exists in the encoding but CDNA has no use for it and it emits nothing. The previous values were 4 for "NT" and 2 for "sc1", so the payload load carried no cache hint at all and the flag spin load got `nt` instead of bypassing L2 -- a spin that can be answered from a stale line. They are now 2 and `sc0 | sc1`. Make the flag spin load bypass L1 as well. `sc1` alone only bypasses L2; `sc0 sc1` is what LLVM emits for a system-scope load and is what lets the retry loop run without a fence in its body. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add inbox memory modes, codec selection and an ST ladder to the host The uncached IPC inbox the host has always allocated is right on xGMI and catastrophic on PCIe: peer writes into uncached memory serialize per destination, so throughput collapses as the fanout widens (MI350P, INT4 mesh: 55 GB/s to one peer, 4.45 to two, 1.44 to three, against 33.5 fine-grained). Give the host an `inbox_memory` knob over the kernel's existing cache-policy table, defaulting to "auto", which reads the real per-peer link type out of KFD rather than guessing from the arch string -- MI350X and MI350P both report gfx950 and want opposite answers. With a cacheable inbox a publish costs an L2 writeback, so the super-tile that was a fixed constructor argument becomes a payload-size ladder: `_pick_st` selects a rung, `_grid_x` hands each block a whole super-tile so the batching is real, and `_MIN_BATCH_BLOCKS` stops it trading the whole machine away at small sizes (MI350P, 32x7168, TP4: 61.95 us unbounded against 23.98 with the grid left alone). Also adds `rs_codec`/`ag_codec` with an AITER_ALL_REDUCE_CODEC override, `min_bytes` gating with `is_beneficial`, `variant()` for reporting which binary a size actually runs, and `has_xgmi_peer_links` for the dispatcher. The IPC heap grows a device check on every allocation. Several byte-identical copies of libamdhip64 are typically mapped into one process and they do not share device state, so the first one resolved by soname can allocate on the wrong GPU -- every peer write then crosses to the wrong device. Pick the mapped copy that reports torch's bound device, and assert the allocation landed where it was meant to. The page rounding hipIpcGetMemHandle needs moves from alloc_uncached to alloc, which is where the inbox is now allocated from. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add the ring schedule for quick-allreduce The mesh writes to every one of the N-1 peers on both laps. On a PCIe host a GPU has one shared x16 uplink, so those interleaved destinations contend for it; the ring instead makes every step a single contiguous run into exactly one peer's inbox. Same wire volume -- 2(N-1)/N of the payload, which is bandwidth optimal (Patarasuk & Yuan, JPDC 69(2), 2009) -- traded for per-destination locality, over 2(N-1) hops instead of two. The ring pays for that in accuracy: its reduce-scatter lap requantizes the running partial N-1 times where the mesh requantizes once, and the partial's extremum grows with the contributions folded in. Hence the per-lap codec knobs -- the reduce-scatter lap widens to INT6 at TP8 to hold the 18 dB SQNR floor, while the all-gather lap forwards received bytes untouched and stays INT4. Registered as algorithm="ring" alongside the mesh, with its own super-tile set (1, 8, 16, 32) and payload-size ladder. It is not the default and is structurally worse at decode sizes and on xGMI; the dispatcher that follows picks between them. clamp_grid_cap now falls back to the smallest measurement for a world size when a super-tile is not in the residency table, instead of raising: the table was measured on the mesh and does not cover ST=16 or ST=32. Under-launching a persistent kernel is always safe, so the fallback errs small; an unknown arch or world size still raises. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add the exact one-shot all-reduce and the schedule policy table Both quantized schedules are two-shot, so their latency floor is two serialized fabric traversals plus a grid-wide handshake between the laps. At decode sizes that floor dominates and the quantization buys nothing -- the collective is not the bottleneck there, and INT4 charges ~36 dB of SQNR for microseconds. OneShotAllReduce is the decode-regime answer: one round, no grid-wide barrier, bf16 in, fp32 accumulate, bf16 out, no codec. Each rank pushes its whole tile into every peer's inbox, publishes a colour flag, waits for N flags, then reduces N copies out of its own inbox. That trades wire volume for round trips -- (N-1)*S pushed against a two-shot's 2(N-1)/N*S -- so where it stops paying is a function of N, which is what max_bytes gates on. It needs no LDS: thread t's 16 B lands at the same offset in every destination, so it pushes straight from registers. It reuses the IPC inbox, peer table and cache-policy table from the quantized schedules verbatim, which is what the shared transport module was extracted for. allreduce_policy holds the size boundaries between the three families, per (link, world_size), fitted from measurement. It is a pure table plus env overrides -- no kernels, no torch -- so the dispatcher and the hosts can both read it without an import cycle. Accuracy defaults to "exact", which makes the quantized families unreachable until a caller opts in with AITER_FLY_AR_ACCURACY=fast. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Dispatch the FlyDSL all-reduce family from CudaCommunicator FlyDSLAllReduce owns one engine per reachable schedule and routes a payload to the family allreduce_policy picks for its size, link type and world size. CudaCommunicator consults it ahead of quick-reduce and custom all-reduce. It leads the chain because, at the default AITER_FLY_AR_ACCURACY=exact, the only reachable family is the exact one-shot -- fp32 accumulate, one bf16 rounding, comparable with cross_device_reduce rather than quantized -- and it declines every payload above that ceiling, so the caller falls through unchanged. AITER_FLY_AR_ACCURACY=fast unlocks the quantized mesh/ring for larger payloads. The whole path is opt-in: with AITER_FLY_AR unset the dispatcher disables itself in its constructor and the chain is exactly as before. Every unsupported condition -- no flydsl, wrong arch, NCCL group, multi-node group, unsupported world size -- is an early return that leaves `disabled` set, and should_fly_all_reduce is a pure predicate that answers False rather than raising. A communicator built with reuse_from borrows the engine rather than owning it, so destroy() only closes the IPC inboxes on the group that built them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add codec, policy and one-shot all-reduce tests test_flydsl_allreduce_policy is CPU-only: it checks that the family boundaries partition by size, that the ladders are ascending and reach every super-tile they name, and that the env overrides apply where the tables say they do. test_flydsl_quick_allreduce_codec runs on a single GPU with no IPC, so it covers the wire formats in isolation from the transport: INT4/INT6/FP16 round-trips, the E4M3 scale at both ends of its range, and the codec resolution rules. Two of its cases move with the E4M3 fixes rather than against them. They were written against an encoder that saturated the exponent field alone, so 512 encoded as 256 and an outlier decoded *smaller* than the ceiling it passed; and against one where a positive extremum small enough to encode as 0x00 collided with the reserved-zero byte and took its whole group to zero at 1e-3. Both now assert the fixed behaviour -- monotonic saturation past the ceiling, and a sub-floor extremum that rounds coarsely instead of vanishing -- plus that exact zero still encodes as exact zero. test_flydsl_one_shot_allreduce spawns real ranks and checks the one-shot is bit-identical to a torch all-reduce, not merely close, at TP2/4/8. It lives in multigpu_tests because it needs more than one GPU. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Cover both schedules and the transport in the INT4 all-reduce test The test gated only on SQNR, which cannot tell a transport bug from a codec one: a chunk-addressing or flag-protocol fault and a codec regression both show up as a worse number. Run the same cases over the fp16 passthrough wire format, where the whole reduce is lossless on an exact-grid input, and gate those on bit-identity with the fp32 reference instead. A ring variant with one lap fp16 and the other int4 names which lap is responsible when only one of them is. Every case now runs on both the mesh and the ring. The ring's reduce-scatter lap requantizes N-1 times where the mesh requantizes once, so its SQNR falls with N -- 22.2 dB at TP2, 18.7 at TP4, ~15 at TP8 all-INT4. Defaulting that lap to INT6 at TP8 lifts it to ~21 dB, so one 18 dB floor now covers both schedules; the all-INT4 TP8 configuration is still reachable through AITER_ALL_REDUCE_CODEC and keeps its own case at the floor it actually delivers. Cases that share a (world_size, algorithm, super_tile) group now ride a single spawn and are memoized for the session. _run_rank already looped over a list of shapes; this just stops calling it with one-element lists, which is most of the wall time back on a file that is now 46 cases. Adds a degenerate-input case (all-zero and far-sub-floor groups) that pins the encode-reciprocal clamp: a zero extremum decodes to a zero scale, and before the clamp that reached the codec as Inf and 0 * Inf poisoned the whole tile. INT6 has four times less headroom there than INT4, so it is the schedule that needs it. The predicted super-tile now compares against the engine's clamped ST=1 grid rather than the requested grid_cap, which is what the host's own selection compares against. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add the all-reduce benchmark, roofline and policy-fitting scripts bench_comm_allreduce sweeps every all-reduce candidate available on the host -- RCCL, custom all-reduce, HIP quick-reduce, and the three FlyDSL schedules -- over a shape list, on one process group, and reports latency, achieved bandwidth and SQNR per candidate. Candidates that cannot run a given shape are reported as declined rather than silently skipped, so a sweep says which alternatives a winner actually beat. transferbench_roofline turns a TransferBench point-to-point measurement into a per-schedule lower bound: each family's wire volume as a function of payload and world size, divided by the measured fabric rate. That is what separates "this kernel is slow" from "this kernel is at the wire". fit_allreduce_policy consumes a sweep and emits the family boundaries in allreduce_policy's format, so the tables there are reproducible from measurement rather than hand-maintained. The shapes/ CSVs are the sweep lists the current policy tables were fitted from: a small and a large payload sweep, and one that holds the payload fixed while varying hidden to separate size effects from shape effects. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Improve benchmarking script to run in fast mode by default. * Fixed heuristics for the exact mode. * Fix bugs in the benchmarking script. * Update heuristics for xGMI interconnect. * Fix classification of FlyDSL auto-deducted kernel in benchmarking script. * Remove unintended Git modules. * Add two new tuning knobs: workgroup size and ability to read ranks own contribution from registers instead of IPC inbox (self-skip). * Update PCIe heuristics. * Refactor FlyDSL all-rduce kernels integration to comms dispatcher. * [FlyDSL] Scope OneShotAllReduce to its device instead of set_device Mirrors what #4970 did for QuickAllReduceInt4: construction, launch and close run under torch.cuda.device(), so building the engine no longer changes the caller's current device. Co-Authored-By: Claude <[email protected]> * [FlyDSL] Address agent review feedback on the all-reduce dispatch - Add a GPU-free regression test for the P1 finding: both FlyDSL selectors must decline a weakly- but not strictly-contiguous tensor (a full-storage transpose) instead of letting the engine raise after dispatch committed. - Document the host-wide xGMI detection and the uniform-node assumption it relies on (P3). - Drop a stray argument from the quick-reduce FlyDSL init log call; it had one more argument than placeholders. - Re-run black (trailing whitespace, assert formatting back to main's) and suppress SIM102 on a const_expr guard, matching the other FlyDSL kernels. Co-Authored-By: Claude <[email protected]> * [FlyDSL] Move all-reduce tooling out of the multi-GPU test directory The multi-GPU CI job runs every .py under op_tests/multigpu_tests/ as a script, so tooling there ran as tests: fit_allreduce_policy.py failed on its required argument and bench_comm_allreduce.py ran a full sweep. - Remove fit_allreduce_policy.py and the sweep shape CSVs it was fed. - Move bench_comm_allreduce.py and transferbench_roofline.py to op_tests/op_benchmarks/flydsl/, which CI does not execute, and update their usage text. --shape-csv stays as a user option. Co-Authored-By: Claude <[email protected]> * Remove fragile tests. Refactor multi-GPU tests for all-reduce to follow Aiter testing guidelines. Add the full kernel information to human readable kernel name. * Black and ruff fixes. Improve comments about the use of CUDA events in the FluyDSL all-reduce tests. * Add self-skip and block tunign knobs to two-steage mesh all-reduce. * Use fx.generic_load, fx.generic_store, and fx.memory_fence to replace the inline ASM. * Use system scope memory fence for releasing inboxes. * Use uncached memory on PCIe when world size is two. * Update aiter/ops/flydsl/kernels/quick_allreduce_int4.py Address GitHub bot feedback. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove probe from 1-stage kernel. * Remove the legacy buffer_ops.buffer_load and buffer_ops.buffer_store. Extract shared layout definition. Clen-up code. * Ensure communicator initialization only compiles the relevant all-reduce instances. * Trim the test suite for one-shot and quick all-reduce kernels. * Collect shared all-reduce host wrapper assets to a shared module. * Heuristics for xGMI interconnect. * Update PCIe heuristics after the latest run. * Add more cases to the benchmarking script. * Addres black and ruff findings. * Remove the custom logic for loading the HIP runtime library. * Optimize memory fences for PCIe TP=2 case when uncached IPC memory is used. * Fix a wrap-around bug in one-shot all-reduce. * Improve benchmarking script such that it doesn't have bias towards FlyDSL instances. * Optimized syncscope for xGMI interconnect. * Update PCIe heuristics for TP=2 and for TP=4. * Update xGMI heuristics. Introduce an env variable to override the min message size for FlyDSL one-stage all-reduce. * Use _preload_compiled from TensorShim to run JIT compilation outside HIP graph capture. * Black and ruff fixes. * Add a Lamport (flagless) variant of the FlyDSL one-shot all-reduce. The payload is its own flag: inbox slots hold a sentinel (bf16 NaN 0xFFFF in every half-word) until a peer's data lands, the receiver polls all of its sources together until no half-word is the sentinel, then re-arms the slot two rounds ahead in a 3-buffer rotation. Senders rewrite a sentinel half-word in their own payload to 0x7FFF, which is still NaN. That removes the vmcnt(0) drain, both barriers and the flag round trip from every tile. - kernel: `lamport` const_expr in make_one_shot_allreduce_kernel; uncached inbox only. The poll re-reads through relaxed system-scope atomics (_poll_v4i32) so the spin cannot be deleted. The first tile is peeled so its input load overlaps the colour load. - IPC: UncachedIpcHeap.alloc takes a fill byte and synchronizes after the memset, so a late fill cannot erase a peer's first push. - host: `lamport` is the 7th ONESHOT_LADDER field and an OneShotAllReduce knob; AITER_FLY_AR_ONESHOT_LAMPORT=0|1 pins it from the environment. Every shipped rung keeps lamport=False in this commit. - tests: --lamport knob, Lamport spot configs at TP2/TP8, and a 300-call fresh-input stress checked bit for bit against a rank-order reference. - bench: fly_1stage_lp and _lp variants of the pinned fly1s grid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Ship the Lamport one-shot on xGMI and drop the one-shot floors there. Sweep on 8x MI325X (gfx942), graph timing. Best Lamport config vs the flag one-shot: TP2 -3..-23%, TP4 -3..-14%, TP8 -19..-41%. It ties or beats cross_device_reduce down to 2 KiB at every world size, so the xGMI min_bytes floors (56/48/112 KiB) go to 0. ONESHOT_LADDER xGMI, all skip_self + lamport, atoms=1, cap 128: TP2 b128 to 256 KiB (one round), then b256 TP4 b256 TP8 b128 PCIe rungs stay on the flag variant (not measured). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Make Lamport all-reduce the default and add heuristics. * Make self-skip default on one-shot and two-shot mesh algorithms. Redeuce the number of benchmarked configurations. * Remove redundant/obsolete instances from benchmarking. * Transferbench roofline fixes. * Clean-up TransferBench runner script. * Benchmarking script fixes. * Move FlyDSL communication kernels into a single directory. * Black & ruff fixes. * Address first part of the code review feedback. * Remove separate benchmarking scripts. * Expand test scripts to run the benchmarking. * Add gfx950/xGMI all-reduce policy rows; never pick the ring there. The FlyDSL family policy was measured on gfx942 for xGMI. On gfx950/xGMI (MI355X) the bench scenario of the all-reduce op tests shows: * The ring never beats the mesh: 1.03x-1.16x slower at TP2 up to 512 MiB, 2.2x-5.7x slower at TP4/TP8. The 128 MiB mesh_max sent large payloads to it; mesh_max is now unbounded there. * cross_device_reduce's 2-stage kernel beats both the one-shot and the mesh over a wide middle range at TP4/TP8, so the one-shot ceiling drops to cdr's 2-stage switch and the mesh floor rises to where the mesh overtakes cdr (960 KiB at TP4, 1600 KiB at TP8). At TP2 the one-shot beats cdr up to 3 MiB and the mesh up to 448 KiB. Rows measured on one arch live in ARCH_FAMILY_POLICY, keyed by (arch, link, world_size), and replace the FAMILY_POLICY row on that arch only; gfx942 keeps its rows. The resolvers and max_payload_bytes take an optional arch, defaulting to this host's. End to end through CudaCommunicator.all_reduce under graph capture (INT4 regime), against the old rows: never slower (within noise), 1.17x-1.54x at TP4/TP8 mid-range, 2.47x (TP4) and 5.44x (TP8) at 256 MiB. Against stock production with FlyDSL off: >= 0.99x at every size. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Make the all-reduce tuning ladders and policy records dataclasses. Review feedback on #5461: ladder rungs were bare tuples, so every reader had to know the field order. * OneShotRung (min_bytes, atoms, grid_cap, fanout, block) and TwoShotRung (min_bytes, super_tile, grid_cap, block) replace the tuples of ONESHOT_LADDER, MESH_ST_LADDER and RING_ST_LADDER, and pick_rung() is the one implementation of "last rung at or below the payload" for both hosts. * The records live in kernels/comm/allreduce_shared.py next to the rungs: FamilyPolicy, OneShotPolicy and QuantPolicy move there from allreduce_policy, with NO_MAX. allreduce_policy re-exports them. * The mesh ladder comment described an older table; it now matches the rungs. * OneShotAllReduce dropped a grid_cap ceiling branch that could not run: any grid_cap pins the configuration. No behaviour change. Verified with the policy unit tests and both multi-GPU verify scenarios on gfx950 (TP2/4/8). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Make the all-reduce heuristics readable from one module. allreduce_policy.py now holds every tuned decision, in two levels, with a module docstring that draws the payload axis: * Level 1, which kernel: FamilyPolicy fields are renamed to say what they bound, in payload order -- oneshot_min, oneshot_max (was oneshot_max_exact), quant_min (was oneshot_max, which was not a one-shot maximum but the mesh floor), mesh_max, quant_max (was max_bytes). route() composes the two slots in CudaCommunicator.all_reduce order and returns oneshot / mesh / ring / fallback; the policy unit tests and the INT4 bench use it instead of private copies. The bench's copy reported "oneshot" for payloads that go to cross_device_reduce. * Level 2, which configuration: ONESHOT_LADDER, MESH_ST_LADDER and RING_ST_LADDER move here from the kernel modules, which never used them. No behaviour change: the rows keep their values under the new names. The environment overrides keep their meaning. Verified with the policy unit tests (plus a route() test for the gfx950/xGMI rows) and both multi-GPU verify scenarios on gfx950. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Collect the all-reduce limits and shared constants in one place. Review feedback on #5461: limits were restated across modules, and the ring had a payload floor of its own that mirrored the policy by hand. * kernels/comm/allreduce_shared.py has a "Limits" section: SUPPORTED_ARCHS, SUPPORTED_WORLDS, LINKS, SUPPORTED_BLOCKS, PAYLOAD_ALIGN_BYTES, MAX_PAYLOAD_BYTES, QUANT_MIN_PAYLOAD_BYTES and NO_MAX. The policy, the hosts, the codec, the one-shot kernel, CustomAllreduce, QuickAllReduce and the op tests import them instead of keeping their own copies (three SUPPORTED_ARCHS, two SUPPORTED_BLOCKS, two SUPPORTED_WORLDS, and the "pcie"/"xgmi" literals). * The ring's standalone floor (_RING_MIN_PAYLOAD_BYTES_BY_WORLD, 4-12 MiB) is gone. It claimed to mirror mesh_max but matched no policy row, and production never used it (dispatch passes min_bytes=0). Both schedules now refuse the same thing on their own: payloads under QUANT_MIN_PAYLOAD_BYTES, the accuracy guard. * The tuned constants MIN_BATCH_BLOCKS and RS_INT6_MIN_WORLD move to allreduce_policy with the rest of the tuning. * The hosts' identical payload checks, link resolution, arch check and group checks become shared helpers: check_payload, resolve_link, require_arch, check_world_size and _validate_ipc_process_group. Verified with the policy unit tests, both multi-GPU verify scenarios and bench smoke runs on gfx950. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Code clean-up after refactoring the family policy and rungs for tuning ladders. * Refactor FamilyPolicy to use explicit windows per algorithm. Clean-up the host wrappers to simply how the rungs of tuning ladders are used. * Run only the production configs by default in the all-reduce tests. * Clean-up comments and doc strings in ring all-reduce kernel. * Ensure ring all-reduce gives bit.identical output for every rank. Add tests that execute production all-reduce dispatch. Fixed one-shot all-reduce window handling for th exact mode. Add an env variable to specify the interconnect type. Fix other small review findings. * Rename factory for quick reduce ring kernel. * Fix black issues, improve tests, and fix exact one-shot all-reduce window. * Simplify handling of the one-shot all-reduce window. * Rename all-reduce host side assets to have host prefix in the filename. * Fix black and ruff. * Small re-tune for PCIe. * Add op_tests/multigpu_tests/flydsl_allreduce_bench.py on the test skip list since it contains no actual tests, only infrastructure. * Address co-pilot review feedback. * [FlyDSL] Rename the quick all-reduce assets to allow more codecs. Mechanical rename, no behaviour change. The mesh and ring schedules carry INT4, INT6 and FP16 wire formats, so the names stop saying INT4: * kernels/comm/quick_allreduce_int4.py -> quick_allreduce_mesh.py * kernels/comm/quick_allreduce_int4_ring.py -> quick_allreduce_ring.py * quick_allreduce_int4.py -> quick_allreduce.py * quick_allreduce_int4_ipc.py -> quick_allreduce_ipc.py * test_flydsl_quick_allreduce_int4.py -> test_flydsl_quick_allreduce.py * QuickAllReduceInt4 -> FlyQuickAllReduce, make_quick_allreduce_int4_kernel -> make_quick_allreduce_mesh_kernel The identifiers match PR #5555 so the two branches rename identically. mega_moe_tp imports the IPC helper under its new name. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * [FlyDSL] Fused all-reduce + residual add + RMSNorm kernels. One-shot, mesh and ring kernels gain a ``fusion="rmsnorm"`` build that runs residual-add + RMSNorm as the epilogue of the all-reduce, with the tile sized to one token row (``block = hidden / (8 * atoms)``) so the norm reduces within a workgroup: * ``kernels/comm/quick_allreduce_fusions.py``: the shared epilogue and the row-to-workgroup geometry, the padded geometry for widths with no native one (per-row bounded buffer descriptors mask the pad lanes), and the HBM exchange word that joins a row split over ``split`` workgroups. * One-shot: split rows, padded widths and the self-skip; the plain launch passes the (unused) fused operands of the shared kernel signature. * Mesh and ring: the epilogue per tile (mesh) or per chunk inside the ring pipeline. The ring's owner hands the epilogue the decoded packet, as the plain path does, so every rank ends with the same bits. * ``validate_block`` accepts any 128-thread multiple up to 1024 besides the plain menu (``BLOCK_ALIGN``/``MAX_BLOCK`` in ``allreduce_shared``). Host classes ``OneShotAllReduceRMSNorm`` and ``FlyQuickAllReduceRMSNorm`` build one engine per (hidden, rung) lazily or up front (``hiddens=``). Policy, in the idiom of the plain one (``allreduce_policy``): ``FUSED_FAMILY_POLICIES`` of ``FamilyPolicy`` per (arch, link, world_size), ``FUSED_ONESHOT_LADDER`` of ``FusedOneShotRung``, ``FUSED_{MESH,RING}_ST_LADDER`` of ``FusedTwoShotRung`` and ``FUSED_QR_ROW_ATOMS``. ``AITER_FLY_AR_ACCURACY`` (default ``exact``) picks the quantized or the exact windows; overrides are ``AITER_FLY_AR_FUSED_<ALG>_{MIN,MAX}_BYTES``. Window maxima are exclusive now, as in the plain policy. gfx950/xGMI reuses the gfx942/xGMI tables until tuned. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * [FlyDSL] Dispatch the fused all-reduce + RMSNorm in production. ``FlyDSLAllReduceRMSNorm`` lives in ``QuickAllReduce`` and owns one engine per family the fused policy enables in the current ``AITER_FLY_AR_ACCURACY`` mode. ``CudaCommunicator.fused_allreduce_rmsnorm`` asks it first; a payload outside every window, or a width no family can build, falls through to aiter's own fused kernels. Widths are built before capture (``AITER_FLY_AR_FUSED_HIDDENS``, ``hiddens=``, ``prime()`` or a warmup call); inside a capture an unbuilt width declines rather than building. ``preload_fly_engines`` passes the hidden dim to the fused engines' ``preload``. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * [FlyDSL] Tests for the fused all-reduce + RMSNorm. * Policy unit tests for the fused tables: coverage of every platform, monotone dispatch, exact mode is one-shot only, ladder well-formedness, ``FUSED_QR_ROW_ATOMS``, overrides separate from the plain ones, accuracy mode and ``AITER_FLY_AR_FUSED_HIDDENS``. * Codec tests at the row-sized blocks the fused builds use. * ``--operation ar|ar_rmsnorm`` in both multi-GPU tests; verify runs both unless one is named. * One-shot: SQNR on ``out`` and bit-exact ``residual_out`` at native and padded widths, pinned atoms/block, split rows (repeat, magnitude, slice lag), run-ahead and fresh inputs, and GPU-free geometry checks. Its ranks are subprocesses of the script (``--rank``); a user run's arguments are no longer parsed by the worker parser. * Mesh/ring: SQNR, bit-exact residual on the lossless wire (native, padded and pinned super-tile), padded widths on INT4, mesh rank agreement and host-side geometry checks. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * [FlyDSL] Bench the fused all-reduce + RMSNorm, and pinned candidates. The bench scenario of both multi-GPU tests takes ``--operation``: * ``ar`` (default): the plain all-reduce, as before. * ``ar_rmsnorm``: the fused kernels. The one-shot test times ``OneShotAllReduceRMSNorm`` against ``CustomAllreduce``'s fused kernel at both stage counts and against ``cdr``/``rccl`` + ``rmsnorm2d_fwd_with_add``, and reports ``prod`` (``CudaCommunicator.fused_allreduce_rmsnorm`` with FlyDSL off) and the fused policy's ``route``. The quick test times each ``FlyQuickAllReduceRMSNorm`` schedule against the HIP quick all-reduce's fused kernel and against the HIP quick all-reduce + norm. ``--candidates PATH`` reads pinned FlyDSL configurations from a candidate file (``flydsl_allreduce_bench.load_candidates``: name, operation, algorithm, one column per knob, sets) and times each as one more column of the same spawn, so the stock kernels are timed once and the rotation covers every candidate; ``--candidate-set`` selects rows by tag. This is what the tuning suite drives in place of the removed standalone benchmark. ``graded_replay`` grades several outputs, and ``fused_reference`` is the shared fp32 reference of the fused operation. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * [FlyDSL] Test a policy whose one-shot window is unbounded. A one-shot that wins at every size, in both modes, is the answer a fit gives on some platforms. Check that FamilyPolicy accepts it and selects the one-shot at any payload. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * [FlyDSL] Tune the all-reduce tables from the tests' bench scenario. The tuning suite moves to op_tests/multigpu_tests/flydsl_allreduce_tuning and drives the bench scenario of the two multi-GPU tests instead of the removed standalone benchmark: * candidates.csv (generated by gen_candidates.py, checked by ``--check``) lists the pinned configurations the sweeps time, in sets: ``sweep``, ``validate``, ``fused``, ``fused_qr`` and ``smoke``. The fused grids are generated from the kernels' row geometries. * bench_io.py reads the tests' ``--csv`` output into the fits' columns, and names the shipping engines and the stock kernels under fixed keys. * fit_allreduce_policy.py joins the one-shot and mesh/ring CSVs of a shape, reconstructs the shipped dispatcher (``fly_auto``) from the policy in the ``--accuracy`` mode, and prints ``FamilyPolicy`` rows of ``Window``s and ``OneShotRung``/``TwoShotRung`` ladders keyed by (arch, link, world_size), checked by building them. Thresholds are half-open, as ``Window`` and ``select_rung`` are. * fused/fit_fused.py and fused/analyze_fused.py do the same for the fused tables (``FUSED_FAMILY_POLICIES``, ``FusedOneShotRung``, ``FusedTwoShotRung``, ``FUSED_QR_ROW_ATOMS``). * tune.sh keeps its commands. ``check`` also parses a pinned flydsl version that carries an environment marker. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Docstring updates. * Remove unnecessary AITER_FLY_AR_ACCURACY env variable. Split all-reduce + RMSNorm fusion between QuickReduce and CustomAllReduce dispatchers. Update FlyDSL comm kernels Readme. * Remove tuning scripts and files from source control. * Consolidate all-reduce limits and move tunning ladder rungs and policies from kernel files to the shared host assets. Remove unnecessary default definitions. * Black & ruff fixes. * WIP: Refactor fused all-reduce into a separate epilogue. * Improve benchmarking scripts. * Compile all rungs within a window on the first call of a given width. Remove pytest from the fused all-reduce tests. Make row splitting an opt-in feature and fix the handing of NaN and Inf values. Document row splitting limitations in Readme. * Add FlyDSL all-reduce pytests to CI run. * Add a common check for the fused aliasing. Remove double routing for fused all-reduce dispatching. Ensure tests run the production geometry. * Ensure all ranks resolve the same policies. * Small clean-up. * Make tuning ladders per hidden dim. Read the ladder from a JSON configuration file. * Increase timeout in benchmarking script because of JIT compilation. * Fix quick reduce benchmarking sweep. * Increase timeout for the quick reduce benchmark due to JIT compilation. * Update FamilyPolicies and tuning ladders after tunign sweep. * Remove dead code. * Fix black & ruff. * Ruff fix. * Document and tidy the fused QuickReduce RMSNorm Gemma/MXFP4 support README, epilogue docs and test comments now describe the runtime Gemma operand and the MXFP4 epilogue variant. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * Port the #6369 low-latency fused-norm build to the mesh epilogue design The mesh RMSNorm epilogue gains a latency option with a prefetch hook that loads the residual ahead of the exchanges. A ladder rung may select it (optional latency field, default false), and the host builds it as separate engines with two resident workgroups per CU. It is correct but slower than the default build on gfx950 TP8 hidden 2048, so no shipped rung uses it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * Restrict the low-latency fused build to xGMI ladders #6369's low-latency build targeted gfx950 over xGMI; over PCIe it measured slower than the default build, so the ladder loader rejects a latency rung on any other link. No shipped rung uses it. Also add --bench-only and a grid cap override to the fused QuickReduce test, for measuring it on an xGMI box. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * Rename latency to low_latency for fused all-reduce. * Add a separate facade for FlyQuickAllReduce. * Enable benchmarking the low-latency fused all-reduce. * Consolidate the fused all-reduce tests. * Black and ruff fixes. * Move tuning ladder JSON config under configs/comm directory. * Readme update. * Fix GPU detection in the benchmarking scripts. * Relax requirement that row must fit in one rank's chunk for mesh all-reduce. * List candidates in test/benchmarking scripts. Add option to benchmark only direct Aiter competitors for tuning. * Fix building low-latency assets. * Update FamilyPolicy and tunning ladders for gfx950/xGMI combination. * Ensure tests cover the shipped instances. Remove tests for non-shipped instances. * Update tuning ladders for gfx950/xGMI after tuning sweep. * Fix black and ruff. * Update tuning ladders and policy after re-tunign sweep for gfx950/PCIe. * Ensure all ranks agree on which FlyDSL all-reduce needs to be built. Add CPU test to verify the rank agreement logic and append to GPU tests to have a case where one rank has FlyDSL all-reduce disabled. * Load all-reduce kernels onto device at initialization. This ensures that possible HIP graph capture doesn't include module loads. Add tests where first call takes place inside a graph capture (no wram-up). * Remove ring ladders that are not shipped. * Fix black & ruff. * Test fix after merge. * Fix performance regression for fused all-reduce + RMSNorm. * allow fused all-reduce + RMSNorm inside the HIP graph capture. * Update TP=2 ring algorithm window policy for gfx950/xGMI. * Fix failing policy test. * Add a check that build and launch are outside HIP graph capture. * Cache the check for hidden dim support. Add tunning ladders for new hidden dims. * Rename shared IPC assets. * Fix use sites of ipc?heap. Add compatibility layer. * Ensure FlyDSL fused path declines if one rank fails to build for a given hidden dim. Update Readme. Add tests. * Address Copilot code review findings. * Fix black and ruff. * Fix Aiter bot findings. * Black and ruff fixes. * Fix black. * Add tests for zero bytes messages. Fix handling of zero bytes messages in one-shot all-reduce and quick-allreduce. * Create alias class QuickAllReduceInt4 for vLLM. * Add test test_flydsl_allreduce_rank_agreement.py to CI run. * Add a test that checks the limits for row splitting in the one-shot fused all-reduce. Document limits in the Readme. * Fix black and ruff. * Fix min bytes for the vLLM alias. * Fix quick-allreduce test execution for gfx942. * Fix tests for all-reduce ring algorithm on PCIe. * Update comment strings and Readme after FlyDSL 0.5.0 changes. --------- Co-authored-by: Sami Remes <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: samremes <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…e interconnects (ROCm#5461) * Land INT4 quad-fanout QR in aiter FlyDSL ops with a TP8 correctness test. * Use layout views for LDS pack and ST inbox without regressing ST=8 wall. Drop unused wave-join and single-wave fanout compiles; default and test the fp16 codec. * Stop QR INT4 tests and host from mutating COMPILE_ONLY. Compile-only and cache warming belong in developer scripts, not pytest or QRInt4QuadFanout.compile. Co-authored-by: Cursor <[email protected]> * Model local HBM payload as FlyDSL views; keep remote NT stores explicit. inttoptr + make_buffer_tensor (nbytes OOB) and BufferCopy128b tiled copies replace the tile/atom/tid arithmetic for local dwordx4 loads and stores. IPC/XGMI fanout stays global_store_dwordx4 nt. * New QR kernel/host/test files should use aiter MIT + AMD 2026 only; they were not FlyDSL-main originals. * Drop the quad_fanout variant suffix from the only INT4 QuickReduce pipeline so the public API is QRInt4. * Default QRInt4 to ST=8 and keep only ST∈{1,8} so the host matches the measured keeper; drop unused codec/force_super/bf16 ALU and qr_int4_mem, compiling via flyc.compile. Co-authored-by: Cursor <[email protected]> * Skip color 0 after wrap so it never matches the unset sentinel (HIP QR does the same), and time QRInt4 with run_perftest. * Compile QRInt4 WORLD∈{2,4,8} via HIP-style kRankAtoms so TP4/TP2 work; WORLD=8 stays kRankAtoms=1. Co-authored-by: Cursor <[email protected]> * IPC helper is a FlyDSL copy so keep Apache-2.0 copyright 2025; match aiter vendored dual header. Co-authored-by: Cursor <[email protected]> * Replace QR INT4 packed-math inline asm with native FlyDSL f16x2 ops. gfx942 already lowers vector<2xf16> to v_pk_max/min/mul/add/fma, so the llvm.inline_asm helpers and f32 absmax round-trip are unnecessary. * Spell out QR INT4 RS/AG and lower the flag wait as a Python while. The two-shot NT fanout and last-sector handshake are unchanged; gfx942 SQNR vs fp32 all-reduce still passes at TP 2/4/8. Co-authored-by: Cursor <[email protected]> * Reduce torch surface in qrint4 kernel * Join ST sub-tiles before LDS reuse and tighten QRInt4 host checks. TP2 ST=8 was packing the next tile into LDS while wave 0 still loaded the previous one. Also match aiter FlyDSL dtype/device checks and stop sorting IPC group ranks. Co-authored-by: Cursor <[email protected]> * Assert QRInt4 SQNR on every rank. Each rank already scored vs its local fp32 NCCL all-reduce. The parent kept rank 0 only, so a broken all-gather on a non-zero rank could pass. Co-authored-by: Cursor <[email protected]> * Apply suggestions from ruff Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Match black wrapping and apply small Copilot host/test guards. Fail SQNR on NaN or a zero-power reference with error. Drop the NCCL fallback for Gloo object gather. Reject a rank or world_size that does not match the process group. Co-authored-by: Cursor <[email protected]> * Enable gfx950 FlyDSL QRInt4 with configurable grid cap. Extend arch support to gfx950, parameterize inbox/launch grid_cap (default 1216 to match HIP QR), and tighten the canonical test bench with --grid-cap and optional JSON export. Co-authored-by: Cursor <[email protected]> * Run black on qr_int4_kernel.py after merging main. * Reject NCCL and multi-node groups in QRInt4 with explicit errors. IPC inbox setup needs CPU broadcast_object_list and node-local HIP IPC handles. Fail fast before allocating buffers, matching QuickAllReduce. * Shorten QRInt4 process-group rejection messages. Co-authored-by: Cursor <[email protected]> * Fix QR INT4 launch safety and validation Clamp persistent grids to conservative residency limits, harden resource cleanup, and validate lossy collective results across ranks. Co-authored-by: Cursor <[email protected]> * Address QR INT4 review feedback Co-authored-by: samremes <[email protected]> * Apply Black formatting after merging origin/main. Fix CI Black failures in qr_int4_kernel.py and test_flydsl_qr_int4.py. Co-authored-by: Cursor <[email protected]> * Fix QR INT4 E4M3 boundary encoding * Reject >32bit offset Co-authored-by: Copilot Autofix powered by AI <[email protected]> * Add automatic QRInt4 cleanup * Avoid QRInt4 AOT import cycle * Harden QRInt4 validation and test collection * Fix QR INT4 E4M3 reserved-zero underflow after exponent clamp. Reserve byte 0x00 for true +0 only after packing so clamped positive scales cannot collapse, and add TP2 fill cases for underflow, overflow, and zero. Co-authored-by: Cursor <[email protected]> * Drop duplicate QRInt4 lazy-import key after merging main. Co-authored-by: Cursor <[email protected]> * Spawn QRInt4 test ranks instead of re-entering the file with --rank. Match HIP QR: Pool + spawn, return row dicts, keep argparse on main() only. Drop PYTHONPATH/arch env overrides and out.zero_(); time spawn workers with cuda.Event. Co-authored-by: Cursor <[email protected]> * Make QRInt4 test comments self-contained. State what each threshold, fill, and CLI flag does today, and record why the spawn ranks must time with cuda events instead of the profiler timer. Co-authored-by: Cursor <[email protected]> * Resolve the QRInt4 device index before set_device. torch.cuda.set_device rejects torch.device("cuda") without an index, so the current-device fallback in _cuda_index was unreachable. Resolve the index first, select that integer, and keep self.device as the resolved cuda:N. Co-authored-by: Cursor <[email protected]> * Rename FlyDSL QR INT4 to QuickAllReduceInt4 and drop leftover globals/asm. Move host and IPC out of kernels/, export QuickAllReduceInt4 only, and keep module constants that actually couple host tile math, LDS, and codec layout. Use fx.min, llvm.StoreOp(nontemporal=True) for NT fanout, llvm.amdgcn.s.setreg for FP16_OVFL, and inline readfirstlane at the inbox descriptor. Leave buffer_inv sc1 as inline asm: the flag poll is a non-atomic sc1 buffer_load (L2 bypass, not L1), so the miss path still needs an L1 invalidate, and llvm.amdgcn.buffer.wbinvl1.sc cannot select on gfx942/gfx950. * Format QuickAllReduceInt4 host and tests with ruff and black. * Move FlyDSL QR INT4 tests to multigpu_tests and fix HIP alloc rounding. Collect the suite with the 8-GPU job instead of single-GPU op_tests. Round uncached HIP mallocs to 4 KiB so small grid_cap inboxes still export, and feed MODE setreg through as_ir_value instead of fx.arith. * [FlyDSL] Extract quick-allreduce transport and codec into shared modules The ring and one-shot schedules that follow need the same tile geometry, inbox cache policy, peer store/load primitives and wire codec that the mesh kernel had inlined. Split them out so all three agree byte for byte rather than carrying three copies of the same magic numbers: quick_allreduce_shared geometry, _INBOX_POLICY, peer store/load, LDS quick_allreduce_codec INT4/INT6/FP16 wire formats and the E4M3 scale The mesh kernel becomes codec- and inbox-policy-generic as a result, and is renamed to match its new module. Two behavioural changes ride along. Fix the buffer cache-modifier encoding. These are LLVM CPol bits, which the backend renames for CDNA: bit 0 (GLC) prints as `sc0`, bit 1 (SLC) as `nt`, bit 4 (SCC) as `sc1`; bit 2 exists in the encoding but CDNA has no use for it and it emits nothing. The previous values were 4 for "NT" and 2 for "sc1", so the payload load carried no cache hint at all and the flag spin load got `nt` instead of bypassing L2 -- a spin that can be answered from a stale line. They are now 2 and `sc0 | sc1`. Make the flag spin load bypass L1 as well. `sc1` alone only bypasses L2; `sc0 sc1` is what LLVM emits for a system-scope load and is what lets the retry loop run without a fence in its body. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add inbox memory modes, codec selection and an ST ladder to the host The uncached IPC inbox the host has always allocated is right on xGMI and catastrophic on PCIe: peer writes into uncached memory serialize per destination, so throughput collapses as the fanout widens (MI350P, INT4 mesh: 55 GB/s to one peer, 4.45 to two, 1.44 to three, against 33.5 fine-grained). Give the host an `inbox_memory` knob over the kernel's existing cache-policy table, defaulting to "auto", which reads the real per-peer link type out of KFD rather than guessing from the arch string -- MI350X and MI350P both report gfx950 and want opposite answers. With a cacheable inbox a publish costs an L2 writeback, so the super-tile that was a fixed constructor argument becomes a payload-size ladder: `_pick_st` selects a rung, `_grid_x` hands each block a whole super-tile so the batching is real, and `_MIN_BATCH_BLOCKS` stops it trading the whole machine away at small sizes (MI350P, 32x7168, TP4: 61.95 us unbounded against 23.98 with the grid left alone). Also adds `rs_codec`/`ag_codec` with an AITER_ALL_REDUCE_CODEC override, `min_bytes` gating with `is_beneficial`, `variant()` for reporting which binary a size actually runs, and `has_xgmi_peer_links` for the dispatcher. The IPC heap grows a device check on every allocation. Several byte-identical copies of libamdhip64 are typically mapped into one process and they do not share device state, so the first one resolved by soname can allocate on the wrong GPU -- every peer write then crosses to the wrong device. Pick the mapped copy that reports torch's bound device, and assert the allocation landed where it was meant to. The page rounding hipIpcGetMemHandle needs moves from alloc_uncached to alloc, which is where the inbox is now allocated from. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add the ring schedule for quick-allreduce The mesh writes to every one of the N-1 peers on both laps. On a PCIe host a GPU has one shared x16 uplink, so those interleaved destinations contend for it; the ring instead makes every step a single contiguous run into exactly one peer's inbox. Same wire volume -- 2(N-1)/N of the payload, which is bandwidth optimal (Patarasuk & Yuan, JPDC 69(2), 2009) -- traded for per-destination locality, over 2(N-1) hops instead of two. The ring pays for that in accuracy: its reduce-scatter lap requantizes the running partial N-1 times where the mesh requantizes once, and the partial's extremum grows with the contributions folded in. Hence the per-lap codec knobs -- the reduce-scatter lap widens to INT6 at TP8 to hold the 18 dB SQNR floor, while the all-gather lap forwards received bytes untouched and stays INT4. Registered as algorithm="ring" alongside the mesh, with its own super-tile set (1, 8, 16, 32) and payload-size ladder. It is not the default and is structurally worse at decode sizes and on xGMI; the dispatcher that follows picks between them. clamp_grid_cap now falls back to the smallest measurement for a world size when a super-tile is not in the residency table, instead of raising: the table was measured on the mesh and does not cover ST=16 or ST=32. Under-launching a persistent kernel is always safe, so the fallback errs small; an unknown arch or world size still raises. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add the exact one-shot all-reduce and the schedule policy table Both quantized schedules are two-shot, so their latency floor is two serialized fabric traversals plus a grid-wide handshake between the laps. At decode sizes that floor dominates and the quantization buys nothing -- the collective is not the bottleneck there, and INT4 charges ~36 dB of SQNR for microseconds. OneShotAllReduce is the decode-regime answer: one round, no grid-wide barrier, bf16 in, fp32 accumulate, bf16 out, no codec. Each rank pushes its whole tile into every peer's inbox, publishes a colour flag, waits for N flags, then reduces N copies out of its own inbox. That trades wire volume for round trips -- (N-1)*S pushed against a two-shot's 2(N-1)/N*S -- so where it stops paying is a function of N, which is what max_bytes gates on. It needs no LDS: thread t's 16 B lands at the same offset in every destination, so it pushes straight from registers. It reuses the IPC inbox, peer table and cache-policy table from the quantized schedules verbatim, which is what the shared transport module was extracted for. allreduce_policy holds the size boundaries between the three families, per (link, world_size), fitted from measurement. It is a pure table plus env overrides -- no kernels, no torch -- so the dispatcher and the hosts can both read it without an import cycle. Accuracy defaults to "exact", which makes the quantized families unreachable until a caller opts in with AITER_FLY_AR_ACCURACY=fast. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Dispatch the FlyDSL all-reduce family from CudaCommunicator FlyDSLAllReduce owns one engine per reachable schedule and routes a payload to the family allreduce_policy picks for its size, link type and world size. CudaCommunicator consults it ahead of quick-reduce and custom all-reduce. It leads the chain because, at the default AITER_FLY_AR_ACCURACY=exact, the only reachable family is the exact one-shot -- fp32 accumulate, one bf16 rounding, comparable with cross_device_reduce rather than quantized -- and it declines every payload above that ceiling, so the caller falls through unchanged. AITER_FLY_AR_ACCURACY=fast unlocks the quantized mesh/ring for larger payloads. The whole path is opt-in: with AITER_FLY_AR unset the dispatcher disables itself in its constructor and the chain is exactly as before. Every unsupported condition -- no flydsl, wrong arch, NCCL group, multi-node group, unsupported world size -- is an early return that leaves `disabled` set, and should_fly_all_reduce is a pure predicate that answers False rather than raising. A communicator built with reuse_from borrows the engine rather than owning it, so destroy() only closes the IPC inboxes on the group that built them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add codec, policy and one-shot all-reduce tests test_flydsl_allreduce_policy is CPU-only: it checks that the family boundaries partition by size, that the ladders are ascending and reach every super-tile they name, and that the env overrides apply where the tables say they do. test_flydsl_quick_allreduce_codec runs on a single GPU with no IPC, so it covers the wire formats in isolation from the transport: INT4/INT6/FP16 round-trips, the E4M3 scale at both ends of its range, and the codec resolution rules. Two of its cases move with the E4M3 fixes rather than against them. They were written against an encoder that saturated the exponent field alone, so 512 encoded as 256 and an outlier decoded *smaller* than the ceiling it passed; and against one where a positive extremum small enough to encode as 0x00 collided with the reserved-zero byte and took its whole group to zero at 1e-3. Both now assert the fixed behaviour -- monotonic saturation past the ceiling, and a sub-floor extremum that rounds coarsely instead of vanishing -- plus that exact zero still encodes as exact zero. test_flydsl_one_shot_allreduce spawns real ranks and checks the one-shot is bit-identical to a torch all-reduce, not merely close, at TP2/4/8. It lives in multigpu_tests because it needs more than one GPU. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Cover both schedules and the transport in the INT4 all-reduce test The test gated only on SQNR, which cannot tell a transport bug from a codec one: a chunk-addressing or flag-protocol fault and a codec regression both show up as a worse number. Run the same cases over the fp16 passthrough wire format, where the whole reduce is lossless on an exact-grid input, and gate those on bit-identity with the fp32 reference instead. A ring variant with one lap fp16 and the other int4 names which lap is responsible when only one of them is. Every case now runs on both the mesh and the ring. The ring's reduce-scatter lap requantizes N-1 times where the mesh requantizes once, so its SQNR falls with N -- 22.2 dB at TP2, 18.7 at TP4, ~15 at TP8 all-INT4. Defaulting that lap to INT6 at TP8 lifts it to ~21 dB, so one 18 dB floor now covers both schedules; the all-INT4 TP8 configuration is still reachable through AITER_ALL_REDUCE_CODEC and keeps its own case at the floor it actually delivers. Cases that share a (world_size, algorithm, super_tile) group now ride a single spawn and are memoized for the session. _run_rank already looped over a list of shapes; this just stops calling it with one-element lists, which is most of the wall time back on a file that is now 46 cases. Adds a degenerate-input case (all-zero and far-sub-floor groups) that pins the encode-reciprocal clamp: a zero extremum decodes to a zero scale, and before the clamp that reached the codec as Inf and 0 * Inf poisoned the whole tile. INT6 has four times less headroom there than INT4, so it is the schedule that needs it. The predicted super-tile now compares against the engine's clamped ST=1 grid rather than the requested grid_cap, which is what the host's own selection compares against. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * [FlyDSL] Add the all-reduce benchmark, roofline and policy-fitting scripts bench_comm_allreduce sweeps every all-reduce candidate available on the host -- RCCL, custom all-reduce, HIP quick-reduce, and the three FlyDSL schedules -- over a shape list, on one process group, and reports latency, achieved bandwidth and SQNR per candidate. Candidates that cannot run a given shape are reported as declined rather than silently skipped, so a sweep says which alternatives a winner actually beat. transferbench_roofline turns a TransferBench point-to-point measurement into a per-schedule lower bound: each family's wire volume as a function of payload and world size, divided by the measured fabric rate. That is what separates "this kernel is slow" from "this kernel is at the wire". fit_allreduce_policy consumes a sweep and emits the family boundaries in allreduce_policy's format, so the tables there are reproducible from measurement rather than hand-maintained. The shapes/ CSVs are the sweep lists the current policy tables were fitted from: a small and a large payload sweep, and one that holds the payload fixed while varying hidden to separate size effects from shape effects. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * Improve benchmarking script to run in fast mode by default. * Fixed heuristics for the exact mode. * Fix bugs in the benchmarking script. * Update heuristics for xGMI interconnect. * Fix classification of FlyDSL auto-deducted kernel in benchmarking script. * Remove unintended Git modules. * Add two new tuning knobs: workgroup size and ability to read ranks own contribution from registers instead of IPC inbox (self-skip). * Update PCIe heuristics. * Refactor FlyDSL all-rduce kernels integration to comms dispatcher. * [FlyDSL] Scope OneShotAllReduce to its device instead of set_device Mirrors what ROCm#4970 did for QuickAllReduceInt4: construction, launch and close run under torch.cuda.device(), so building the engine no longer changes the caller's current device. Co-Authored-By: Claude <[email protected]> * [FlyDSL] Address agent review feedback on the all-reduce dispatch - Add a GPU-free regression test for the P1 finding: both FlyDSL selectors must decline a weakly- but not strictly-contiguous tensor (a full-storage transpose) instead of letting the engine raise after dispatch committed. - Document the host-wide xGMI detection and the uniform-node assumption it relies on (P3). - Drop a stray argument from the quick-reduce FlyDSL init log call; it had one more argument than placeholders. - Re-run black (trailing whitespace, assert formatting back to main's) and suppress SIM102 on a const_expr guard, matching the other FlyDSL kernels. Co-Authored-By: Claude <[email protected]> * [FlyDSL] Move all-reduce tooling out of the multi-GPU test directory The multi-GPU CI job runs every .py under op_tests/multigpu_tests/ as a script, so tooling there ran as tests: fit_allreduce_policy.py failed on its required argument and bench_comm_allreduce.py ran a full sweep. - Remove fit_allreduce_policy.py and the sweep shape CSVs it was fed. - Move bench_comm_allreduce.py and transferbench_roofline.py to op_tests/op_benchmarks/flydsl/, which CI does not execute, and update their usage text. --shape-csv stays as a user option. Co-Authored-By: Claude <[email protected]> * Remove fragile tests. Refactor multi-GPU tests for all-reduce to follow Aiter testing guidelines. Add the full kernel information to human readable kernel name. * Black and ruff fixes. Improve comments about the use of CUDA events in the FluyDSL all-reduce tests. * Add self-skip and block tunign knobs to two-steage mesh all-reduce. * Use fx.generic_load, fx.generic_store, and fx.memory_fence to replace the inline ASM. * Use system scope memory fence for releasing inboxes. * Use uncached memory on PCIe when world size is two. * Update aiter/ops/flydsl/kernels/quick_allreduce_int4.py Address GitHub bot feedback. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove probe from 1-stage kernel. * Remove the legacy buffer_ops.buffer_load and buffer_ops.buffer_store. Extract shared layout definition. Clen-up code. * Ensure communicator initialization only compiles the relevant all-reduce instances. * Trim the test suite for one-shot and quick all-reduce kernels. * Collect shared all-reduce host wrapper assets to a shared module. * Heuristics for xGMI interconnect. * Update PCIe heuristics after the latest run. * Add more cases to the benchmarking script. * Addres black and ruff findings. * Remove the custom logic for loading the HIP runtime library. * Optimize memory fences for PCIe TP=2 case when uncached IPC memory is used. * Fix a wrap-around bug in one-shot all-reduce. * Improve benchmarking script such that it doesn't have bias towards FlyDSL instances. * Optimized syncscope for xGMI interconnect. * Update PCIe heuristics for TP=2 and for TP=4. * Update xGMI heuristics. Introduce an env variable to override the min message size for FlyDSL one-stage all-reduce. * Use _preload_compiled from TensorShim to run JIT compilation outside HIP graph capture. * Black and ruff fixes. * Add a Lamport (flagless) variant of the FlyDSL one-shot all-reduce. The payload is its own flag: inbox slots hold a sentinel (bf16 NaN 0xFFFF in every half-word) until a peer's data lands, the receiver polls all of its sources together until no half-word is the sentinel, then re-arms the slot two rounds ahead in a 3-buffer rotation. Senders rewrite a sentinel half-word in their own payload to 0x7FFF, which is still NaN. That removes the vmcnt(0) drain, both barriers and the flag round trip from every tile. - kernel: `lamport` const_expr in make_one_shot_allreduce_kernel; uncached inbox only. The poll re-reads through relaxed system-scope atomics (_poll_v4i32) so the spin cannot be deleted. The first tile is peeled so its input load overlaps the colour load. - IPC: UncachedIpcHeap.alloc takes a fill byte and synchronizes after the memset, so a late fill cannot erase a peer's first push. - host: `lamport` is the 7th ONESHOT_LADDER field and an OneShotAllReduce knob; AITER_FLY_AR_ONESHOT_LAMPORT=0|1 pins it from the environment. Every shipped rung keeps lamport=False in this commit. - tests: --lamport knob, Lamport spot configs at TP2/TP8, and a 300-call fresh-input stress checked bit for bit against a rank-order reference. - bench: fly_1stage_lp and _lp variants of the pinned fly1s grid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Ship the Lamport one-shot on xGMI and drop the one-shot floors there. Sweep on 8x MI325X (gfx942), graph timing. Best Lamport config vs the flag one-shot: TP2 -3..-23%, TP4 -3..-14%, TP8 -19..-41%. It ties or beats cross_device_reduce down to 2 KiB at every world size, so the xGMI min_bytes floors (56/48/112 KiB) go to 0. ONESHOT_LADDER xGMI, all skip_self + lamport, atoms=1, cap 128: TP2 b128 to 256 KiB (one round), then b256 TP4 b256 TP8 b128 PCIe rungs stay on the flag variant (not measured). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Make Lamport all-reduce the default and add heuristics. * Make self-skip default on one-shot and two-shot mesh algorithms. Redeuce the number of benchmarked configurations. * Remove redundant/obsolete instances from benchmarking. * Transferbench roofline fixes. * Clean-up TransferBench runner script. * Benchmarking script fixes. * Move FlyDSL communication kernels into a single directory. * Black & ruff fixes. * Address first part of the code review feedback. * Remove separate benchmarking scripts. * Expand test scripts to run the benchmarking. * Add gfx950/xGMI all-reduce policy rows; never pick the ring there. The FlyDSL family policy was measured on gfx942 for xGMI. On gfx950/xGMI (MI355X) the bench scenario of the all-reduce op tests shows: * The ring never beats the mesh: 1.03x-1.16x slower at TP2 up to 512 MiB, 2.2x-5.7x slower at TP4/TP8. The 128 MiB mesh_max sent large payloads to it; mesh_max is now unbounded there. * cross_device_reduce's 2-stage kernel beats both the one-shot and the mesh over a wide middle range at TP4/TP8, so the one-shot ceiling drops to cdr's 2-stage switch and the mesh floor rises to where the mesh overtakes cdr (960 KiB at TP4, 1600 KiB at TP8). At TP2 the one-shot beats cdr up to 3 MiB and the mesh up to 448 KiB. Rows measured on one arch live in ARCH_FAMILY_POLICY, keyed by (arch, link, world_size), and replace the FAMILY_POLICY row on that arch only; gfx942 keeps its rows. The resolvers and max_payload_bytes take an optional arch, defaulting to this host's. End to end through CudaCommunicator.all_reduce under graph capture (INT4 regime), against the old rows: never slower (within noise), 1.17x-1.54x at TP4/TP8 mid-range, 2.47x (TP4) and 5.44x (TP8) at 256 MiB. Against stock production with FlyDSL off: >= 0.99x at every size. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Make the all-reduce tuning ladders and policy records dataclasses. Review feedback on ROCm#5461: ladder rungs were bare tuples, so every reader had to know the field order. * OneShotRung (min_bytes, atoms, grid_cap, fanout, block) and TwoShotRung (min_bytes, super_tile, grid_cap, block) replace the tuples of ONESHOT_LADDER, MESH_ST_LADDER and RING_ST_LADDER, and pick_rung() is the one implementation of "last rung at or below the payload" for both hosts. * The records live in kernels/comm/allreduce_shared.py next to the rungs: FamilyPolicy, OneShotPolicy and QuantPolicy move there from allreduce_policy, with NO_MAX. allreduce_policy re-exports them. * The mesh ladder comment described an older table; it now matches the rungs. * OneShotAllReduce dropped a grid_cap ceiling branch that could not run: any grid_cap pins the configuration. No behaviour change. Verified with the policy unit tests and both multi-GPU verify scenarios on gfx950 (TP2/4/8). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Make the all-reduce heuristics readable from one module. allreduce_policy.py now holds every tuned decision, in two levels, with a module docstring that draws the payload axis: * Level 1, which kernel: FamilyPolicy fields are renamed to say what they bound, in payload order -- oneshot_min, oneshot_max (was oneshot_max_exact), quant_min (was oneshot_max, which was not a one-shot maximum but the mesh floor), mesh_max, quant_max (was max_bytes). route() composes the two slots in CudaCommunicator.all_reduce order and returns oneshot / mesh / ring / fallback; the policy unit tests and the INT4 bench use it instead of private copies. The bench's copy reported "oneshot" for payloads that go to cross_device_reduce. * Level 2, which configuration: ONESHOT_LADDER, MESH_ST_LADDER and RING_ST_LADDER move here from the kernel modules, which never used them. No behaviour change: the rows keep their values under the new names. The environment overrides keep their meaning. Verified with the policy unit tests (plus a route() test for the gfx950/xGMI rows) and both multi-GPU verify scenarios on gfx950. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Collect the all-reduce limits and shared constants in one place. Review feedback on ROCm#5461: limits were restated across modules, and the ring had a payload floor of its own that mirrored the policy by hand. * kernels/comm/allreduce_shared.py has a "Limits" section: SUPPORTED_ARCHS, SUPPORTED_WORLDS, LINKS, SUPPORTED_BLOCKS, PAYLOAD_ALIGN_BYTES, MAX_PAYLOAD_BYTES, QUANT_MIN_PAYLOAD_BYTES and NO_MAX. The policy, the hosts, the codec, the one-shot kernel, CustomAllreduce, QuickAllReduce and the op tests import them instead of keeping their own copies (three SUPPORTED_ARCHS, two SUPPORTED_BLOCKS, two SUPPORTED_WORLDS, and the "pcie"/"xgmi" literals). * The ring's standalone floor (_RING_MIN_PAYLOAD_BYTES_BY_WORLD, 4-12 MiB) is gone. It claimed to mirror mesh_max but matched no policy row, and production never used it (dispatch passes min_bytes=0). Both schedules now refuse the same thing on their own: payloads under QUANT_MIN_PAYLOAD_BYTES, the accuracy guard. * The tuned constants MIN_BATCH_BLOCKS and RS_INT6_MIN_WORLD move to allreduce_policy with the rest of the tuning. * The hosts' identical payload checks, link resolution, arch check and group checks become shared helpers: check_payload, resolve_link, require_arch, check_world_size and _validate_ipc_process_group. Verified with the policy unit tests, both multi-GPU verify scenarios and bench smoke runs on gfx950. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Code clean-up after refactoring the family policy and rungs for tuning ladders. * Refactor FamilyPolicy to use explicit windows per algorithm. Clean-up the host wrappers to simply how the rungs of tuning ladders are used. * Run only the production configs by default in the all-reduce tests. * Clean-up comments and doc strings in ring all-reduce kernel. * Ensure ring all-reduce gives bit.identical output for every rank. Add tests that execute production all-reduce dispatch. Fixed one-shot all-reduce window handling for th exact mode. Add an env variable to specify the interconnect type. Fix other small review findings. * Rename factory for quick reduce ring kernel. * Fix black issues, improve tests, and fix exact one-shot all-reduce window. * Simplify handling of the one-shot all-reduce window. * Rename all-reduce host side assets to have host prefix in the filename. * Fix black and ruff. * Small re-tune for PCIe. * Add op_tests/multigpu_tests/flydsl_allreduce_bench.py on the test skip list since it contains no actual tests, only infrastructure. * Address co-pilot review feedback. * Remove dead code. * Fix black & ruff. * Ruff fix. * Update tuning ladders for gfx950/xGMI after tuning sweep. * Fix black and ruff. * Ensure all ranks agree on which FlyDSL all-reduce needs to be built. Add CPU test to verify the rank agreement logic and append to GPU tests to have a case where one rank has FlyDSL all-reduce disabled. * Load all-reduce kernels onto device at initialization. This ensures that possible HIP graph capture doesn't include module loads. Add tests where first call takes place inside a graph capture (no wram-up). * Remove ring ladders that are not shipped. * Fix black & ruff. * Fix performance regression for fused all-reduce + RMSNorm. * allow fused all-reduce + RMSNorm inside the HIP graph capture. * Update TP=2 ring algorithm window policy for gfx950/xGMI. * Fix failing policy test. * Address Copilot code review findings. * Fix black and ruff. * Fix Aiter bot findings. --------- Co-authored-by: Sami Remes <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: samremes <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Since Nov 8, crsuse2-m2m-v3-108's docker daemon cannot reach containerd, so no container starts there. Spur still schedules jobs on it: the rank there failed its first docker step while rank 0 waited out HEALTH_TIMEOUT_S (90 min) for its endpoint, and the Nov 9 nightly passed no cell. The TP cells of Kimi-K2.6, Kimi-K3 and MiniMax-M3.1 have failed at start-up since Nov 7 as well: ROCm/aiter#5461 renamed QuickAllReduceInt4.compile() to preload(), and vllm-project#65995, which handles that, merged on Nov 9 but is not in the nightly image yet. - After the image pull, run_xPyD_disagg.slurm starts a throwaway container and rejects the node like a busy one (PREFLIGHT-REJECTED) when docker's error names containerd or the daemon. A failed pull alone may be the registry's fault, so it doesn't count. - A rank whose setup fails (preflight, the AINIC swap or the vLLM patch bake) writes the completion sentinel, and rank 0's health gate gives up once it appears, so such a job ends in about a minute. - drive.py keeps every node a preflight rejection names out of the rest of the run, by submitting with EXCLUDE_NODES (sbatch --exclude), and lists those nodes in summary.md. MX_EXCLUDE adds nodes up front. - TP layouts bake in the vLLM part of vllm-project#65995 by default. Once the image has it, apply_vllm_patches.sh skips it as already applied. The rejection path ran locally against stub docker, rocm-smi and ss commands, not yet on the cluster. Co-authored-by: Cursor <[email protected]>
Motivation
PR #4970 introduced a two-stage int4 quick reduce FlyDS kernel that improved all-reduce throughput over the existing Aiter two-stage/RCCL kernels. Current Aiter all-reduce kernels are written primarily for the xGMI interconnect. This PR optimizes the FlyDSL quick reduce int4 kernel for PCIe interconnects (MI350P) and adds two new kernels: a one-stage lossless and a two-stage ring kernel with int4/int6 codecs. On MI350P, they offer better performance than the existing Aiter production kernels (cross-device-reduce/QR Int4)
MI350P/PCIe
For TP=4,8 Aiter's existing QR Int4 seems to have a structural problem on PCIe (un-cached IPC memory is suboptimal) and we have also compared against the exact cross-device-reduce and RCCL kernels against the quantized FlyDSL all-reduce.
MI350P/PCIe, efficiency
fly_auto)fly_auto)Efficiency is
roof us / measured us(higher is better, 1.0 = at the roof), where the roof is the fastest of one-shot / two-shot / ring that TransferBench achieves moving that kernel's wire bytes.MI325X/xGMI
MI350X/xGMI
This PR vs current Aiter main (MI350X/xGMI)
allreduce)allreduce_rmsnorm)allreduce_rmsnorm_mxfp4)The average is geometric mean of the speedup values.
PR Self-Review
Reviewed revision
c3a44c0Behavior and intent
Adds FlyDSL all-reduce kernels behind the existing
CustomAllreduceandQuickAllReduceslots, opt-in withAITER_FLY_AR=1: an exact one-shot (bf16), an INT4 quick-reduce (mesh and ring), and a fused INT4 all-reduce + RMSNorm (optionally with an MXFP4 output). A per-platform policy table (allreduce_policy.py) chooses the algorithm by arch, link (xGMI or PCIe), world size and payload. Payloads outside a FlyDSL window fall back to the stock path, as before.Why: on PCIe (MI350P) the stock kernels are slow at all world sizes. The FlyDSL one-shot is 1.5–44× faster at decode sizes, and the INT4 path is 26–43× faster than HIP QR INT4 at prefill sizes (numbers in the PR description). With
AITER_FLY_ARunset, nothing changes: no engine is built, and dispatch is the same as onmain.Validation and unverified scope
8× MI350P (gfx950, PCIe), TP=2/4/8, default
verifyscenario. These ran at26f2b5e, and6b18a89only fixes a CPU test. All three passed:python op_tests/multigpu_tests/test_flydsl_one_shot_allreduce.pypython op_tests/multigpu_tests/test_flydsl_quick_allreduce_int4.pypython op_tests/multigpu_tests/test_flydsl_quick_allreduce_int4_rmsnorm.pyCI runs multi-GPU tests on other supported hardware.
Logs: test_flydsl_one_shot_allreduce.log · test_flydsl_quick_allreduce_int4.log ·
test_flydsl_quick_allreduce_int4_rmsnorm.log
pytest op_tests/flydsl_tests/test_flydsl_allreduce_policy.py test_flydsl_allreduce_rank_agreement.py test_flydsl_quick_allreduce_codec.pyandop_tests/multigpu_tests/test_reuse_identical_rank_groups.py: 175 passed, 3 failed. The 3test_gpu_reuse_*tests fail withhipIpcGetMemHandleinvalid argument. They fail the same way onorigin/mainon this host, so the failure predates this PR.End-to-end: DeepSeek-V4-Pro, TP8, 8× MI350P, GSM8K (1319 questions). With INT4 off, the score is identical to stock
main(95.22 % for both). With INT4 on, it is −0.34 pp (95 % CI −1.16 … +0.48), which is not significant.gfx950/xGMI: the policy was tuned on gfx950 hardware. The perf tables are in the PR description.
Unverified:
op_tests/flydsl_tests/is not inaiter_test.sh.61f0d7d.PR-specific question
The only CI change adds one path,
op_tests/multigpu_tests/flydsl_allreduce_bench.py, to theskip_testslist in.github/scripts/aiter_test.sh. That file is a shared timing helper imported by the two FlyDSL tests, and it has no tests of its own. The multi-GPU job would otherwise run it as a test script, because it runs every*.pyfile in that directory.The change has no workflow, trigger,
permissions:, secret or runner changes. The script runs in the same test job as before, with the same privileges. The change can only make that job run fewer files, so it gives fork code or PR text no new path to a privileged step.Changed op tests
op_tests/flydsl_tests/test_flydsl_allreduce_policy.py(new, CPU): checks the dispatch tables. Windows don't overlap, dispatch is monotone, each ladder matches its window, and gfx950/xGMI never runs the ring. It also checks thatAITER_FLY_AR_*overrides cannot enable an algorithm that has no ladder. The policy table is new, so no existing test covers it.op_tests/flydsl_tests/test_flydsl_allreduce_rank_agreement.py(new, CPU): the init votes on every rank's plan. One skewed rank (env, link, import, window, or size bound) turns FlyDSL off on every rank instead of hanging the others. This is the regression test for the init-hang review finding.op_tests/flydsl_tests/test_flydsl_quick_allreduce_codec.py(new, 1 GPU): checks the INT4/INT6/fp16 wire codecs without IPC. It tests the analytic error bound, E4M3 scale saturation, and that the LDS memory path matches the register path bit for bit. A bug that hits both sides of the real kernel the same way is invisible in an end-to-end all-reduce test.op_tests/multigpu_tests/flydsl_allreduce_bench.py(new helper, no tests): the shared timing and reporting for the twobenchscenarios below, so they use one method. CI skips it (see above).op_tests/multigpu_tests/test_flydsl_one_shot_allreduce.py(new): checks the one-shot. Results are bit-exact across ranks, and every production rung is covered. It also covers run-ahead and fresh inputs, production dispatch, a skewed rank, and the first call inside a graph capture. The kernel is new, andtest_custom_allreduce.pytests only the HIP kernel.op_tests/multigpu_tests/test_flydsl_quick_allreduce_int4.py(extended): before this PR it had one test. Now it also covers the ring, edge inputs, divisors, pinned codecs, and bit-exact fp16 transport. It adds kernel coverage, production dispatch, a skewed rank, and the first call inside a capture.test_quick_all_reduce.pytests only the HIP QR.op_tests/multigpu_tests/test_flydsl_quick_allreduce_int4_rmsnorm.py(extended): adds hidden 6144, the fused mesh ladder, MXFP4 equality, and the first fused call inside a capture withrmsnorm_hidden.test_quick_all_reduce_rmsnorm.pytests only the HIP kernel.op_tests/multigpu_tests/test_reuse_identical_rank_groups.py(extended): adds three CPU tests of the realCudaCommunicator.destroy(). The owner closes its all-reduce slots exactly once, a borrower doesn't close them, and a seconddestroy()is a no-op. The slots now hold FlyDSL engines with IPC inboxes, whichclose()releases. The existing suite stubs the communicator, so it never reached this branch.Technical Details
Documentation:
aiter/ops/flydsl/kernels/comm/README.md.Kernels (
aiter/ops/flydsl/kernels/comm/)one_shot_allreduce.py: exact one-shot push all-reduce. bf16 in and out, fp32 accumulation in a fixed rank order, one bf16 rounding, so the result is bit-identical to an fp32 rank-order sum. The inbox needs no flags: a slot holds a NaN sentinel until the peer's data arrives. Three inbox buffers rotate by colour, so a peer one round ahead never writes the buffer being re-armed.quick_allreduce_int4.py: the two-shot mesh (from [FlyDSL] QRInt4: INT4 two-shot all-reduce for gfx942/gfx950 #4970), moved onto the shared codec and transport. The oldkernels/quick_allreduce_int4.pyis deleted.quick_allreduce_int4_ring.py: the two-shot ring, with 2(N-1) single-destination hops and a wire format (INT4/INT6) for each lap. At TP8 the reduce-scatter lap defaults to INT6, so the ring stays above the 18 dB SQNR floor. Every rank gets the same bits: the owner decodes its own chunk from the packet it quantized.quick_allreduce_codec.py: the INT4, INT6 and FP16 wire codecs (group-16 E4M3 scales). FP16 makes the transport lossless, which the bit-exact transport tests rely on.allreduce_shared.py: tile geometry, the inbox cache policy, the peer store/load primitives and the shared limits. It also holds the policy definition (Window,FamilyPolicy, the rungs).Host classes (
aiter/ops/flydsl/)OneShotAllReduce(one_shot_allreduce.py): new host class for the one-shot kernel.QuickAllReduceInt4(quick_allreduce_int4.py): gainsalgorithm="mesh"|"ring", codecs for each lap, inbox memory modes (uncached/finegrained/auto), and super-tile ladders by payload size.allreduce_host_shared.py: IPC inbox setup and link detection (probe_xgmi_peer_links, which reads the KFD link types). PCIe hosts get a fine-grained inbox at TP4 and TP8, because uncached peer writes are serialized per destination on PCIe. xGMI hosts, and PCIe at TP2, get an uncached inbox.allreduce_policy.py: every tuned decision, at two levels.FAMILY_POLICIEShas oneFamilyPolicyper(arch, link, world_size), with one payload window for each algorithm (one-shot, mesh, and ring). A one-shot window ends where the one-shot starts losing to the existing Aiter all-reduce kernels. The mesh/ring boundary is where the ring overtakes the mesh.ONESHOT_LADDER,MESH_ST_LADDERandRING_ST_LADDERgive the kernel configuration (tunable kernel parameters) for a given payload size.Production dispatch, opt-in with
AITER_FLY_AR=1. With the variable unset (or set to 0), existing Aiter behavior is unchanged.QuickAllReduceruns first. UnderAITER_QUICK_REDUCE_QUANTIZATION=INT4, it routes bf16 payloads within the mesh or ring window to the FlyDSL engine. Other payloads go to the HIP quick reduce, or fall through.CustomAllreduceputs the exact one-shot in front of the existing kernels, for plain bf16 payloads in the one-shot window (intersected withAITER_CUSTOM_AR_{MIN,MAX}_SIZE). When quantization is enabled, it only sees the payloads thatQuickAllReducedidn't take.flydsl_utils.all_ranks_agree), so a failure on one rank disables FlyDSL on all ranks. The binaries that the dispatch can select are compiled at init (preload_fly_engines).close()releases the engines, andCudaCommunicator.destroy()closes the slots it owns.AITER_FLY_AR_LINKenv variables is used as a backup when it can't be read.Environment variables
AITER_FLY_AR1enables the FlyDSL path; any other value, or unset, disables it.AITER_FLY_AR_LINKxgmiorpcie. Used only if the KFD topology can't be read. If both fail, FlyDSL is not used.AITER_FLY_AR_{ONESHOT,MESH,RING}_{MIN,MAX}_BYTESThe bounds are in bytes: the minimum is inclusive, the maximum exclusive.
-1or empty means dispatching uses the default values.none/infmeans no upper limit (for maximums only). A maximum of0disables the algorithm. Invalid values are ignored, with a warning. If the mesh and ring windows overlap each other, FlyDSL is disabled, with a warning. The README has the full rules.Test Plan
The FP16 wire codec makes the transport lossless, so the transport can be checked bit for bit against a reference. The one-shot is exact by construction and is checked against an fp32 rank-order sum.
Single-GPU / CPU (
op_tests/flydsl_tests/- not executed by CI)test_flydsl_allreduce_policy.py: policy table invariants, the ladders inside their windows, env-override semantics, link detection.test_flydsl_quick_allreduce_codec.py: INT4/INT6/FP16 codec round-trips and edge values.Multi-GPU (
op_tests/multigpu_tests/,--scenario verify)test_flydsl_one_shot_allreduce.py(new test suite):test_flydsl_quick_allreduce_int4.py(existing test suite):test_reuse_identical_rank_groups.py:CudaCommunicator.destroy()closes the all-reduce slots it owns.The default sweeps are trimmed to the kernel configurations that the policy selects in production. Option
--extendedalso runs the configurations that production never selects.Benchmark (
--scenario bench): the same two tests time the FlyDSL kernels against the stock kernels on the same payloads:cdr,cdr_naiveandrccl;The harness,
op_tests/multigpu_tests/flydsl_allreduce_bench.py, uses HIP-graph replay, one process and one input for every candidate, and rotated rounds.Test Results (performance)
FlyDSL runs in the configuration that the policy selects. Timing: a HIP graph of 10 calls, 10 timed replays per sample, the median of 12 rotated rounds, the slowest rank.
Decode. The exact FlyDSL one-shot is compared with the fastest stock kernel (always
cdrorcdr_naiveat these sizes), and with what production runs today (cdr, the kernel the one-shot replaces). At TP4 and TP8,cdrpicks itsllkernel for small payloads, which is slow on PCIe.Prefill. The FlyDSL mesh or ring is compared with two baselines:
qr_int4), the like-for-like quantized comparison, which degrades sharply above TP=2 on PCIe.cdr,cdr_naiveand RCCL. These were timed withtest_flydsl_one_shot_allreduce.py --scenario benchat the same sizes (withAITER_FLY_AR_ONESHOT_MAX_BYTES=noneso the bench builds the one-shot for them). The mesh/ring bench times only the HIP QR INT4.SQNR is reported next to latency, because QR INT4 is lossy.
TP=2 (decode)
TP=2 (prefill, vs Aiter QR INT4)
TP=2 (prefill, vs the fastest exact kernel of cdr / cdr_naive / RCCL)
TP=4 (decode)
TP=4 (prefill, vs Aiter QR INT4)
TP=4 (prefill, vs the fastest exact kernel of cdr / cdr_naive / RCCL)
TP=8 (decode)
TP=8 (prefill, vs Aiter QR INT4)
TP=8 (prefill, vs the fastest exact kernel of cdr / cdr_naive / RCCL)
Submission Checklist