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.
npx agentmods add skills/tile-ai/tilelang-ascend/tilelang-perf-optimizationnpx skills add tile-ai/tilelang-ascend --skill tilelang-perf-optimizationgit 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-perf-optimization)<a href="https://agentmods.dev/skills/tile-ai/tilelang-ascend/tilelang-perf-optimization"><img src="https://agentmods.dev/badge/skills/tile-ai/tilelang-ascend/tilelang-perf-optimization.svg" alt="Measured on agentmods" height="20"></a>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.00090 | $0.02224 |
| Opus 5 | $0.00045 | $0.01112 |
| Sonnet 5 | $0.00018 | $0.00445 |
| Haiku 4.5 | $0.00009 | $0.00222 |
Grade A, and why
tilelang-perf-optimization 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 6d 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 — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TileLang 性能优化
工作流程
Step 1: 基线采集(性能 + 精度)
→ Step 2: 算子类型判断
→ Step 3: 阅读参考文档并识别优化点(输出到 optimization_log.md)
→ Step 4: 逐项实施优化点
→ Step 5: 效果验证(性能 + 精度)
核心约束
- 逐项实施:每次 Edit 只改一个优化点,改完立即验证
- 精度优先:精度未通过禁止性能优化
- 性能验证:必须使用
msprof op,禁止用 Python/Torch 计时 - Host 轻量化:禁止 host 侧全量数据搬运(
F.pad、.contiguous()、.to(dtype)等),必须移入 kernel
参考文档
- 优化指南:optimization-guide.md
- 反模式清单:performance-antipatterns.md
- API 用法:tilelang-api-best-practices
- 编程模式:tilelang-programming-model-guide
- cube最佳实践:cube_optimization_path.md
- vector最佳实践:vector-practices/
执行步骤
Step 1: 基线采集
在 examples/{op_name}/ 下查找含 @tilelang.jit 的脚本,运行:
msprof op --kernel-name="main_kernel" --output=./msprof_output python ./examples/{op_name}/<script_name>.py
精度未通过 → 禁止后续步骤。
Step 2: 算子类型判断
生成翻译后的 Ascend C 代码:
在算子脚本中,JIT 编译返回的函数对象调用 get_kernel_source() 可获取翻译后的 Ascend C 代码:
func = jit_func(batch=B, seq_len=S, ...)
print(func.get_kernel_source())
运行脚本后,从输出中搜索关键字判断算子类型:
| 判断依据 | 类型 | 典型算子 |
|---|---|---|
IS_ASCEND_AIC 出现 |
Cube 型 | GEMM、MatMul、Linear |
IS_ASCEND_AIV 出现 |
Vector 型 | RoPE、Softmax、Add |
| 两者均出现 | 混合型 | FlashAttention、SparseFlashAttention |
Step 3: 识别优化点(强制,禁止与 Step 4 合并)
先读取 optimization-guide.md 的目录和各章节标题 + performance-antipatterns.md 的各条目标题,根据算子类型(Step 2 判定)和算子实现特征初步筛选出可能适用的优化点清单。再针对每个候选优化点,读取其"适用场景"、"约束"、"使用条件"等描述,确认是否真正适用。如果是 cube 核额外参考 best-practices/cube_optimization_path.md,如果是 vector 核额外参考 vector-practices/ 目录下的文档。
在 optimization_log.md 中输出:
Part A 优化点清单:逐条标注适用/不适用 + 原因 + 参考文件行号。pass_configs 不是独立优化点,是伴随修改。
[#1] [名称](参考: optimization-guide.md L445-L650 §2.13):[适用/不适用] — [原因]
What ships with it
8 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.
- references/best-practices/cube_optimization_path.md 23 KB
- references/best-practices/flash_attn_optimize.md 35 KB
- references/best-practices/gemm_intrinsic_optimize.md 15 KB
- references/best-practices/rope-developer-mode.md 6.3 KB
- references/best-practices/vector_add_pipeline.md 9.6 KB
- references/optimization-guide.md 81 KB
- references/performance-antipatterns.md 19 KB
- references/vector-practices/vector_reduce_pass_fusion.md 8.7 KB
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.
- 6d ago First seen · 156 lines · 90 tokens per session scan A 32e0e6676ac5
tilelang-perf-optimization is a skill published in the GitHub repository tile-ai/tilelang-ascend (363 stars, last pushed 2d ago), licensed MIT. It adds 90 tokens to every session and 2,224 once invoked, about $0.0005 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
debug-optimize-lcp
Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…
systematic-debugging
Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.
diagnose
Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.
azsdk-common-pipeline-analysis
Analyze Azure SDK CI/CD pipeline failures into a structured diagnosis, and define the required output format. Load this skill before calling azsdkanalyzepipeline, which returns raw failure data that this skill interprets and formats. USE FOR: "pipeline failed", "build failure", "CI check failing", "tests failing in…
repro-admin
Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.
log-error-digest
Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…