[NPU] Track reverting Ascend Atlas 950 workarounds after triton-ascend upstream fixes (#1464)
Summary
PR #1464 landed Ascend A3/Atlas 950 UB tile capping plus temporary kernel workarounds so group norm, GRPO/CISPO/SAPO, and fused MoE pass on Atlas 950 while triton-ascend compiler bugs are still open.
This issue tracks removing or narrowing those workarounds once a released triton-ascend build contains the upstream fixes. It does not track the ub_manager 4/3 auto-multi-buffer cap (8ba7d90); that is a Liger tiling policy, not a compiler workaround.
Upstream bugs (filed, workarounds in #1464)
| triton-ascend issue | A5 symptom | Liger workaround | Location |
|---|---|---|---|
| #2239 | BiShengHIR memref.extract_strided_metadata when dynamic task_base + tl.sum(..., axis=1) on padded 2-D tiles (e.g. group norm (1,1,1,3)) |
Use full-tile tl.sum(X_vals) / tl.sum(X_vals * X_vals) instead of axis=1 (equivalent for cpg=1) |
src/liger_kernel/ops/backends/_ascend/ops/group_norm.py (_group_norm_forward_single_task_kernel) |
| #2246 | Compile-time UB overflow on large-vocab scans with tl.static_range + bf16→fp32 online softmax (V=151936) |
Inner vocab loops: tl.static_range → tl.range(0, N, BLOCK_N) |
src/liger_kernel/ops/backends/_ascend/ops/grpo_loss.py (fwd / softmax / bwd) |
| #2247 | 2-D reduction over [TPT, K_POW2] drops lanes when K_POW2 < 8 (MoE router histogram undercount; Mixtral K=2 → 256 instead of 1024) |
Pad inner dim to HIST_K_POW2 = max(8, K_POW2), keep k < K mask |
src/liger_kernel/ops/backends/_ascend/ops/fused_moe_kernels.py (_moe_router_histogram_kernel) |
These are A5 pipeline / compiler bugs, not application-logic errors. A3 (A2/A3 pipeline) did not need the same kernel rewrites for the cases we tested.
Additional fused-MoE A5 workarounds (same commit, not covered by #2239/#2246/#2247)
These are still in tree and should be tracked separately (or new triton-ascend issues) before we fully restore the original kernels:
| Item | Symptom (A5) | Workaround in Liger |
|---|---|---|
| Token gather H=128 | TILE_H == BLOCK_H == 128 gather/reduce wrong; pad to BLOCK_H + BLOCK_H//2 restores |
TILE_H padding |
Bwd down-proj tl.dot |
Multi-row M-tile + tl.dot incorrect |
One row per program (pid_base / row_mask) |
Bwd dX_expanded |
Nested H+I tl.range in one program fails |
Launch (num_rows, n_h_tiles) (H on grid) |
bf16 tl.sum(..., axis=0) on [K, H] |
K-reduce unsafe | Explicit mask weights |
Exit criteria (when to close this issue)
For each of #2239 / #2246 / #2247:
- Upstream issue is fixed in a released
triton-ascend(record version). - On A5, revert only that workaround and confirm:
- the original Triton form compiles and matches the current kernel numerically;
pytestfor the corresponding files is green (test_group_norm.py,test_grpo_loss.py,test_fused_moe.py/ Mixtral experts).
- Open a Liger PR that drops or narrows that workaround (prefer one PR per upstream fix). Do not wait to revert all three at once.
Suggested verification:
# GroupNorm: original axis=1 reduce
pytest test/transformers/test_group_norm.py
# GRPO: original tl.static_range vocab scan (include V=151936)
pytest test/transformers/test_grpo_loss.py
# MoE histogram: original K_POW2 (no HIST_K_POW2 pad); run fused_moe in a subprocess
pytest test/transformers/test_fused_moe.py
pytest test/transformers/test_swiglu.py::test_correctness_mixtralexpertsKeep ub_manager 4/3 UB cap unless a later measurement shows it is no longer needed on A3/A5.
Out of scope
- A3 vs A5 pytest skip/pass count differences caused by
transformers/ HBM skip marks (not kernel bugs). - Running
test_fused_moe.pyin-process with the rest of the suite (can poison the NPU); that is test isolation, not a compiler fix.
Links
- Merged PR: https://github.com/linkedin/Liger-Kernel/pull/1464
- Merge commit:
09f7feb - triton-ascend: #2239, #2246, #2247
Source: linkedin/Liger-Kernel