[CK Tile] eight-waves ABQuant pipeline is incorrect at BQuantGroupSize::kN < 4, and its BPreshuffleQuant path has no loader
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- cpp
- Bereich
- backend, performance
Rechercherichtung
Start with gemm_abquant_pipeline_ag_bg_cr_eight_waves_policy.hpp:107-118 and block_universal_gemm_..._eight_waves.hpp, then inspect gemm_abquant_pipeline_ag_bg_cr_eight_waves.hpp:194 for the asserted plain window. Reproduce the reported kN error ladder and benchmark before and after changes. Done means correct fine-grained B-scale consumption and a working BPreshuffleQuant load path without regressing the existing kN=128 behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Two related gaps in gemm_abquant_pipeline_ag_bg_cr_eight_waves*, found while trying to use the eight-waves pipeline for per-channel (kN=1) FP8 GEMM on gfx950.
1. Correctness at fine B-quant granularity
The pipeline is exercised upstream only at BQuantGroupSize::kN = 128 (one B scale per warp: NPerWarpBQ = NPerWarp / kN). At finer granularity it is wrong, in two independent ways:
- the BQ load distribution (
..._eight_waves_policy.hpp:107-118) replicates a single scale across all 64 lanes; - the consume loop (
block_universal_gemm_..._eight_waves.hpp, non-pq branch) applies one per-laneb_scaleacross the 4 different columns a lane owns — structurally wrong forkN < 4even with a perfect load.
Measured error ladder at a fixed shape (per-token A scales, random B scales): kN=128 → 0.0, 32 → 0.749, 16 → 0.872, 4 → 0.964, 2 → 0.980, 1 → 0.987.
We have an overlay that fixes both (a corrected BQ encode + a per-c_row consume) and reaches errRatio 0.0000 at kN=1; happy to open it as a PR if the direction is agreeable — it is gated on kN==1 to leave existing behaviour untouched, which is probably not how you'd want it upstream.
2. BPreshuffleQuant is half-implemented for this pipeline
The consume side has a ds_bpermute BPreshuffleQuant branch, but the pipeline has no pq load path — gemm_abquant_pipeline_ag_bg_cr_eight_waves.hpp:194 asserts the plain window. So the fast route for fine-grained scales cannot be reached at all.
This matters for performance, not just tidiness: with the correctness fix above, a correct kN=1 eight-waves kernel issues 32 scattered dword loads per thread (quad columns sit QK_B floats apart in the plain (N, K/128) BQ layout, so GetVectorSizeBQ() == 1) inside a hot loop whose sched_group_barrier budget assumes GetInstCountBQ() == 1. Measured at (M=1920, N=6144, K=12288): 2733.8 us corrected, versus 194.8 us for the flatmm path — while the incorrect version, which effectively did no BQ traffic, ran at 132.7 us. That 132.7 us is a hard floor for what a properly-vectorized pq load path could achieve, i.e. a plausible ~1.4x over flatmm, but it is unproven until the loader exists.
Context: gfx950 / MI350X, per-token x per-channel FP8. Related: #3765 (PermuteN epilogue scale gather), #3766 (universal kernel rejects column-layout D tensors).
- Vorherrschende Sprache
- C++
- Sterne
- 552
- Forks
- 316
- Ø Merge
- 3 T. 14 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ROCm/composable_kernel
-
[ck_tile] FastGeluAsm::operator()<float, float> returns wrong results from -O1 up: inline-asm scratch operand lacks earlyclobberEvtl. vergeben @francois141 hat das vor 17 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ROCm/composable_kernel#3763 ·
-
[ck_tile][FMHA] fp8 forward returns incorrect results for head dims not divisible by 16 (gfx950)Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
ROCm/composable_kernel#3796 ·
-
Tracking issue for #3792: relu2 CK XDL 2-stage MoE GEMM fix stalled on reviewEvtl. vergeben @shantipriya-amd hat das vor 19 Tagen übernommen. Offen
ROCm/composable_kernel#3794 · 1 zugewiesene Person ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 35/100
ROCm/composable_kernel#3781 · 1 Kommentar ·
-
[CK Tile] 8-wave ABQuant silently returns wrong results when BQuantGroupSize::kN < WarpGemm::kNOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
ROCm/composable_kernel#3771 · 1 Kommentar ·
Alle Issues in ROCm/composable_kernel
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
riscv-software-src/riscv-isa-sim#2640 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
difficulty:easy func:gui prio:normal type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NatronGitHub/Natron#2118 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
-
mechanics UI
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
endless-sky/endless-sky#12949 ·
Maintainer antworten meist innerhalb von 1 Tag