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.5 $0.00065 $0.01884
Sonnet 5.5 $0.00033 $0.00942
Haiku 4.5 $0.00016 $0.00471

Measured 2mo ago against content hash b8243e94e5fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.py、examples/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_configs、CAST_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.softmax、 torch.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. 2mo 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 (427 stars, last pushed yesterday), licensed MIT. It adds 163 tokens to every session and 4,710 once invoked, about $0.0007 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-example-merge compared with skills from other repositories

tilelang-example-merge next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tilelang-example-mergetile-ai/tilelang-ascendSkill427yesterdayMITA163Claude Code, Codex
merge-batchdiegosouzapw/OmniRouteSkill83k5d agoMITA46Claude Code
prowler-commitprowler-cloud/prowlerSkill15kyesterdayApache-2.0A44Claude Code, Codex
gh-auth-isolationgithub/gh-awSkill5.6kyesterdayMITA20Claude Code, Codex
github-skillzeenie-ai/OpenCompanySkill1.1kyesterdayMITA51Claude Code
comet-githubrpamis/cometSkill3.3kyesterdayMITA72Claude Code, Codex
release-helperSahir619/fable-methodSkill2.3k1mo agoMITA43Claude Code