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 | $0.00012 | $0.01638 |
| Sonnet 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 10d 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.
- 10d 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 (259 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 3,275 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
accelerate
Run PyTorch training across GPUs with minimal changes.
developing-genkit-python
Develop AI-powered applications using Genkit in Python. Use when the user asks about Genkit, AI agents, flows, or tools in Python, or when encountering Genkit errors, import issues, or API problems.
optimize-for-gpu
GPU-accelerates scientific Python on NVIDIA hardware and verifies that the result is correct and faster. Use for CUDA/GPU optimization; CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX, scikit-image, vector-search, image-processing, graph, simulation, or file-I/O workloads; CuPy, cuDF, cuML, cuGraph, cuVS…
marimo-pair
Work inside the user's live marimo notebook from the code editor: run Python in the same kernel the user does, inspect live notebook state, and commit durable notebook changes through code mode. Use whenever you create, analyze, or improve the user's marimo notebook.
minicpm5-deploy-transformers
Run MiniCPM5-1B or MiniCPM5-2B with Hugging Face Transformers for one-shot Python generation on GPU (bfloat16) or CPU (float32). Use when the user wants a quick Python script, no server, no extra deps, or asks for "Transformers", "AutoModelForCausalLM", "model.generate" with MiniCPM5.
azure-mgmt-fabric-py
Azure Fabric Management SDK for Python. Use for managing Microsoft Fabric capacities and resources. Triggers: "azure-mgmt-fabric", "FabricMgmtClient", "Fabric capacity", "Microsoft Fabric", "Power BI capacity".