Agent skill

Build Triton Ascend Padded Moe Routing

by Krusty84 in Krusty84/triton-ascend-agent-dev-kit

Build padded MoE gather, scatter, and router-weight-gradient kernels for Triton-Ascend using real cumulative bins, padded cumulative bins, UB slice assembly, and vector-core-aware tiling.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Build Triton Ascend Padded Moe Routing

skills CLI
$ npx skills add Krusty84/triton-ascend-agent-dev-kit --skill build-triton-ascend-padded-moe-routing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Krusty84/triton-ascend-agent-dev-kit build-triton-ascend-padded-moe-routing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Krusty84/triton-ascend-agent-dev-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/build-triton-ascend-padded-moe-routing .claude/skills/build-triton-ascend-padded-moe-routing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
build-triton-ascend-padded-moe-routing
GitHub stars
106
Token cost
~652 tokens
SKILL.md length
255 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
Apache-2.0

At a glance

Build padded MoE gather, scatter, and router-weight-gradient kernels for Triton-Ascend using real cumulative bins, padded cumulative bins, UB slice assembly, and vector-core-aware tiling.

  • Works in 6 steps: Sort assignments by expert to obtain… → Build bins from real cumulative counts. → Round each expert count to the required… → …
  • An agent ports MegaBlocks padded routing
  • SKILL.md covers Goal, Workflow, Implementation Pattern and Ascend Guardrails, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Build Triton Ascend Padded Moe Routing is an agent skill from Krusty84/triton-ascend-agent-dev-kit. Build padded MoE gather, scatter, and router-weight-gradient kernels for Triton-Ascend using real cumulative bins, padded cumulative bins, UB slice assembly, and vector-core-aware tiling. Use when an agent ports MegaBlocks padded routing, aligns each expert's token segment to a fixed multiple, restores weighted top-k outputs, or maps gradients through padded expert storage.

Its SKILL.md is about 650 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering. The repository describes itself as: A toolkit for AI agents used for development on Triton-Ascend for Ascend NPU. The licence is Apache-2.0.

When your agent uses it

  • An agent ports MegaBlocks padded routing
  • Aligns each experts token segment to a fixed multiple
  • Restores weighted top-k outputs
  • Maps gradients through padded expert storage

Example prompts

  • “/build-triton-ascend-padded-moe-routing”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Sort assignments by expert to obtain aligned indices and nondecreasing bin_ids.
  2. Build bins from real cumulative counts.
  3. Round each expert count to the required padding multiple and build padded_bins from cumulative padded counts.
  4. Map sorted position i to offset_in_expert = i - bins[e-1] and padded row = padded_bins[e-1] + offset_in_expert.
  5. Gather token indices[i] // TOP_K into that padded row.
  6. Scatter real rows back through unique assignment IDs and compute wgrad with the same mapping.

What it can do on your machine

Read from SKILL.md and the folder at commit 4ab5ee7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Build Triton Ascend Padded Moe Routing loads about 652 tokens when it runs. Until then it costs about 104 tokens; SKILL.md has 255 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~652

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Krusty84/triton-ascend-agent-dev-kit at commit 4ab5ee7, republished under its Apache-2.0 licence (© Krusty84). 255 words, ~652 tokens.

Download SKILL.mdSave it as .claude/skills/build-triton-ascend-padded-moe-routing/SKILL.md (or your agent's skills folder).
name
build-triton-ascend-padded-moe-routing
description
Build padded MoE gather, scatter, and router-weight-gradient kernels for Triton-Ascend using real cumulative bins, padded cumulative bins, UB slice assembly, and vector-core-aware tiling. Use when an agent ports MegaBlocks padded routing, aligns each expert's token segment to a fixed multiple, restores weighted top-k outputs, or maps gradients through padded expert storage.

Build Triton-Ascend Padded MoE Routing

Goal

Store every expert's real assignments in a separately padded segment, preserve zero-filled gaps, and implement inverse scatter and per-assignment weight gradients.

Workflow

  1. Sort assignments by expert to obtain aligned indices and nondecreasing bin_ids.
  2. Build bins from real cumulative counts.
  3. Round each expert count to the required padding multiple and build padded_bins from cumulative padded counts.
  4. Map sorted position i to offset_in_expert = i - bins[e-1] and padded row = padded_bins[e-1] + offset_in_expert.
  5. Gather token indices[i] // TOP_K into that padded row.
  6. Scatter real rows back through unique assignment IDs and compute wgrad with the same mapping.

Implementation Pattern

text
real_start = 0 if expert == 0 else bins[expert - 1]
padded_start = 0 if expert == 0 else padded_bins[expert - 1]
offset_in_expert = sorted_position - real_start
padded_row = padded_start + offset_in_expert
token = indices[sorted_position] // TOP_K

Use num_vectorcore programs over sorted positions, UB-buffered SUB_BLOCK_SIZE rows, and BLOCK_X feature tiles. Flush gather buffers on expert transitions; extract individual rows for scatter and wgrad.

Ascend Guardrails

  • Require bins and padded_bins to be monotonic, with padded segment lengths no smaller than real counts.
  • Allocate gather output with padded_bins[-1] rows and initialize it to zero.
  • Never process padding rows as real assignments.
  • Define weight indexing explicitly; for assignment-ID semantics, use weights[indices[position]], not a flattened feature address.
  • Require unique assignment IDs for non-atomic scatter and wgrad stores.
  • Align BLOCK_X for 32-byte transfers and budget UB for slices, indices, float32 temporaries, and multibuffering.
  • Set SUB_BLOCK_SIZE=1 when the hidden dimension must be accumulated across column tiles.

Verification

Compare all operations with a reference loop. Cover experts with zero tokens, counts exactly on and just over the padding multiple, multiple experts within one sub-block, TOP_K reduction, weighted scatter, hidden-size tails, and large routed batches.

© Krusty84, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/build-triton-ascend-padded-moe-routing of Krusty84/triton-ascend-agent-dev-kit.

Open the folder on GitHubat commit 4ab5ee7

Compare with similar skills

Build Triton Ascend Padded Moe Routing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Build Triton Ascend Padded Moe Routing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Build Triton Ascend Padded Moe Routing this skillKrusty84/triton-ascend-agent-dev-kit106—~652Automated safety check: PassApache-2.0
Agent BuildershareAI-lab/learn-claude-code78k4 repos~1.2kAutomated safety check: PassMIT
Add Uint Supportpytorch/pytorch104k2 repos~2.3kAutomated safety check: PassCustom licence
LLM Benchmarking with lm-evaluation-harnessOrchestra-Research/AI-Research-SKILLs13k8 repos~3kAutomated safety check: PassMIT
Segment Anything Model GuideOrchestra-Research/AI-Research-SKILLs13k8 repos~3.3kAutomated safety check: PassMIT
1passwordtrpc-group/trpc-agent-go1.9k14 repos~656Automated safety check: PassApache-2.0

Similar skills

  • Agent Builder

    shareAI-lab/learn-claude-code

    Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.

    78k GitHub starsUsed in 4 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Add Uint Support

    pytorch/pytorch

    Add unsigned integer (uint) type support to PyTorch operators by updating ATDISPATCH macros.

    104k GitHub starsUsed in 2 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • LLM Benchmarking with lm-evaluation-harness

    Orchestra-Research/AI-Research-SKILLs

    Runs lm-evaluation-harness to benchmark language models on academic suites such as MMLU, GSM8K and HumanEval, compare models and track training checkpoints.

    13k GitHub starsUsed in 8 repos~3k tokens
    AI & LLM EngineeringAuto-check passed
  • Segment Anything Model Guide

    Orchestra-Research/AI-Research-SKILLs

    Guide to using Meta's Segment Anything Model for zero-shot image segmentation with point, box or mask prompts, or automatic mask generation.

    13k GitHub starsUsed in 8 repos~3.3k tokens
    AI & LLM EngineeringAuto-check passed
  • 1password

    trpc-group/trpc-agent-go

    Set up and use 1Password CLI (op). An agent skill from trpc-group/trpc-agent-go.

    1.9k GitHub starsUsed in 14 repos~656 tokens
    AI & LLM EngineeringAuto-check passed
  • Planning With Files

    jarrodwatts/claude-code-config

    Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage.

    1.1k GitHub starsUsed in 5 repos~967 tokens
    AI & LLM EngineeringAuto-check passed

More from Krusty84/triton-ascend-agent-dev-kit

All 23 skills in this repo
  • Triton-Ascend Token Pool Assignment

    Krusty84/triton-ascend-agent-dev-kit

    Implements request-to-token-pool copies for Triton kernels on Ascend NPUs, replacing loop-carried vector offsets with fixed-offset block loops that compile reliably.

    106 GitHub stars~564 tokensUpdated 1 mo ago
    Auto-check passed
  • Triton-Ascend Batch Token Reorder

    Krusty84/triton-ascend-agent-dev-kit

    Writes a Triton kernel pattern for Ascend NPU that gathers several indexed token rows per program into an on-chip buffer and stores one contiguous output tile, for MoE-style token reordering.

    106 GitHub stars~597 tokensUpdated 1 mo ago
    Auto-check passed
  • Triton-Ascend Binned MoE Routing

    Krusty84/triton-ascend-agent-dev-kit

    Builds Triton-Ascend kernels that pack sorted token assignments into fixed expert-capacity tensors, restore top-k outputs and compute router-weight gradients on Ascend NPUs.

    106 GitHub stars~662 tokensUpdated 1 mo ago
    Auto-check passed
  • Triton-Ascend Fused Attention

    Krusty84/triton-ascend-agent-dev-kit

    Guides building a FlashAttention-v2-style fused forward attention kernel for Triton-Ascend on Ascend NPU, with online softmax, causal staging and float32 accumulation.

    106 GitHub stars~753 tokensUpdated 1 mo ago
    Auto-check passed
  • Triton-Ascend Fused Softmax

    Krusty84/triton-ascend-agent-dev-kit

    Builds a fused row-wise softmax kernel for Triton-Ascend that reads and writes each row once, handling padding, strides and masked loads on Ascend NPUs.

    106 GitHub stars~636 tokensUpdated 1 mo ago
    Auto-check passed
  • Build Triton Ascend Layer Norm

    Krusty84/triton-ascend-agent-dev-kit

    Build a fused forward LayerNorm kernel for Triton-Ascend with row-wise mean and variance reductions, float32 accumulation, affine weight and bias, and masked feature tiles.

    106 GitHub stars~659 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Build Triton Ascend Padded Moe Routing

What does Build Triton Ascend Padded Moe Routing do?

Build padded MoE gather, scatter, and router-weight-gradient kernels for Triton-Ascend using real cumulative bins, padded cumulative bins, UB slice assembly, and vector-core-aware tiling. Build Triton Ascend Padded Moe Routing is an agent skill from Krusty84/triton-ascend-agent-dev-kit. Build padded MoE gather, scatter, and router-weight-gradient kernels for Triton-Ascend using real cumulative bins, padded cumulative bins, UB slice assembly, and vector-core-aware tiling.

When should I use Build Triton Ascend Padded Moe Routing?

Build Triton Ascend Padded Moe Routing fits situations like: an agent ports MegaBlocks padded routing; aligns each experts token segment to a fixed multiple; restores weighted top-k outputs; maps gradients through padded expert storage.

How do I install Build Triton Ascend Padded Moe Routing in Claude Code?

Run `npx skills add Krusty84/triton-ascend-agent-dev-kit --skill build-triton-ascend-padded-moe-routing -a claude-code`. Or copy the skill folder (skills/build-triton-ascend-padded-moe-routing in Krusty84/triton-ascend-agent-dev-kit) into .claude/skills/build-triton-ascend-padded-moe-routing in your project. Claude Code loads it when a task matches its description.

How do I install Build Triton Ascend Padded Moe Routing in Codex?

Run `npx skills add Krusty84/triton-ascend-agent-dev-kit --skill build-triton-ascend-padded-moe-routing -a codex`. Or copy the skill folder (skills/build-triton-ascend-padded-moe-routing in Krusty84/triton-ascend-agent-dev-kit) into .agents/skills/build-triton-ascend-padded-moe-routing in your project. Codex loads it when a task matches its description.

Can I use Build Triton Ascend Padded Moe Routing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Krusty84/triton-ascend-agent-dev-kit --skill build-triton-ascend-padded-moe-routing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/build-triton-ascend-padded-moe-routing, .gemini/skills/build-triton-ascend-padded-moe-routing, .github/skills/build-triton-ascend-padded-moe-routing and .opencode/skills/build-triton-ascend-padded-moe-routing in your project.

What does Build Triton Ascend Padded Moe Routing need to run?

SKILL.md names no scripts, command-line tools or credentials: Build Triton Ascend Padded Moe Routing is instructions for the agent only.

Does Build Triton Ascend Padded Moe Routing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Build Triton Ascend Padded Moe Routing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Build Triton Ascend Padded Moe Routing use?

Build Triton Ascend Padded Moe Routing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Build Triton Ascend Padded Moe Routing use?

About 652 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Build Triton Ascend Padded Moe Routing?

Skills that share tags, products or a category with Build Triton Ascend Padded Moe Routing: Agent Builder (shareAI-lab/learn-claude-code, 78k stars), Add Uint Support (pytorch/pytorch, 104k stars), LLM Benchmarking with lm-evaluation-harness (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Segment Anything Model Guide (Orchestra-Research/AI-Research-SKILLs, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Build Triton Ascend Padded Moe Routing?

Krusty84 (a GitHub user) maintains it in Krusty84/triton-ascend-agent-dev-kit, which has 106 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on August 15, 2026.

Source: Krusty84/triton-ascend-agent-dev-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.