triton-ascend-case-reduction-mean-large

Optimize large-scale mean reduction with row-wise secondary partitioning in Triton on Ascend.

6|1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/xchang1121/AutoResearch-CC-hook --skill triton-ascend-case-reduction-mean-large
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: triton-ascend-case-reduction-mean-large
Source: https://github.com/xchang1121/AutoResearch-CC-hook/tree/main/skills/triton-ascend/cases/triton-ascend-case-reduction-mean-large
Command: npx skills add https://github.com/xchang1121/AutoResearch-CC-hook --skill triton-ascend-case-reduction-mean-large

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

这项技能通过在 Ascend 后端的 Triton 框架中对大规模均值归约进行行级二次切分优化,降低每个核的线程块数量并在内核内部进行二次切分以避免 UB,从而提升归约性能。

Core Features & Use Cases

  • 行级二次切分优化:通过跨多行计算来减少线程块数量,并在内核内对行进行二次切分以提升缓存命中与带宽利用率。
  • 自适应网格与自动调优:在 grid=40 的配置下,探索不同 BLOCK_SIZE_M / SUB_BLOCK_SIZE_M 的组合以达到最优性能。
  • Use Case:在二维归约场景中,非 reduce 轴中等、reduce 轴较大时可以获得显著的性能提升。

Quick Start

只需将待优化的归约核替换为本技能中的对照实现即可开始基线评测。

Frequently Asked Questions about triton-ascend-case-reduction-mean-large

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize large-scale mean reduction in Triton on Ascend?

Optimize large-scale mean reduction in Triton on Ascend by applying row-wise secondary partitioning to reduce thread blocks per core and avoid UB. This technique improves cache hits and bandwidth utilization for 2D reduction scenarios.

When do I need row-wise secondary partitioning for 2D reduction?

You need row-wise secondary partitioning for 2D reduction when your non-reduce axis is moderate and your reduce axis is large. This configuration allows grid sizes to match core counts and significantly boosts reduction performance.

How does autotune grid configuration affect Triton kernel optimization on Ascend?

Autotune grid configuration affects Triton kernel optimization on Ascend by exploring different BLOCK_SIZE_M and SUB_BLOCK_SIZE_M combinations under a grid=40 setup. This explicit tuning discovers the optimal partitioning strategy for maximum performance.

Does this Triton Ascend mean reduction approach work for small reduce axes?

This Triton Ascend mean reduction approach is not suited for small reduce axes. It is designed specifically for 2D reductions with moderate non-reduce axes and large reduce axes where grid equals the number of cores.

What is the best way to start benchmarking a Triton mean reduction kernel?

The best way to start benchmarking a Triton mean reduction kernel is to replace your existing reduction implementation with this row-wise secondary partitioning version. You can then immediately run baseline evaluations to compare performance.

Why does my large-scale mean reduction hit UB limitations on Ascend?

Large-scale mean reduction hits UB limitations on Ascend due to excessive thread blocks per core. Performing secondary partitioning inside the kernel avoids this bottleneck and improves bandwidth utilization.