What problem does it solve? Triton kernels running on Ascend NPU hardware often underperform due to suboptimal tiling, scalar degradation, discrete memory access, and missing autotune configurations. This Skill applies a disciplined, ordered scan of 33 documented optimization points to reduce kernel latency while guaranteeing functional and numerical consistency with the original code. ## Core Features & Use Cases - Ordered Optimization Scan: Loads an index of 33 optimization points (constexpr parameterization, tiling, core partitioning, scalar-to-vector conversion, CV fusion, FlashAttention/MLA specialization, autotune, block size scaling) and applies the first matching point per invocation. - Consistency Guarantees: Enforces a code checklist before any verification, requiring functional equivalence and no precision regression between original and optimized kernels. - IR-Based Analysis: Extracts final-stage MLIR (last_pass.mlir) via bishengir-compile to drive multi-round IR-guided optimization suggestions. - Use Case: Given a slow Triton-Ascend kernel for a matmul or pooling operator, invoke this Skill repeatedly from an outer loop; each call applies one optimization, writes the improved code to the output path, and reports which optimization point was hit. ## Quick Start Optimize my Triton kernel at kernels/bmm.py on Ascend NPU and write the improved version to output/bmm_opt.py, applying one optimization point per call.