Skip to content

Commit 6f65fba

Browse files
akii96vpietila-amd
authored andcommitted
flydsl: gfx942 FP8 MQA logits indexer kernel (+ Triton FN/FNUZ fix) (ROCm#3913)
* flydsl: add gfx942 fp8 MQA logits indexer kernel FlyDSL gfx942 kernel for the DeepSeek lightning indexer (fp8 MQA logits), a drop-in for the Triton fp8_mqa_logits. Includes an adaptive grid.y KV-column split for block-starved small-M/long-context prefill, in-kernel FP8 FN->FNUZ handling, and correctness tests vs the torch and Triton references. Also fixes the Triton fp8_mqa_logits mixed FN/FNUZ path (no-op for fnuz/fnuz inputs). Co-authored-by: Ville Pietilä <[email protected]> Co-authored-by: Kristoffer Peyron <[email protected]> Signed-off-by: Aakif Nawaz <[email protected]> * flydsl: fix i32 index overflow in fp8 MQA logits output write Co-authored-by: Ville Pietilä <[email protected]> Signed-off-by: Aakif Nawaz <[email protected]> * flydsl/triton: gate FN->FNUZ conversion to gfx942 Signed-off-by: Aakif Nawaz <[email protected]> * flydsl: name MFMA tile-dim constants (MFMA_M/N/K) Signed-off-by: Aakif Nawaz <[email protected]> * flydsl: refactor fp8_mqa_logits test to aiter-op-test standard Signed-off-by: Aakif Nawaz <[email protected]> --------- Signed-off-by: Aakif Nawaz <[email protected]> Co-authored-by: Ville Pietilä <[email protected]> (cherry picked from commit 0571aea)
1 parent 5a10402 commit 6f65fba

4 files changed

Lines changed: 951 additions & 0 deletions

File tree

‎aiter/ops/flydsl/__init__.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
from .moe_kernels import flydsl_moe_stage1, flydsl_moe_stage2
4242
from .fmha_kernels import flydsl_flash_attn_func
4343
from .kernels.qk_norm_rope_quant import flydsl_qk_norm_rope_quant
44+
from .kernels.fp8_mqa_logits import (
45+
flydsl_fp8_mqa_logits,
46+
KERNEL_VARIANTS as FP8_MQA_LOGITS_VARIANTS,
47+
DEFAULT_VARIANT as FP8_MQA_LOGITS_DEFAULT_VARIANT,
48+
)
4449

4550
# from .linear_attention_kernels import flydsl_gdr_decode
4651

@@ -51,5 +56,8 @@
5156
"flydsl_hgemm",
5257
"flydsl_flash_attn_func",
5358
"flydsl_qk_norm_rope_quant",
59+
"flydsl_fp8_mqa_logits",
60+
"FP8_MQA_LOGITS_VARIANTS",
61+
"FP8_MQA_LOGITS_DEFAULT_VARIANT",
5462
# "flydsl_gdr_decode",
5563
]

0 commit comments

Comments
 (0)