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.
curl -O https://raw.githubusercontent.com/tile-ai/tilelang-ascend/ascendc_pto/.agents/skills/tilelang-example-merge/SKILL.mdgit clone --depth 1 https://github.com/tile-ai/tilelang-ascendWrote 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/tile-ai/tilelang-ascend/tilelang-example-merge)<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.
<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>- 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.00163 | $0.04710 |
| Opus 5 | $0.00081 | $0.02355 |
| Sonnet 5 | $0.00033 | $0.00942 |
| Haiku 4.5 | $0.00016 | $0.00471 |
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.
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— 合并后的单文件示例
工作流程
第一步:读取源文件
- 确认算子名(用户指定或从对话上下文提取)
- 读取
examples/{op}/{op}.py,提取完整 kernel 代码- 包括模块级常量(
pass_configs、CAST_MODE_*等) - 包括
@tilelang.jit装饰的函数及其内部的@T.prim_func - 不要包含
if __name__ == "__main__"块(如果有的话)
- 包括模块级常量(
- 读取
examples/{op}/test_{op}.py,理解测试结构- 识别 L0 测试用例(通常在
test_{op}_l0()函数或test_configs列表中) - 识别 L1 测试用例(通常在
test_{op}_l1()函数或L1_CASES列表中) - 提取 golden 参考实现函数
- 提取
get_precision函数及 dtype→阈值映射表(用于第四步查表填占位符)
- 识别 L0 测试用例(通常在
第二步:选取代表性用例
L0 代表性用例选取
L0 是门槛测试(规则 shape,block 整除),选取最具代表性的一个:
- 优先:名称含 "typical" 或 "standard" 的用例(如
l0_typical) - 次选:shape 最大的用例(最大 N 或最大 B×N,最能代表真实工作负载)
- 兜底:第一个 L0 用例
L1 代表性用例选取
L1 是功能测试(含不规则 shape、数值范围覆盖),选取最标准的规则 shape 用例:
- 优先:带
D-SHAPE-ALIGNEDtag 的用例(规则 shape,无尾块) - 次选:第一个 shape 为规则对齐的用例(B % block_M == 0 且 N % block_N == 0)
- 兜底:第一个 L1 用例
选取时注意避开极端边界用例(如 B=1、N=1、超大数值范围),这些适合分层测试 但不适合作为上库示例的代表用例。
第三步:提取 golden 参考实现
从 test_{op}.py 中提取 golden 函数(通常名为 golden_{op} 或直接内联在测试中),
作为独立函数复制到 example_{op}.py 的 kernel 之后、if __name__ 块之前。
提取规则:
- 保留独立函数:不要内联到测试循环里。golden 函数放循环外,循环内调用
ref = golden(x)。这样 golden 逻辑只写一遍,多个用例复用,与test_{op}.py结构一致。 - 原样复制函数体:保留数学逻辑,去掉冗长 docstring(一行注释说明即可)。
- 不要重新实现:如果原 golden 调用了 PyTorch 内置函数(如
F.softmax、torch.layer_norm),直接用该调用,不要手写等价实现,避免引入新 bug。 - 函数签名对齐:golden 函数的输入参数应与测试循环中传入的张量一致(通常是
def golden(x): return ...)。
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.
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.
- 9d ago First seen · 325 lines · 163 tokens per session scan A b8243e94e5fb
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.
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.
gh-auth-isolation
Safely manage multiple GitHub identities (EMU + personal) in agent workflows.
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.
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.
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…
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…