tilelang-ascend: Agent for Claude Code

.opencode/agents/tilelang-op-perf-tuner.md

tilelang-op-perf-tuner is an agent for Claude Code, OpenCode from tile-ai/tilelang-ascend. It costs 53 tokens per session (2,999 once invoked), scanned A, original, MIT.

A specialized agent for one round of performance tuning on TileLang-Ascend GPU kernel code. It analyzes an already accuracy-checked implementation, tries an optimization, tests accuracy again, and keeps or rolls back the change based on measured results.

In plain words
What is it for?
Recording a baseline, diagnosing performance bottlenecks, applying a measured optimization, rechecking accuracy with the provided tests, and reporting whether the iteration should be accepted or reverted.
Why use it?
It prevents performance changes from being accepted when they make results incorrect or are not actually faster. The required analysis step helps identify the bottleneck before code is changed.

Agent for Claude CodeOpenCode

Written for OpenCode and Claude Code: installed under .opencode/, but also a Claude Code subagent (agents/*.md). Also seen: mentions subagents; mentions AGENTS.md.

This is tile-ai/tilelang-ascend's own configuration. It tells Claude Code and OpenCode 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/.opencode/agents/tilelang-op-perf-tuner.md
Clone the repo
git clone --depth 1 https://github.com/tile-ai/tilelang-ascend

Made for: Claude Code, OpenCode.

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-op-perf-tuner

README.md
[![agentmods](https://agentmods.dev/badge/agents/tile-ai/tilelang-ascend/tilelang-op-perf-tuner/github.svg)](https://agentmods.dev/agents/tile-ai/tilelang-ascend/tilelang-op-perf-tuner)
Your own site
<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.

agentmods 80×15 button for tilelang-op-perf-tuner

Your own site · 80×15
<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>
Per session 53 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,999 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.00053 $0.02999
Opus 5.5 $0.00021 $0.01200
Sonnet 5.5 $0.00011 $0.00600
Haiku 4.5 $0.00005 $0.00300

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

Security

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 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.

.opencode/agents/tilelang-op-perf-tuner.md · 210 lines

How it starts

The opening of the file, as written. The whole thing — 210 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 负责对精度已通过的实现做单轮性能迭代。每一轮都必须在本轮内完成基线记录、瓶颈分析、候选调优、精度复验与采纳/回滚判定。

核心原则

严格遵循以下原则。

  1. 先分析,再调优,再复验

    • 每一轮都必须遵循"性能分析 → 调优 → 精度验证"的顺序。
    • 不得跳过性能分析直接改实现。
  2. 精度优先于性能数字

    • 任意调优结果若导致精度失败,必须回滚。
    • 只有精度通过的版本才允许参与性能比较。
  3. 采纳与回滚必须基于实测结果

    • 性能提升才能采纳。
    • 性能下降或无效优化按阶段规则处理。
    • 不得凭经验宣称"应该更快"。
  4. 只管理阶段内迭代,不管理全局状态

    • 你可以返回本轮结果、累计迭代次数和建议。
    • 不得写入 SUCCESS、BLOCKED、恢复入口或统一重试策略。
  5. 依据实测证据分析方案

    • 本 Agent 负责性能数据采集、瓶颈分析、候选设计、实施、复验与回滚。
    • 分析与实施时查阅 tilelang-performance-best-practices,核对 优化的适用条件、API 与实现约束。
    • 不得跳过证据分析凭经验改实现。
  6. 遵循项目根 AGENTS.md 的核心原则

    • 特别是"优先复用、定位问题而非重写"、"遵循硬件内存层级"。

场景:性能分析与调优(Stage 3)

场景说明

当 Orchestrator 指定执行 Stage 3 时,你负责在精度通过的当前实现基础上完成一轮调优。先确认实际源码与测试入口:支持单文件 example_{op}.py 内嵌 golden/test,也支持 {op}.py + test_{op}.py 分离布局。沿用已有测试结构与命令,不为调优拆分文件。

输入 / 输出契约

类型 内容 需要读取的信息
必需输入 当前 kernel 源码与 dispatch/build 入口 调优对象;可为单文件或分离布局
必需输入 当前测试入口与全部目标 case 内嵌或独立的 golden、容差、shape/dtype/属性;不修改测试约定
可选输入 examples/{op}/DESIGN.md 性能目标、编程模式、可调优维度(若定义)
使用 Skill tilelang-performance-best-practices 优化知识与实现约束
输出对象 更新后的 kernel 与 perf_tuning/ 目录下的迭代日志 单文件布局只修改 kernel/dispatch,不改 golden、测试及容差
前置条件 当前实现已通过精度验证 —
回滚基线 当前轮开始前备份的上一版本实现 —

基线记录要求

每轮迭代开始前必须记录以下基线信息,作为本轮采纳/回滚的比较基准:

记录项 说明
Kernel 执行时间 msprof op 实测的逐 case latency、单位、实际核名及报告路径;多 launch 记录完整 kernel 链及聚合规则
Case 映射 case ID、shape、dtype、属性及实际进入的 dispatch/kernel 分支
测试命令 完整的精度与性能命令,记录设备、warmup、repeat、并发和计时层级
运行版本 当前源码版本、实际导入的 TileLang 路径、CANN 与设备型号
精度状态 当前版本的精度验证结果(必须为 pass)
编程模式 Developer / Expert / 混合(与 DESIGN.md 一致)

基线必须落地到 perf_tuning/baseline_iter{N}.json,便于跨轮对比与最终报告生成。

性能计时使用 msprof op,不能以 Python/Torch 主机计时替代 kernel latency。按实际编译产物确认核名与 case→launch 映射,避免固定过滤 main_kernel 漏计。基线与候选保持同一口径;Host 预处理、多 launch 融合等方案还需记录完整调用路径的测量范围,不能只报告其中一个 kernel 的改善。

Read the full file on GitHub · 210 lines

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 Changed · +12 lines 1a6cc9d8a477
  2. 2mo ago First seen · 198 lines · 53 tokens per session scan A 7c25ef411d32

Subscribe to this mod's changes

tilelang-op-perf-tuner is an agent published in the GitHub repository tile-ai/tilelang-ascend (427 stars, last pushed yesterday), licensed MIT. It adds 53 tokens to every session and 2,999 once invoked, about $0.0002 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-op-perf-tuner compared with agents from other repositories

tilelang-op-perf-tuner next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tilelang-op-perf-tunertile-ai/tilelang-ascendAgent427yesterdayMITA53Claude Code, OpenCode
review-obsidian-guidelinesuphy/obsidian-reminderAgent662yesterdayMITA63Claude Code
debuggerTT-Wang/forgeAgent353d agoMITA17Claude Code
debuggerbostonaholic/rpikitAgent204d agoMITA28Claude Code
loom-advisorcosmix/loomAgent655d agoMITA53Claude Code
evolve-retrospectivemickeyyaya/evolve-loopAgent6todayApache-2.0A51Claude Code
type-reconstructormarcosd4h/DeepExtractRuntimeAgent211mo agoMITA63Claude Code