Individual skill
build-triton-ascend-vector-add
Build and debug masked one-dimensional elementwise kernels for Triton-Ascend, including launch wrappers and PyTorch/NPU correctness checks. Use when an agent needs a minimal Triton-Ascend kernel scaffold or must apply program IDs, pointer offsets, tail masks, constexpr block sizes, and launch grids to vector operations.
skills/build-triton-ascend-vector-add/SKILL.md
Source commit 4ab5ee7adf47755ecd42723f55f4c58e38be95a7
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- 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
- operations Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Read excerpt
# Build Triton-Ascend Vector Add
## Goal
Implement a standalone NPU kernel that computes elementwise addition for arbitrary tensor lengths. Reuse the same pattern for other one-dimensional elementwise operations.
## Workflow
1. Require both inputs to have the same shape, dtype, device, and supported layout.
2. Allocate the output with torch.empty_like and use output.numel() as the logical length.
3. Assign one contiguous block to each Triton program.
4. Mask every load and store so non-divisible tail elements never access invalid memory.
5. Derive the launch grid from the selected BLOCK_SIZE.