Individual skill
prevent-triton-ascend-ub-overflow
Prevent Triton-Ascend Unified Buffer overflow by streaming large logical vectors through bounded compile-time tiles with masked loop iterations. Use when an agent ports a GPU kernel that loads a long sequence or metadata array at once, compilation reports UB pressure, or runtime shapes such as KV-page allocation exceed safe on-chip capacity.
skills/prevent-triton-ascend-ub-overflow/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
- engineering 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
# Prevent Triton-Ascend UB Overflow
## Goal
Keep each live tile within Ascend UB while preserving the semantics of a larger logical operation.
## Workflow
1. List all simultaneously live tensors and estimate their bytes, including padding and multibuffer copies.
2. Select a BLOCK_SIZE that fits the UB budget with safety margin.
3. Replace one load over the maximum logical length with a compile-time loop over BLOCK_SIZE tiles.
4. Recompute global offsets from the loop index and apply a runtime validity mask.
5. Store each completed tile before advancing so earlier tiles do not remain live.