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 tilelang-cuda-basicsgit 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/tilelang-cuda-basics)<a href="https://agentmods.dev/skills/mindspore-ai/akg/tilelang-cuda-basics"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-basics/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/tilelang-cuda-basics"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-basics.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.00024 | $0.03275 |
| Opus 5.5 | $0.00010 | $0.01310 |
| Sonnet 5.5 | $0.00005 | $0.00655 |
| Haiku 4.5 | $0.00002 | $0.00328 |
Grade A, and why
tilelang-cuda-basics 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 — 310 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TileLang CUDA 编程基础
1. 核心概念
TileLang 简介
- 定义: TileLang 是专为高性能 GPU/CPU 内核开发设计的领域特定语言(DSL),采用类似 Python 的语法,底层基于 TVM 编译器
- 特点: 专注于生产力而不牺牲底层优化能力,提供三层抽象级别
编程接口层次
- Level 1 (硬件无关): 编译器自动处理内存层次和硬件特定优化,适合快速原型开发
- Level 2 (硬件感知 + Tile库): 提供预定义 Tile 库操作和模式,适合大多数高性能计算应用
- Level 3 (硬件感知 + 线程原语): 提供线程原语和低级构造的直接访问,适合极致性能优化
内核 (Kernel)
- 定义: 使用
@tilelang.jit装饰的函数,编译后在 GPU 上并行执行 - 结构: 内部包含
@T.prim_func装饰的主函数,通过T.Kernel上下文管理器定义并行执行逻辑
网格 (Grid) 与线程块
- 网格: 内核启动时的并行维度配置,使用
T.ceildiv计算块数 - 线程块: 每个块包含指定数量的线程,通过
threads参数设置 - 块索引:
T.Kernel上下文返回(bx, by)对应blockIdx.x, blockIdx.y
内存层次
- 全局内存 (Global Memory): GPU 主内存(HBM),所有线程可访问
- 共享内存 (Shared Memory): SM 内共享,通过
T.alloc_shared分配 - 寄存器片段 (Fragment): 对应 GPU 寄存器文件,通过
T.alloc_fragment分配 - 本地内存 (Local): 线程本地存储,通过
T.alloc_local分配
2. 标准内核结构
TileLang 内核的标准结构模式:
import tilelang
import tilelang.language as T
@tilelang.jit(out_idx=[-1])
def my_kernel(M, N, K, block_M, block_N, block_K):
@T.prim_func
def main(A: T.Tensor((M, K), "float16"),
B: T.Tensor((K, N), "float16"),
C: T.Tensor((M, N), "float16")):
# 1. 定义内核上下文(网格和线程配置)
with T.Kernel(T.ceildiv(N, block_N), T.ceildiv(M, block_M), threads=128) as (bx, by):
# 2. 内存分配
A_shared = T.alloc_shared((block_M, block_K), "float16")
B_shared = T.alloc_shared((block_K, block_N), "float16")
C_local = T.alloc_fragment((block_M, block_N), "float")
# 3. 初始化
T.clear(C_local)
# 4. 计算逻辑(含数据加载和计算)
for ko in T.Pipelined(T.ceildiv(K, block_K), num_stages=3):
T.copy(A[by * block_M, ko * block_K], A_shared)
T.copy(B[ko * block_K, bx * block_N], B_shared)
T.gemm(A_shared, B_shared, C_local)
# 5. 结果写回
T.copy(C_local, C[by * block_M, bx * block_N])
return main
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 · 310 lines · 24 tokens per session scan A cbbd9bc3be2f
tilelang-cuda-basics is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed today), licensed Apache-2.0. It adds 24 tokens to every session and 3,275 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.
tilelang-cuda-basics compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| tilelang-cuda-basicsmindspore-ai/akg | Skill | 269 | today | Apache-2.0 | A | 24 | Claude Code, Codex |
| pytorch-patternsaffaan-m/ECC | Skill | 315k | yesterday | MIT | A | 32 | Claude Code, Kiro |
| accelerateNousResearch/hermes-agent | Skill | 268k | today | MIT | A | 13 | Claude Code, Codex |
| optimize-for-gpuK-Dense-AI/scientific-agent-skills | Skill | 59k | 3d ago | MIT | A | 151 | Claude Code, Codex |
| developing-genkit-pythongoogle/skills | Skill | 25k | today | Apache-2.0 | A | 96 | Claude Code, Codex |
| marimo-pairmarimo-team/marimo | Skill | 24k | today | Apache-2.0 | A | 57 | Claude Code, Codex |
| cudnn-installNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 49 | Claude Code, Codex |