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-cuda-apigit 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-cuda-api)<a href="https://agentmods.dev/skills/mindspore-ai/akg/triton-cuda-api"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/triton-cuda-api/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-cuda-api"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/triton-cuda-api.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.00069 | $0.02816 |
| Opus 5 | $0.00034 | $0.01408 |
| Sonnet 5 | $0.00014 | $0.00563 |
| Haiku 4.5 | $0.00007 | $0.00282 |
Grade A, and why
triton-cuda-api 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 316 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Triton CUDA API 参考手册
本文档提供 Triton 核心 API 的详细参考,包括函数签名、参数说明和使用示例。
1. 内核装饰器
@triton.jit
@triton.jit
def kernel_function(...):
pass
- 作用: 将 Python 函数编译为 GPU 内核
- 约束: 函数内部不能使用
return、break、continue语句
2. 程序 ID 与网格 API
tl.program_id(axis)
pid = tl.program_id(axis) # axis: 0, 1, or 2
- 参数:
axis- 维度轴 (0, 1, 2) - 返回: 当前程序在该轴上的 ID
- 用途: 确定当前程序块处理的数据范围
tl.num_programs(axis)
num_pids = tl.num_programs(axis) # axis: 0, 1, or 2
- 参数:
axis- 维度轴 (0, 1, 2) - 返回: 该轴上的总程序数
- 用途: 计算网格大小和边界条件
triton.cdiv(a, b)
grid_size = triton.cdiv(total_elements, block_size)
- 参数:
a,b- 被除数和除数 - 返回: 向上取整的除法结果
- 用途: host 侧使用,计算启动网格大小
3. 内存操作 API
tl.load(pointer, mask=None, other=None, boundary_check=None)
data = tl.load(ptr + offsets, mask=mask, other=0.0)
- 参数:
pointer: 内存指针mask: 布尔掩码,True 表示有效位置other: 掩码为 False 时的默认值boundary_check: 边界检查维度 (0, 1) 或 None
- 返回: 加载的张量数据
- 用途: 从全局内存加载数据
tl.store(pointer, value, mask=None, boundary_check=None)
tl.store(ptr + offsets, result, mask=mask)
- 参数:
pointer: 内存指针value: 要存储的值mask: 布尔掩码,True 表示有效位置boundary_check: 边界检查维度 (0, 1) 或 None
- 用途: 将数据存储到全局内存
tl.make_block_ptr(base, shape, strides, offsets, block_shape, order)
block_ptr = tl.make_block_ptr(
base=ptr, # 基础指针
shape=(M, N), # 完整矩阵形状
strides=(stride_m, stride_n), # 步长
offsets=(start_m, start_n), # 当前块偏移
block_shape=(BLOCK_M, BLOCK_N), # 块形状
order=(1, 0) # 内存布局顺序
)
- 参数:
base: 基础内存指针shape: 完整张量的形状strides: 每个维度的步长offsets: 当前块的起始偏移block_shape: 当前块的大小order: 内存布局顺序 (1, 0) 表示行主序
- 返回: 块指针对象
- 用途: 高效访问 2D 数据块
tl.advance(ptr, offsets)
block_ptr = tl.advance(block_ptr, (BLOCK_M, 0))
- 参数:
ptr: 块指针offsets: 各维度的偏移量
- 返回: 移动后的块指针
- 用途: 移动块指针到下一个位置
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.
- 6d ago First seen · 316 lines · 69 tokens per session scan A 64c66001e273
triton-cuda-api is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 29d ago), licensed Apache-2.0. It adds 69 tokens to every session and 2,816 once invoked, about $0.0003 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-09-03.
Other skills, from other repositories
course
A Python helper that displays tutorials, group information, source-code links, and other resources for the python-office library in a terminal.
notebook.create_api_intro
Create a notebook to present the API of a package.
notebook.outline_ideas
Create a set of ideas for Jupyter notebooks to explore ideas and concepts.
python-fast-skill
A beginner-friendly guide to core Python concepts, including syntax, data types, functions, classes, errors, files, packages, and concurrency.
jupyter-to-marimo
Convert a Jupyter notebook (.ipynb) to a marimo notebook (.py).
with-scripts
Bundled Gmail CLI example demonstrating the scripts/ entrypoint + src/ implementation split. Use as a template when your course ships real code that goes beyond a single shell script. Shows how to organize a course bundle that owns its codebase — no runtime package installation, all dependencies stdlib-only. Replaces…