Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add mindspore-ai/akg --skill triton-ascendgit clone --depth 1 https://github.com/mindspore-ai/akgWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mindspore-ai/akg/triton-ascend)<a href="https://agentmods.dev/skills/mindspore-ai/akg/triton-ascend"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/triton-ascend/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/mindspore-ai/akg/triton-ascend"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/triton-ascend.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00028 | $0.00715 |
| Opus 5 | $0.00014 | $0.00358 |
| Sonnet 5 | $0.00006 | $0.00143 |
| Haiku 4.5 | $0.00003 | $0.00072 |
Grade A, and why
triton-ascend scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Triton Ascend NPU编程指南
基于 AKG Agents resources/docs/triton_ascend_docs
核心概念
内核 (Kernel)
- 定义: 使用
@triton.jit装饰的Python函数 - 特点: 并行执行,通过程序ID区分
网格与块
- 网格: 并行维度配置
- 块: 数据块大小
- 关系:
grid_size = ceil(total_elements / block_size)
内存层次
- 全局内存: 所有程序可访问,延迟高
- 共享内存: 块内共享,延迟低
- 寄存器: 线程私有,最快
标准内核结构
@triton.jit
def standard_kernel(output_ptr, input_ptr, n_elements, BLOCK_SIZE: tl.constexpr):
# 1. 获取程序ID和计算偏移
pid = tl.program_id(0)
offsets = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)
# 2. 创建边界掩码
mask = offsets < n_elements
# 3. 加载数据
data = tl.load(input_ptr + offsets, mask=mask)
# 4. 执行计算
result = compute_function(data)
# 5. 存储结果
tl.store(output_ptr + offsets, result, mask=mask)
三大编程模式
1. 向量操作模式
适用于元素级运算。
2. 归约模式
适用于聚合操作。
3. 矩阵乘法模式
使用分块策略。
Ascend NPU特性
NPU架构特点
- AI Core执行计算
- 高带宽内存(HBM)
- 统一虚拟内存
优化建议
- 利用NPU的矩阵计算单元
- 优化数据布局
- 使用合适的block size
- 考虑内存对齐
完整示例
参考: python/akg_agents/op/resources/docs/triton_ascend_docs/examples/
- torch_matmul.py
- torch_layer_norm.py
- torch_softmax.py
- torch_vector_add.py
最佳实践
- 始终使用mask处理边界
- Block size选择2的幂
- 测试不同配置找到最优
- 注意NPU特定的内存访问模式
相关资源
- API文档: triton_ascend_docs/api/api.md
- 建议文档: triton_ascend_docs/suggestion_docs.md
- 示例代码: triton_ascend_docs/examples/
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 100 lines · 28 tokens per session scan A ed5cecb4b9c6
triton-ascend is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 28 tokens to every session and 715 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
cardputer-buddy
Iterate on the Cardputer-Adv MicroPython app bundle (Claude Buddy, Snake, Hello) after the device is already provisioned via m5-onboard. Use when the user wants to add a new app, push a single changed .py without re-flashing, watch device serial logs, or run a one-shot REPL command. Trigger on "add an app", "push to…
holoscan-install-wheel
Install Holoscan SDK Python wheel via pip into a venv. Use for Python installs; not for native C++/apt or Conda installs.
HA Integration Dev
Home Assistant custom integration development in Python. Covers customcomponents, DataUpdateCoordinator, configflow, OAuth2, conversation agent, HACS publishing, device registry, entity platforms, services, repair issues, diagnostics, Bluetooth integrations, and multi-coordinator patterns.
xpu-port
Execute a single-target CUDA-to-XPU port of a PyTorch repo with libcst-based scan, mechanical rewrite, and CPU FP64 vs target-dtype correctness verify on one forward pass. Use when the request says "port" — "port my repo to XPU", "port my repo at to XPU", "rewrite the CUDA calls to XPU", "apply the mechanical…
triton-lang
Triton language skill for Python GPU kernel authoring. Use when writing Triton kernels with @triton.jit, tl.load/store, masking, atomics, benchmarking with triton.testing, or integrating kernels into PyTorch. Activates on queries about Triton, tl.constexpr, block pointers, Triton benchmarking, or PyTorch custom ops.
pywayne-cv-camera-model
Camera model wrapper for cameramodels C++ library via pybind11. Use when working with pywayne.cv.cameramodel module to load camera models from YAML configuration files, access camera properties (model type, image size, parameters), perform projection operations (liftprojective, spacetoplane), and export camera…