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 pypto-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/pypto-api)<a href="https://agentmods.dev/skills/mindspore-ai/akg/pypto-api"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/pypto-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/pypto-api"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/pypto-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.00018 | $0.01576 |
| Opus 5.5 | $0.00007 | $0.00630 |
| Sonnet 5.5 | $0.00004 | $0.00315 |
| Haiku 4.5 | $0.00002 | $0.00158 |
Grade A, and why
pypto-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 3mo 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 — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PyPTO API 速查
Kernel 装饰器
@pypto.frontend.jit(
runtime_options={"run_mode": _PYPTO_RUN_MODE},
debug_options={"runtime_debug_mode": _PYPTO_RUNTIME_DEBUG_MODE},
)
def kernel(x: pypto.Tensor(shape_tuple, dtype)) -> pypto.Tensor(shape_tuple, dtype):
...
张量
| API | 用途 | 示例 |
|---|---|---|
pypto.Tensor(shape, dtype) |
输入/输出类型标注 | x: pypto.Tensor((m, k), pypto.DT_FP32) |
pypto.tensor(shape_list, dtype) |
kernel 内创建输出 | output = pypto.tensor([m, n], pypto.DT_FP32) |
pypto.zeros(shape_list, dtype=) |
零初始化张量(累加器) | acc = pypto.zeros([1], dtype=pypto.DT_FP32) |
pypto.full(shape, val, dtype, valid_shape=) |
常量填充张量 | ones = pypto.full(s, 1.0, pypto.DT_FP32, valid_shape=s) |
数据类型:pypto.DT_FP32、pypto.DT_INT32、pypto.DT_INT64(INT64 仅用于输入标注)。
Tile 配置
| API | 约束 |
|---|---|
pypto.set_vec_tile_shapes(*shapes) |
参数个数 = 被操作张量 rank |
pypto.set_cube_tile_shapes(m, k, n, l1, split_k) |
固定 5 参数 |
tile 双约束:
prod(tile_shape)≤ 16384auto_tiles = prod(每维 ceil(shape[i]/tile[i]))≤ 2048(每个 op)
- 必须在任何计算操作之前调用。一个 kernel 内可多次切换 tile。
- 若
auto_tiles > 2048,优先改为loop + view/assemble分块实现。 - vec tile 推荐:
(8192)(1D)、(1, 16384)(2D)、(1, 1, 16384)(3D) - cube tile 推荐:
set_cube_tile_shapes([128, 128], [32, 128], [256, 256], True, False)
分块
| API | 用途 | 约束 |
|---|---|---|
pypto.loop(start, end, step, name=, idx_name=) |
编译期循环 | 不嵌套、尽量少用 |
pypto.view(tensor, shape, offset) |
切片提取(等价 tensor[a:b, c:d]) |
shape 各维为编译期常量,rank 不变,每维 ≤ 输入对应维 |
pypto.assemble(chunk, offset, output) |
写回子块(等价切片赋值) | 无 |
pypto.view 不是 reshape。它是 tensor[offset[0]:offset[0]+shape[0], ...] 的等价 API。不能改变维度数,不能改变维度排布。所有 reshape 必须在 forward 中用 torch 完成。
算术运算
运算符规则:+ * 支持标量在任意位置;- / 要求 tensor 在左侧(1.0 - x crash)。
函数调用:pypto.add/sub/mul/div 第一参数必须 Tensor。
一元取反 -x:不支持,用 pypto.mul(x, -1.0) 或 x * (-1.0)。
切片赋值:output[:] = expr
数学函数
| 函数 | 说明 |
|---|---|
pypto.exp(x) |
指数 |
pypto.log(x) |
对数 |
pypto.sqrt(x) |
平方根 |
pypto.abs(x) |
绝对值 |
pypto.sigmoid(x) |
sigmoid |
pypto.softmax(x, dim=) |
softmax |
pypto.maximum(a, b) |
逐元素最大,b 可以是标量:pypto.maximum(x, 0.0) |
pypto.minimum(a, b) |
逐元素最小,b 可以是标量:pypto.minimum(x, 0.0) |
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.
- 3mo ago First seen · 117 lines · 18 tokens per session scan A 48a44a183214
pypto-api is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed today), licensed Apache-2.0. It adds 18 tokens to every session and 1,576 once invoked, about $0.0001 per session on Opus 5.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.
pypto-api compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pypto-apimindspore-ai/akg | Skill | 269 | today | Apache-2.0 | A | 18 | Claude Code, Codex |
| pypto-basicswenyi-li/awesome-agent-kernel-skills | Skill | 11 | 6mo ago | none | A | 14 | Claude Code, Codex |
| pypto-apiwenyi-li/awesome-agent-kernel-skills | Skill | 11 | 6mo ago | none | A | 18 | Claude Code, Codex |
| matlabK-Dense-AI/scientific-agent-skills | Skill | 59k | 3d ago | MIT | A | 44 | Claude Code |
| holoscan-install-wheelNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 34 | Claude Code, Codex |
| future-self-liteTHU-MAIC/OpenMAIC | Skill | 46k | today | MIT | A | 20 | Claude Code, Codex |
| rocm-kernelshuggingface/kernels | Skill | 799 | today | Apache-2.0 | A | 93 | Claude Code |