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-optimizationgit 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-optimization)<a href="https://agentmods.dev/skills/mindspore-ai/akg/tilelang-cuda-optimization"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-optimization/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-optimization"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-optimization.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.00064 | $0.02451 |
| Opus 5.5 | $0.00026 | $0.00980 |
| Sonnet 5.5 | $0.00013 | $0.00490 |
| Haiku 4.5 | $0.00006 | $0.00245 |
Grade A, and why
tilelang-cuda-optimization 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 — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TileLang CUDA 性能优化指南
1. 性能优化策略
1.1 分块大小选择
- 原则: 平衡并行度与资源占用
- 建议: 使用 2 的幂次
- 常用值: block_M/block_N = 64, 128, 256; block_K = 16, 32, 64
| 算子类型 | 推荐分块大小 | 线程数 |
|---|---|---|
| Element-wise | block = 256-1024 | 128-256 |
| GEMM | block_M=128, block_N=128, block_K=32 | 128 |
| Reduce | block = 256-512 | 128-256 |
1.2 软件流水线优化
def pipelined_computation():
# 选择合适的流水线深度
num_stages = 3 # 通常 2-4 个阶段效果最好
for ko in T.Pipelined(T.ceildiv(K, block_K), num_stages=num_stages):
# 重叠内存操作和计算
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)
流水线深度选择:
num_stages=2: 最少的共享内存使用num_stages=3: 通常最优(推荐默认值)num_stages=4: 更多重叠但占用更多共享内存num_stages=5+: 可能超出共享内存限制
1.3 并行化策略
# 1. 细粒度并行
for i, j in T.Parallel(block_M, block_N):
# 自动映射到线程
pass
# 2. 向量化优化
for k in T.vectorized(TILE_K):
A_local[k] = A[bk * BLOCK_K + tk * TILE_K + k]
# 3. 串行循环(必要时使用)
for k in T.serial(block_K):
# 顺序执行
pass
1.4 数据类型优化
# 1. 使用混合精度
input_dtype = "float16" # 输入数据
accum_dtype = "float" # 累加器使用更高精度
# 2. 类型转换优化
result = A[i].astype(accum_dtype) * B[i].astype(accum_dtype)
# 3. 避免不必要的类型转换(在计算前统一转换)
2. 内存优化策略
2.1 内存层次结构优化
def memory_optimized_matmul(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")):
with T.Kernel(T.ceildiv(N, block_N), T.ceildiv(M, block_M), threads=128) as (bx, by):
# 1. 共享内存分配 - 缓存频繁访问的数据
A_shared = T.alloc_shared((block_M, block_K), "float16")
B_shared = T.alloc_shared((block_K, block_N), "float16")
# 2. 寄存器片段分配 - 累加和临时存储
C_local = T.alloc_fragment((block_M, block_N), "float")
# 3. 启用 swizzle 以提高 L2 缓存局部性
T.use_swizzle(panel_size=10, enable=True)
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)
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 · 256 lines · 64 tokens per session scan A 986710310db3
tilelang-cuda-optimization is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed today), licensed Apache-2.0. It adds 64 tokens to every session and 2,451 once invoked, about $0.0003 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-optimization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| tilelang-cuda-optimizationmindspore-ai/akg | Skill | 269 | today | Apache-2.0 | A | 64 | Claude Code, Codex |
| traceYeachan-Heo/oh-my-claudecode | Skill | 41k | yesterday | MIT | A | 18 | Claude Code |
| pos-tagging-fixesspencermountain/compromise | Skill | 12k | yesterday | MIT | A | 72 | Claude Code, Codex |
| compileiq-author-objectiveNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 150 | Claude Code |
| compileiq-bootstrapNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 128 | Claude Code |
| cupotential-validateNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 50 | Codex |
| smiles-validationsynthetic-sciences/openscience | Skill | 4.5k | today | Apache-2.0 | A | 24 | Claude Code, Codex |