Individual skill

optimize-triton-ascend-grouped-attention-access

Optimize irregular KV-cache access in Triton-Ascend grouped decode attention by vector-loading contiguous inner dimensions, assembling discrete outer rows with CANN slice extensions, and transposing UB tiles for tl.dot. Use when an agent ports grouped-query decode attention whose K or V cache addresses are indirect and naive low-axis-discrete loads degrade to scalar memory access.

skills/optimize-triton-ascend-grouped-attention-access/SKILL.md

Read pinned source

Source commit 4ab5ee7adf47755ecd42723f55f4c58e38be95a7

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Instructions only
Last checked
Nov 4, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
189
Repository last updated
Aug 15, 2026
License
Apache-2.0

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# Optimize Triton-Ascend Grouped Attention Access

## Goal

Preserve vectorized contiguous loads while gathering KV-cache rows selected by an indirect token-location vector.

## Workflow

1. Classify each target tile by which axis is discrete and which axis is contiguous.
2. Load a discrete outer row and its contiguous head dimension as one vector.
3. Assemble BLOCK_N rows into an on-chip tensor with extension.insert_slice.
4. Transpose the assembled K tile when tl.dot requires HEAD_DIM by BLOCK_N.
5. Load V directly as BLOCK_N by VALUE_DIM when its inner value dimension is contiguous.
6. Feed the tiles into numerically stable online softmax across KV splits.