Skip to content

[Withdrawn] RoPE masking: original Ascend kernel already supports stacked heads - #13

Closed
McZyWu wants to merge 1 commit into
zhaozx-cn:a5-k3-0828from
McZyWu:fix/k3-stacked-rope-heads-20260909
Closed

McZyWu wants to merge 1 commit into
zhaozx-cn:a5-k3-0828from
McZyWu:fix/k3-stacked-rope-heads-20260909

Conversation

@McZyWu

@McZyWu McZyWu commented Sep 8, 2026 •

Copy link
Copy Markdown

Withdrawn after a direct comparison with the existing Ascend kernel

The original premise was incorrect for the installed Ascend Triton compiler: the existing kernel already compiles and produces correct output for 3, 5, 6, 10 and 20 heads. Ten original-kernel NPU configurations, including non-power-of-two query/KV heads, sliced strides, full/partial RoPE and dynamic graph inputs, pass an independent reference check.

A direct stacked-kernel A/B also shows the proposed masked specialization is slightly slower. Seven alternating trials, 100 operations captured per graph, 3 replays per measurement, on A3 with another model resident:

Tokens / Q heads / KV heads Existing kernel us Proposed mask us
32 / 5 / 3 4.086 4.194
256 / 5 / 3 19.382 19.535
32 / 10 / 6 4.072 4.341
256 / 10 / 6 19.667 19.783
32 / 20 / 10 4.242 4.507
256 / 20 / 10 19.966 20.170

Outputs match bitwise. The earlier comparison of five per-layer calls versus one stacked call measured the benefit of stacking; it did not establish any benefit over the existing stacked kernel. It must not be used to justify this replacement.

This PR is closed and its merge is reverted from the local performance integration. Framework PR31 keeps the separately validated 2D-to-3D input adaptation and does not require this PR. No TPOT benefit is attributed to kernel PR13.

@McZyWu McZyWu changed the title fix(npu): support non-power-of-two stacked RoPE heads [Withdrawn] RoPE masking: original Ascend kernel already supports stacked heads Sep 8, 2026
@McZyWu McZyWu closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant