You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FlyDSL] QRInt4: INT4 two-shot all-reduce for gfx942/gfx950 - #4970
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.
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]>
All standard extended tests (excludes ci:atom_full)
Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 4970 --add-label <label>
PR title tags:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf] and op tags like [MLA] are left untouched. Add the no-auto-title label to opt this PR out of title tagging.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a public gfx942 FlyDSL INT4 two-shot all-reduce implementation for TP 2/4/8.
Changes:
Implements reduce-scatter/all-gather with INT4 and E4M3 quantization.
Adds HIP IPC buffer management and super-tile launch selection.
Adds distributed SQNR tests and benchmarking support.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
File
Description
aiter/ops/flydsl/__init__.py
Exports QRInt4.
aiter/ops/flydsl/kernels/qr_int4.py
Implements the host launcher.
aiter/ops/flydsl/kernels/qr_int4_kernel.py
Implements the FlyDSL GPU kernel.
aiter/ops/flydsl/kernels/qr_int4_ipc.py
Provides HIP IPC memory helpers.
op_tests/flydsl_tests/test_flydsl_qr_int4.py
Adds correctness and benchmark coverage.
Suppressed comments (1)
aiter/ops/flydsl/kernels/qr_int4_kernel.py:630
The ST=8 runtime loop has the same non-carried color update: each super-tile handshake needs the previous iteration's color, and the final value is stored after the loop. Rewrite this loop with explicit init/yield state so later batches cannot publish or wait on a stale color.
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]>
samremes
changed the title
[FlyDSL] QRInt4: INT4 two-shot all-reduce for gfx942
[FlyDSL] QRInt4: INT4 two-shot all-reduce for gfx942/gfx950
Aug 25, 2026
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Suppressed comments (1)
aiter/ops/flydsl/kernels/qr_int4.py:220
When stream is omitted, Stream(None) targets the default HIP stream rather than PyTorch's current stream. A call made inside with torch.cuda.stream(s): can therefore read inp before its producer on s finishes and write out on an unexpected stream. Resolve the current stream for this device, as the other FlyDSL wrappers do.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Device selection is not consistently honored during architecture checks and first-time JIT compilation.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
aiter/ops/flydsl/quick_allreduce_int4.py:180
get_gfx_runtime() reports the first architecture found by rocminfo; it is not tied to the explicit device argument. On a heterogeneous host this can reject a supported selected GPU, or accept an unsupported one and then compile for it. Resolve the device index first and validate that device's gcnArchName.
flyc.compile loads a HIP module on the ambient device; wrap _run_compiled so a communicator built for a non-current GPU still compiles and dispatches there.
Co-authored-by: Cursor <[email protected]>
Validate caller stream belongs to the engine device
aiter/ops/flydsl/quick_allreduce_int4.py:286
A caller can pass a torch.cuda.Stream belonging to another GPU; it is wrapped without validation and then used to launch a kernel whose tensors and IPC allocations are on self.device. This can fail the launch or execute against addresses from the wrong device. Require a PyTorch stream on the engine device before converting it to FlyDSL's Stream.
The launcher does not reject streams belonging to a different GPU, risking invalid cross-device launches.
It is caller's responsibility to provide a valid stream, especially when it is an optional parameter and default is already correct, we could do endless validation for anything here. Other ops in aiter don't do this either so I won't deviate from the common pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QRInt4: FlyDSL INT4 two-shot all-reduce (reduce-scatter, then all-gather) for gfx942/gfx950, TP 2/4/8.This is a Python launcher (
from aiter.ops.flydsl import QuickAllReduceInt4). It is not wired into the HIP QuickReduce dispatch tables.Why this is faster than HIP QR INT4
HIP QR INT4 (
CodecQ4) is one tile per handshake. This kernel packs ST=8 tiles under one last-sector handshake, and uses lockstep 64 B NT fanout.Group-16 E4M3 also beats HIP CodecQ4 numerics: SQNR ~19.2 dB vs fp32 all-reduce (HIP INT4 is ~18.3 dB / rel MAE ~0.123).
Evidence (8× TP8, isolation
run_perftest, bf16)gfx942 (MI325X, 304 CU)
gfx950 (MI355X, 256 CU)
Test plan
python3 op_tests/multigpu_tests/test_flydsl_quick_allreduce_int4.py-- validity and perf testsMade with Cursor