tilelang-ascend: Skill for Claude Code

.agents/skills/tilelang-performance-best-practices/SKILL.md

tilelang-performance-best-practices is a skill for Claude Code, Codex from tile-ai/tilelang-ascend. It costs 66 tokens per session (2,131 once invoked), scanned A, original, MIT.

A reference and review guide for optimizing TileLang code, a Python-based language for describing operations that run on specialized processors. It covers tiling, memory movement, synchronization, reductions, matrix multiplication, layouts, hardware limits, and test-based validation.

In plain words
What is it for?
Use it to find suitable operator examples, choose tested implementation patterns, review optimization proposals, implement kernels, run precision tests, and report latency and coverage honestly.
Why use it?
Performance changes can produce incorrect results, fail to compile, or rely on APIs that differ from the installed version. The guide emphasizes checking the actual source and hardware, then proving correctness before comparing speed.

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-performance-best-practices/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-performance-best-practices

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tile-ai/tilelang-ascend/tilelang-performance-best-practices"><img src="https://agentmods.dev/badge/skills/tile-ai/tilelang-ascend/tilelang-performance-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,131 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.
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.00066 $0.02131
Opus 5.5 $0.00026 $0.00852
Sonnet 5.5 $0.00013 $0.00426
Haiku 4.5 $0.00007 $0.00213

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

Security

Grade A, and why

tilelang-performance-best-practices 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 today.

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-performance-best-practices/SKILL.md · 66 lines

How it starts

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

TileLang 性能最佳实践

按以下优先级使用事实来源:

  1. 当前目标算子、当前仓库的 examples/、测试和公开接口约束。
  2. 实际导入的 TileLang 框架源码、examples/ 与 testing/;用实际 Python 导入结果核对运行版本与参考源码是否一致。
  3. references/ 中按成熟度分类的实现参考、策略元数据和设计文档。

工作流

  1. 在当前目标工程和实际 TileLang 源码的 examples/ 查找同类算子,优先复用当前分支已经验证的调度与 API。

  2. 定位实际 TileLang 源码并核对实际导入版本;在 examples/、testing/、API 定义和当前后端 lowering 中核对不确定接口,禁止按目录名猜测安装版本。

  3. 容量、核数或架构影响实现时,阅读 硬件资源与编译器有效容量发现,按名称加载 npu-arch,传入已确认的 SoC/NpuArch 与目标设备证据,记录已确认的硬件资源来源,并从实际 TileLang lowering 核对平台用户可用量、编译器预算与预留。

  4. 阅读 优化点索引、模板成熟度 和对应算子族文档;只有 VERIFIED 或 PRODUCTION_REFERENCE 可作为直接复用候选。

  5. 先实现精度正确的最小路径,再根据基准数据优化。不得通过放宽容差、降低 reference 精度或跳过 shape 获得“通过”。

  6. 由实施阶段先运行当前后端定向精度测试(独立 pytest 入口示例):

    pytest <test_file> -x
    
  7. 定向精度测试全部通过后运行相关完整测试套;合入前按项目要求运行扩展测试。性能比较保持输入、dtype、warmup、repeat、设备和并发度一致。

  8. 报告容差、通过数、首个失败、覆盖 shape、kernel latency 和基线;没有实测数据时只称“设计建议”。

  9. 区分数值失败、编译失败和仓库主动抛出的 NotImplementedError。未实现路径必须如实记录并补齐实现,不能放宽容差、跳过测试或把此前通过的子集称为全量通过。

验证入口

  • 当前仓库的算子测试、testing/python/ 与各算子族链接的现有示例用于验证;沿用目标的真实编译和测试入口,不假设固定 CLI。

代码准入规则

  • Kernel 实现只使用 Python TileLang DSL;tiling、dispatch 与数学 reference 使用普通 Python。先从目标仓库同类算子实现 派生,再按 模板成熟度 选择 bundled reference。
  • 编译后端沿用目标工程已经确认的配置;不为复用模板擅自切换 target,不把其他后端的环境变量或参数写入当前调用链。
  • Ascend T.Kernel 的网格、threads、cid/vid 和 workspace 规则按当前仓库 公共语言参考 核对,不套用其他后端的线程域规则。
  • 执行域优先沿用同类已验证实现:规则逐元素通常使用 T.Parallel 或 T.tile.*,Norm/Reduction 复用当前 T.reduce_* 路径;离散索引、复杂分支或原子操作按当前 API 与同类源码核对。执行域变更必须通过精度与性能实测。
  • GEMM 优先沿用已验证的 T.gemm_v0 / T.mma 结构与布局;其他布局不是 API 禁止项,但必须通过目标版本 lowering 与设备验证。首个有效 K 子 tile 清零 fp32 L0C,后续子 tile 累加。
  • fp16/bf16 的归约、归一化、softmax 统计量和矩阵乘以 fp32 累加为起点。内部混合精度、HF32 和近似指令可实验,但必须保持原测试、容差和公开约定,并以正确性与同口径性能决定是否保留。
  • Vector、Cube 与混合核分别使用硬件查询确认的可用 AIV、AIC 及配对资源;构建模板时显式传入核数,小任务核数不超过独立 task 数。
  • Elementwise、gather/scatter 或布局转换优化必须按 Tiling、任务与 Vector 数据流搜索 建立任务树和有来源的 tile 边界。物理路线按完整数据路径分类:planar/scratch 中间 payload 属于 materialized transform,不能代替直接连续 load 后的寄存器重排。将 tile/task、数据流、精度和流水作为正交轴,并由同一实际激活候选裁决有交互的组合。
  • UB 预算必须区分已确认的硬件规格、平台用户可用容量、当前 lowering 的编译器预算与预留和显式 buffer footprint;尤其在改变执行侧、cast、scratch 或临时 buffer 后重新计算。预算同时包含 buffer version、对齐 padding、常驻数据和有明确依据的安全余量。GM 尾块只 copy valid,UB 仍按完整 SIMD/DMA footprint 分配。
  • 流水任务必须按 多版本流水设计 建立跨迭代依赖;所有仍存活的 buffer 都要版本化,自动分析不适用时改用显式 stage storage。是否生效以生成代码及同口径 latency/overlap 为准。
  • 多轴 tile 域按 Persistent 多轴任务映射 核对,避免热循环中不必要的扁平索引解码。
  • 归约计算较轻且非归约连续轴较宽时,按 Reduction 宽输出轴 Tiling 评估合并连续输出 tile。
  • 以公开接口合约确定 shape 矩阵;接口不支持任意尾块时只覆盖允许余数类,不把新 fallback 当成既有要求。同时检查 forward/backward、动态 shape、极小/极大 shape、NaN/Inf 语义和空任务边界。

Read the full file on GitHub · 66 lines

Files

What ships with it

60 files 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. today First seen · 66 lines · 66 tokens per session scan A b210ac1a53e1

Subscribe to this mod's changes

tilelang-performance-best-practices is a skill published in the GitHub repository tile-ai/tilelang-ascend (427 stars, last pushed yesterday), licensed MIT. It adds 66 tokens to every session and 2,131 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-11-06.

Related

tilelang-performance-best-practices compared with skills from other repositories

tilelang-performance-best-practices next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tilelang-performance-best-practicestile-ai/tilelang-ascendSkill427yesterdayMITA66Claude Code, Codex
hypothesessynthetic-sciences/openscienceSkill4.3k2d agoApache-2.0A99Claude Code
review-rpedrohcgs/claude-code-my-workflowSkill1.7k2d agoMITA102Claude Code
review-paper-codeclaesbackman/AI-research-feedbackSkill5289d agoMITA0Claude Code
paperlab_neqsim_api_claim_verificationequinor/neqsimSkill163todayApache-2.0A55Claude Code, Codex
workflows:reviewbrycewang-stanford/Auto-Empirical-Research-SkillsSkill4.9k4d agononeA21Claude Code
referee2brycewang-stanford/Auto-Empirical-Research-SkillsSkill4.9k4d agononeA61Claude Code