triton-ascend-case-matmul-swizzle2d

Optimize large-scale Ascend matrix multiplication with Swizzle2D grouping.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large-scale matrix multiplication on Ascend suffers from poor cache locality and load imbalance when launching many blocks. This Skill applies a Swizzle2D-based grouping and a fixed-core startup to improve data reuse and balance across cores for large A[M,K] x B[K,N] matrices.

Core Features & Use Cases

  • Fixed-core startup: grid=(num_cores,), each core processes multiple blocks.
  • Swizzle2D block reordering: group-level data locality, improved cache hits.
  • Adaptive grouping direction: choose row- or column-first grouping based on M vs N.
  • Block-size tuning: select BLOCK_M, BLOCK_K, BLOCK_N for the data type and cache size.

Quick Start

Run the Swizzle2D matmul optimization on Ascend for a large A[M,K] x B[K,N] workload to evaluate performance improvements.

Frequently Asked Questions about triton-ascend-case-matmul-swizzle2d

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

FAQPage Schema
How do I improve cache locality for large-scale matrix multiplication on Ascend?

To improve cache locality for Ascend matrix multiplication, apply Swizzle2D grouping. This reorders blocks at the group level to maximize data reuse and increase cache hits across processing cores.

Why does large dense matmul on Ascend suffer from load imbalance and how is it fixed?

Large dense matmul on Ascend suffers from load imbalance when launching many blocks. Fixed-core startup fixes this by assigning a grid of cores to process multiple blocks, balancing computation across the hardware.

Can I use Swizzle2D grouping for small matrix workloads on Ascend?

Swizzle2D grouping targets large dense matmul workloads on Ascend hardware. It is designed for contexts where kernel scheduling and data reuse dominate performance, making it unsuitable for small matrix operations.

What's the best way to tune block sizes for Ascend matmul kernels?

The best way to tune block sizes for Ascend matmul kernels is to select BLOCK_M, BLOCK_K, and BLOCK_N based on your specific data type and cache size. This block-size tuning ensures optimal throughput.

How does adaptive grouping direction work for A[M,K] x B[K,N] matrices?

Adaptive grouping direction works by automatically choosing row- or column-first grouping based on the M vs N dimensions of your A[M,K] x B[K,N] matrices. This ensures balanced computation and optimal cache locality.