tilelang-ascend: Skill for Claude Code

.agents/skills/tilelang-example-merge/SKILL.md

tilelang-example-merge is a skill for Claude Code, Codex from tile-ai/tilelang-ascend. It costs 163 tokens per session (4,710 once invoked), scanned A, original, MIT.

A tool that combines a TileLang operator’s kernel code and tests into one self-contained example file for repository submission.

In plain words
What is it for?
Use it before submitting an operator or pull request, when creating an example file, or when turning an operator directory into a single runnable example.
Why use it?
It removes the need to maintain separate files for the submitted example and its representative checks. The resulting file contains the kernel and selected low-level and higher-level tests together.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is tile-ai/tilelang-ascend's own configuration. It tells Claude Code and Codex how to work on tilelang-ascend itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tilelang-ascend configures →

Reuse

Borrowing it

Nothing to install: this file belongs to tile-ai/tilelang-ascend. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tile-ai/tilelang-ascend/ascendc_pto/.agents/skills/tilelang-example-merge/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/tile-ai/tilelang-ascend

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-example-merge

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tile-ai/tilelang-ascend/tilelang-example-merge"><img src="https://agentmods.dev/badge/skills/tile-ai/tilelang-ascend/tilelang-example-merge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 163 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,710 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.00163 $0.04710
Opus 5 $0.00081 $0.02355
Sonnet 5 $0.00033 $0.00942
Haiku 4.5 $0.00016 $0.00471

Measured 9d ago against content hash b8243e94e5fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

tilelang-example-merge 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 9d 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.

.agents/skills/tilelang-example-merge/SKILL.md · 325 lines

How it starts

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

TileLang Example Merge

概述

将算子开发阶段的双文件结构({op}.py 纯 kernel + test_{op}.py 分层测试套件) 合并为仓库上库用的单文件 example_{op}.py

为什么要合并:算子开发时 kernel 和测试分离便于迭代,但仓库上库只接收单文件 示例(参考 examples/normalization/layer_norm.pyexamples/developer_mode/gelu_mul_developer.py 的惯例)。单文件示例自包含、可直接 python example_{op}.py 运行验证。

合并策略:kernel 完整保留 + 从测试套件中自动选取 1 个 L0 代表性用例 + 1 个 L1 代表性用例,精简辅助函数,使用 torch.testing.assert_close 做精度检查。

触发条件

  • 用户提到"上库"、"提交 PR"、"合并文件"、"生成 example"、"单文件提交"
  • 用户要把算子代码整理成仓库可接收的单文件示例
  • 用户提到 "example_softmax.py"、"example_layer_norm.py" 等命名模式

输入

参数 说明 示例
算子名 算子目录名和文件名前缀 softmax

输入文件(隐式从算子名推导):

  • examples/{op}/{op}.py — 纯 kernel 文件
  • examples/{op}/test_{op}.py — 分层测试文件

输出文件:

  • examples/{op}/example_{op}.py — 合并后的单文件示例

工作流程

第一步:读取源文件

  1. 确认算子名(用户指定或从对话上下文提取)
  2. 读取 examples/{op}/{op}.py,提取完整 kernel 代码
    • 包括模块级常量(pass_configsCAST_MODE_* 等)
    • 包括 @tilelang.jit 装饰的函数及其内部的 @T.prim_func
    • 不要包含 if __name__ == "__main__" 块(如果有的话)
  3. 读取 examples/{op}/test_{op}.py,理解测试结构
    • 识别 L0 测试用例(通常在 test_{op}_l0() 函数或 test_configs 列表中)
    • 识别 L1 测试用例(通常在 test_{op}_l1() 函数或 L1_CASES 列表中)
    • 提取 golden 参考实现函数
    • 提取 get_precision 函数及 dtype→阈值映射表(用于第四步查表填占位符)

第二步:选取代表性用例

L0 代表性用例选取

L0 是门槛测试(规则 shape,block 整除),选取最具代表性的一个:

  1. 优先:名称含 "typical" 或 "standard" 的用例(如 l0_typical
  2. 次选:shape 最大的用例(最大 N 或最大 B×N,最能代表真实工作负载)
  3. 兜底:第一个 L0 用例
L1 代表性用例选取

L1 是功能测试(含不规则 shape、数值范围覆盖),选取最标准的规则 shape 用例:

  1. 优先:带 D-SHAPE-ALIGNED tag 的用例(规则 shape,无尾块)
  2. 次选:第一个 shape 为规则对齐的用例(B % block_M == 0 且 N % block_N == 0)
  3. 兜底:第一个 L1 用例

选取时注意避开极端边界用例(如 B=1、N=1、超大数值范围),这些适合分层测试 但不适合作为上库示例的代表用例。

第三步:提取 golden 参考实现

test_{op}.py 中提取 golden 函数(通常名为 golden_{op} 或直接内联在测试中), 作为独立函数复制到 example_{op}.py 的 kernel 之后、if __name__ 块之前

提取规则:

  1. 保留独立函数:不要内联到测试循环里。golden 函数放循环外,循环内调用 ref = golden(x)。这样 golden 逻辑只写一遍,多个用例复用,与 test_{op}.py 结构一致。
  2. 原样复制函数体:保留数学逻辑,去掉冗长 docstring(一行注释说明即可)。
  3. 不要重新实现:如果原 golden 调用了 PyTorch 内置函数(如 F.softmaxtorch.layer_norm),直接用该调用,不要手写等价实现,避免引入新 bug。
  4. 函数签名对齐:golden 函数的输入参数应与测试循环中传入的张量一致(通常是 def golden(x): return ...)。

Read the full file on GitHub · 325 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 325 lines · 163 tokens per session scan A b8243e94e5fb

Subscribe to this mod's changes

tilelang-example-merge is a skill published in the GitHub repository tile-ai/tilelang-ascend (363 stars, last pushed yesterday), licensed MIT. It adds 163 tokens to every session and 4,710 once invoked, about $0.0008 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.

Related

Other skills, from other repositories

prowler-commit

Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.

prowler-cloud/prowler · 33 tokens

gh-auth-isolation

Safely manage multiple GitHub identities (EMU + personal) in agent workflows.

github/gh-aw · 20 tokens

comet-github

A routing guide for Comet-related GitHub work. It directs requests about pull requests, issues, CI failures, ideas, and fixes to the appropriate review or implementation process.

rpamis/comet · 72 tokens

github-skill

Work with GitHub via the gh CLI — clone repositories, create/list/merge pull requests, create/list issues, and run any other gh command (API calls, workflow runs, releases, repo administration). List operations return parsed JSON.

zeenie-ai/OpenCompany · 51 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

codex-autoresearch

Run autonomous, measurable experiments in a Git repository: change one hypothesis, verify a numeric metric, keep improvements, and revert failures. Use when the user wants Codex to keep iterating toward a numeric target in the foreground or as a detached background run. Do not use for ordinary one-shot coding…

leo-lilinxiao/codex-autoresearch · 80 tokens