tilelang-cuda-api

tilelang-cuda-api is a skill for Claude Code, Codex from mindspore-ai/akg. It costs 43 tokens per session (3,002 once invoked), scanned A, original, Apache-2.0.

A reference manual for the TileLang CUDA programming interface, including kernel compilation, launch dimensions, thread blocks, memory allocation, and utility functions. TileLang is a Python-like language for writing GPU kernels.

In plain words
What is it for?
Use it to look up APIs such as @tilelang.jit, tilelang.compile, T.Kernel, T.ceildiv, and memory-allocation functions, with short code examples.
Why use it?
It lets you check what common TileLang functions do and how their parameters are used while writing kernel code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to look up APIs such as @tilelang.jit, tilelang.compile, T.Kernel, T.ceildiv, and memory-allocation functions, with short code examples.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mindspore-ai/akg/tilelang-cuda-api
Install

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.

Any agent
npx skills add mindspore-ai/akg --skill tilelang-cuda-api
Clone the repo
git clone --depth 1 https://github.com/mindspore-ai/akg

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for tilelang-cuda-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-api/github.svg)](https://agentmods.dev/skills/mindspore-ai/akg/tilelang-cuda-api)
Your own site
<a href="https://agentmods.dev/skills/mindspore-ai/akg/tilelang-cuda-api"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-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.

agentmods 80×15 button for tilelang-cuda-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/mindspore-ai/akg/tilelang-cuda-api"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/tilelang-cuda-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,002 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.03002
Opus 5.5 $0.00017 $0.01201
Sonnet 5.5 $0.00009 $0.00600
Haiku 4.5 $0.00004 $0.00300

Measured 3mo ago against content hash c9d57bf0babe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tilelang-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 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.

akg_agents/python/akg_agents/op/resources/skills/tilelang-cuda/guides/tilelang-cuda-api/SKILL.md · 348 lines

How it starts

The opening of the file, as written. The whole thing — 348 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TileLang CUDA API 参考手册

本文档提供 TileLang 核心 API 的详细参考,包括函数签名、参数说明和使用示例。

1. 内核定义与编译

@tilelang.jit(out_idx)

@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"),
    ):
        # 内核实现
        pass
    return main
  • 作用: 将 TileLang 函数编译为 GPU 内核
  • 参数: out_idx - 指定输出张量的索引列表(如 [-1] 表示最后一个参数为输出)
  • 调用: 设置 out_idx 后,运行内核时只需传入输入张量,输出由 TileLang 自动创建

tilelang.compile

kernel = tilelang.compile(my_func, out_idx=[-1])
  • 作用: 编译 TileLang 函数(等价于 @tilelang.jit)

2. 内核上下文

T.Kernel(grid_x, grid_y, threads)

with T.Kernel(T.ceildiv(N, block_N), T.ceildiv(M, block_M), threads=128) as (bx, by):
    # bx, by 对应 blockIdx.x, blockIdx.y
    pass
  • 参数:
    • grid_x: 网格 X 维度大小
    • grid_y: 网格 Y 维度大小(可选)
    • threads: 每个线程块的线程数
  • 返回: 线程块索引 (bx, by)

T.ceildiv(a, b)

grid_size = T.ceildiv(N, block_N)
  • 参数: a, b - 被除数和除数
  • 返回: 向上取整的除法结果
  • 用途: 计算网格大小

3. 内存分配 API

T.alloc_shared(shape, dtype)

A_shared = T.alloc_shared((block_M, block_K), "float16")
  • 作用: 分配共享内存(对应 GPU 共享内存)
  • 参数:
    • shape: 张量形状
    • dtype: 数据类型
  • 用途: 缓存频繁访问的数据

T.alloc_fragment(shape, dtype)

C_local = T.alloc_fragment((block_M, block_N), "float")
  • 作用: 分配寄存器片段(对应 GPU 寄存器文件)
  • 参数:
    • shape: 张量形状
    • dtype: 数据类型
  • 用途: 累加器和临时存储

T.alloc_local(shape, dtype)

temp = T.alloc_local((1,), "float32")
  • 作用: 分配线程本地内存
  • 参数:
    • shape: 张量形状
    • dtype: 数据类型
  • 用途: 线程私有的临时变量

4. 数据操作 API

T.copy(src, dst)

# 全局内存到共享内存
T.copy(A[by * block_M, ko * block_K], A_shared)

# 寄存器到全局内存
T.copy(C_local, C[by * block_M, bx * block_N])
  • 作用: 高效内存复制,自动合并访问
  • 参数:
    • src: 源数据(可以是全局内存切片或寄存器片段)
    • dst: 目标数据

T.clear(tensor)

T.clear(C_local)
  • 作用: 将张量清零
  • 参数: tensor - 要清零的张量

Read the full file on GitHub · 348 lines

Changes

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.

  1. 3mo ago First seen · 348 lines · 43 tokens per session scan A c9d57bf0babe

Subscribe to this mod's changes

tilelang-cuda-api is a skill published in the GitHub repository mindspore-ai/akg (269 stars, last pushed yesterday), licensed Apache-2.0. It adds 43 tokens to every session and 3,002 once invoked, about $0.0002 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.

Related

tilelang-cuda-api compared with skills from other repositories

tilelang-cuda-api next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tilelang-cuda-apimindspore-ai/akgSkill269yesterdayApache-2.0A43Claude Code, Codex
agent-platform-model-registrygoogle/skillsSkill26kyesterdayApache-2.0A60Claude Code, Codex
llm-evaluationsickn33/agentic-awesome-skillsSkill51ktodayMITA25Claude Code
google-cloud-solution-agentic-analytics-spark-knowledge-cataloggoogle/skillsSkill26kyesterdayApache-2.0A132Claude Code, Codex
training-checkwanshuiyin/Auto-claude-code-research-in-sleepSkill20k4d agoMITA35Claude Code
tao-run-inference-serviceNVIDIA/skillsSkill4.4kyesterdayApache-2.0A92Claude Code
nemo-automodel-launcher-configNVIDIA/skillsSkill4.4kyesterdayApache-2.0A30Claude Code