Open
[Feature]: [DeepSeek V4] Fused QuantLightningIndexerFlashAttention (LIFA) operator for decode #432
yasakova_anastasiaAdd on 7 days ago
6 days ago Assign yasakova_anastasia as responsible person
yasakova_anastasia
3 days ago Comments:
3 days ago Comments:
@lululu40888
We can close this issue because PR #744 was merged


wangzheng97
1 day ago Comments:
1 day ago Comments:
PR已合入 master。感谢贡献,关闭此 Issue。


Feature Description / 功能描述
Thanks for sending a feature request! Please fill in the following template.
感谢提交功能需求!请填写以下模板。
Feature Description / 功能描述
Add QuantLightningIndexerFlashAttention (LIFA): a single PyPTO operator that
covers three consecutive stages of the DeepSeek V4 lightning-attention decode
path.
qr,inverse RoPE, Hadamard transform, per-token-head quantization
->
q(int8),q_scale(fp16),weights(fp16).cache, weighted reduction, key rescaling, TopK selection
->
topk_res(int32).topk_res, then C1 (QK) / V1 (softmax with attention sink) / C2 (PV)->
attention_out(bf16).Scope: decode phase only
Use Case / 应用场景
The current PyPTO decode path runs seven operators at 38.72 ms per token against 27.32 ms for the AscendC reference — 0.71x. The gap is dominated by host-side dispatch and by intermediate tensors crossing the kernel boundary.
Three of the seven operators are strictly sequential and exchange data no other consumer needs.
Fusing these stages is the largest single dispatch-overhead reduction available on this path without touching the remaining operators.
Expected Behavior / 期望行为
placed in an otherwise-AscendC stack.
Additional Information / 附加信息
Measured on the model, decode latency per token:
HW: 4x Ascend910C
Use Case / 应用场景
Expected Behavior / 期望行为
Additional Information / 附加信息