Individual skill
batch-triton-ascend-token-reorder
Batch MoE token reordering in Triton-Ascend with contiguous index loads, random source-row reads, extension.insert_slice assembly in UB, and coalesced output stores. Use when an agent must implement output[j] = input[indices[j]] on Ascend NPU and one-program-per-token GPU tiling creates too many logical cores or scattered writes.
skills/batch-triton-ascend-token-reorder/SKILL.md
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.
- ai Repository topic
- ascend Repository topic
- ascend-npu Repository topic
- npu Repository topic
- triton Repository topic
- triton-ascend Repository topic
- claude-code Repository topic
- codex Repository topic
- opencode Repository topic
- engineering Derived category
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
# Batch Triton-Ascend Token Reorder
## Goal
Gather several indexed token rows per program, assemble them in an on-chip buffer, and write one contiguous output tile.
## Workflow
1. Treat input and output as S by D and indices as a length-S integer vector.
2. Assign BLOCK_SIZE consecutive output rows to each program.
3. Load their indices as one vector.
4. Loop over valid rows, load each indexed D-element source row, and insert it into a BLOCK_SIZE by D UB tensor.
5. Store the assembled tile with row and column masks.