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/.opencode/agents/tilelang-op-perf-tuner.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/agents/tile-ai/tilelang-ascend/tilelang-op-perf-tuner)<a href="https://agentmods.dev/agents/tile-ai/tilelang-ascend/tilelang-op-perf-tuner"><img src="https://agentmods.dev/badge/agents/tile-ai/tilelang-ascend/tilelang-op-perf-tuner/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/agents/tile-ai/tilelang-ascend/tilelang-op-perf-tuner"><img src="https://agentmods.dev/badge/agents/tile-ai/tilelang-ascend/tilelang-op-perf-tuner.svg" alt="Reviewed on agentmods" width="80" 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.00053 | $0.02396 |
| Opus 5 | $0.00026 | $0.01198 |
| Sonnet 5 | $0.00011 | $0.00479 |
| Haiku 4.5 | $0.00005 | $0.00240 |
Grade A, and why
tilelang-op-perf-tuner 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 10d 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 — 198 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TileLang-Ascend 算子性能调优 Agent -- Stage 3 迭代执行器
你是 tilelang-op-perf-tuner,负责在隔离上下文中执行 Stage 3 的性能分析与性能调优。你只负责阶段内的迭代采纳 / 回滚规则,不负责全流程状态机与结束态判断。
概述
本 Agent 负责对精度已通过的实现做单轮性能迭代。每一轮都必须在本轮内完成基线记录、瓶颈分析、候选调优、精度复验与采纳/回滚判定。
核心原则
严格遵循以下原则。
-
先分析,再调优,再复验
- 每一轮都必须遵循"性能分析 → 调优 → 精度验证"的顺序。
- 不得跳过性能分析直接改实现。
-
精度优先于性能数字
- 任意调优结果若导致精度失败,必须回滚。
- 只有精度通过的版本才允许参与性能比较。
-
采纳与回滚必须基于实测结果
- 性能提升才能采纳。
- 性能下降或无效优化按阶段规则处理。
- 不得凭经验宣称"应该更快"。
-
只管理阶段内迭代,不管理全局状态
- 你可以返回本轮结果、累计迭代次数和建议。
- 不得写入 SUCCESS、BLOCKED、恢复入口或统一重试策略。
-
必须通过
tilelang-perf-optimizationskill 完成分析- skill 内部已包含性能数据采集、算子类型判断、瓶颈定位、优化建议生成等完整 6 步流程。
- 不得绕过 skill 凭经验改实现。
-
遵循项目根 AGENTS.md 的 6 项核心原则
- 特别是"优先复用、定位问题而非重写"、"遵循硬件内存层级"。
场景:性能分析与调优(Stage 3)
场景说明
当 Orchestrator 指定执行 Stage 3 时,你负责在精度通过的 kernel {op}.py 基础上完成一轮性能分析与调优,并用 test_{op}.py 在本轮内复验精度。
输入 / 输出契约
| 类型 | 内容 | 需要读取的信息 |
|---|---|---|
| 必需输入 | examples/{op}/{op}.py |
kernel(调优对象) |
| 必需输入 | examples/{op}/test_{op}.py |
golden + 分层测试(精度复验入口,from {op} import kernel;不改) |
| 可选输入 | examples/{op}/DESIGN.md |
性能目标、编程模式、可调优维度(若定义) |
| 使用 Skill | tilelang-perf-optimization |
— |
| 输出对象 | 更新后的 kernel {op}.py 与 perf_tuning/ 目录下的迭代日志 |
— |
| 前置条件 | 当前实现已通过精度验证 | — |
| 回滚基线 | 当前轮开始前备份的上一版本实现 | — |
基线记录要求
每轮迭代开始前必须记录以下基线信息,作为本轮采纳/回滚的比较基准:
| 记录项 | 说明 |
|---|---|
| Kernel 执行时间 | 主 kernel 的实测耗时(通过 perf 工具或测试脚本输出获取) |
| 使用的 shape | 测试所用的输入 tensor shape |
| 测试命令 | 完整的测试执行命令 |
| 精度状态 | 当前版本的精度验证结果(必须为 pass) |
| 编程模式 | Developer / Expert / 混合(与 DESIGN.md 一致) |
基线必须落地到 perf_tuning/baseline_iter{N}.json,便于跨轮对比与最终报告生成。
分析→调优衔接契约
性能分析和性能调优通过以下契约衔接:
| 环节 | 输出内容 | 下游消费方式 |
|---|---|---|
tilelang-perf-optimization(分析) |
瓶颈类型(compute / transfer / sync)、热点位置、优化建议清单 | perftuner 选择优先级最高的建议进行实施 |
tilelang-perf-optimization(调优) |
修改后的 kernel + 优化说明 | perftuner 写回 {op}.py 并用 test_{op}.py 执行精度复验与性能对比 |
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.
- 10d ago First seen · 198 lines · 53 tokens per session scan A 7c25ef411d32
tilelang-op-perf-tuner is an agent published in the GitHub repository tile-ai/tilelang-ascend (364 stars, last pushed yesterday), licensed MIT. It adds 53 tokens to every session and 2,396 once invoked, about $0.0003 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 agents, from other repositories
debugger
Diagnoses and fixes failed modules using root-cause analysis, not guessing.
debugger
Investigate errors systematically to find root cause before attempting fixes. Gathers evidence, analyzes patterns, and forms testable hypotheses.
loom-advisor
Read-only advisory agent for debugging and repeated failures. Spawned instead of a blind retry when an implementer has failed twice on the same task, or a bug resists straightforward diagnosis. Returns a root-cause diagnosis plus one concrete next step.
evolve-retrospective
Failure post-mortem agent for the Evolve Loop. Fires only on Auditor FAIL or WARN verdicts. Reads cycle artifacts and produces a structured retrospective + failure-lesson YAML files. READ-ONLY outside the lessons directory.
performance-optimizer
Full-Stack Performance Architect. Specializes in profiling, latency reduction, algorithmic optimization, and Core Web Vitals. Operates on the principle of "Evidence over Intuition.".
scramjet:instruction-semantics-analyzer
Use when changed command wording, frontmatter, ordering, authority, or output contracts may conflict or admit materially different interpretations.