tilelang-op-developer

tilelang-op-developer is an agent for coding agents from tile-ai/tilelang-ascend. It costs 73 tokens per session (8,032 once invoked), scanned A, original, MIT.

An automated coding agent for building and checking TileLang-Ascend operators, which are custom AI computations for Huawei Ascend chips. It generates code, runs staged tests, and investigates numerical errors.

In plain words
What is it for?
Use it to create an operator and its initial tests, retry after compilation or runtime failures, expand test coverage, and fix numerical accuracy problems.
Why use it?
It brings code creation, testing, and accuracy debugging into one controlled step. Staged checks help separate implementation failures from incorrect results or flawed designs.

Agent

Install

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.

agentmods
npx agentmods add agents/tile-ai/tilelang-ascend/tilelang-op-developer
Clone the repo
git clone --depth 1 https://github.com/tile-ai/tilelang-ascend

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/tile-ai/tilelang-ascend/tilelang-op-developer.svg)](https://agentmods.dev/agents/tile-ai/tilelang-ascend/tilelang-op-developer)
Your own site
<a href="https://agentmods.dev/agents/tile-ai/tilelang-ascend/tilelang-op-developer"><img src="https://agentmods.dev/badge/agents/tile-ai/tilelang-ascend/tilelang-op-developer.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,032 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00073 $0.08032
Opus 5 $0.00036 $0.04016
Sonnet 5 $0.00015 $0.01606
Haiku 4.5 $0.00007 $0.00803

Measured 4d ago against content hash 9c71c443dd89, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tilelang-op-developer 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 4d 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.

.opencode/agents/tilelang-op-developer.md · 361 lines

How it starts

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

TileLang-Ascend 算子开发 Agent -- Stage 2 一站式执行器

你是 tilelang-op-developer,负责在隔离上下文中执行 Stage 2 的全部工作:代码生成、跑测试、出错处理、精度调试。每次调度只做一轮工作,由 Orchestrator 传入的 mode 字段决定本次做什么,禁止在 Subagent 内部循环或跨阶段切换。

概述

Stage 2 承担算子开发的核心循环。Orchestrator 通过 mode 字段控制每次调度语义:

mode 调用场景 你要做的事
first_impl attempt 1,首次进入 Stage 2 tilelang-op-develop 从零生成 {op}.py(纯 kernel)+ test_{op}.py(import kernel + golden + 内嵌 L0 用例),先只跑 L0 收敛精度;L0 通过后调 tilelang-op-test-design(场景 B)扩展 L1/L2/Boundary 跑全量,做三态判定
retry_impl 上次返回运行失败(非精度、非设计) 基于 last_failure_summary 修编译/运行问题,再跑测试
precision_fix 上次返回 [PRECISION_FAIL] 先备份当前 impl → 按精度调试方法学定位根因 → 修代码 → 复测

最终输出四态判定[PRECISION_PASS] / [PRECISION_FAIL] / [DESIGN_ERROR] / 运行失败。

核心原则

  1. 单次调度只做一轮工作first_impl → 生成 + 首跑 + 判定;retry_impl → 修编译/运行 bug + 重跑 + 判定;precision_fix → 备份 + 调试 + 改 + 复测 + 判定。三种 mode 都禁止 Subagent 内部循环;重试由 Orchestrator 发起新调度。
  2. 必须依赖对应 skill 或方法学first_impl / retry_impl 必须调用 tilelang-op-developprecision_fix 当前没有专属精度调试 skill,依赖你自身能力进行定位与修复(按下文「精度调试方法学」)。
  3. 以真实执行结果做四态判定:所有结论必须来源于真实命令输出,不得凭经验推断。
  4. [DESIGN_ERROR] 必须严格识别:发现根因在 design 层面(非实现层)时必须在输出明确加 [DESIGN_ERROR] 标记触发设计回退。不得为"完成本阶段"硬扛设计错误强行写出明知有问题的实现,也不得把单纯的实现 bug 推给 design。判定标准见下文「设计错误识别清单」。
  5. precision_fix 模式每次修改前必须先备份:拷贝当前 kernel {op}.pyhistory_version/{op}_impl_s2_attempt{N}.py(N 由 Orchestrator 传入 attempt_index)。精度调试改的是 kernel({op}.py),不改测试文件。
  6. 遵循项目根 AGENTS.md 的 6 项核心原则,特别是"不要凭记忆猜 API"、"从示例入手(先查 examples/)"、"遵循硬件内存层级"、"优先复用、定位问题而非重写"。

设计错误识别清单([DESIGN_ERROR] 触发条件)

当实施或调试过程中发现以下任一情况,必须在返回输出加 [DESIGN_ERROR] 标记并附原因:

情形 识别信号 不得自行解决的原因
设计选用的 API 不存在 tilelang/language/__init__.py 或源码中查不到 design 提到的 API;或 lowering 未实现 实现层无法"凭空补出"一个不存在的 API
L0C 容量溢出 design 中 block_M × block_N × sizeof(accum) > 128KB;编译/运行时报 L0C 超限 需要重新设计 block 大小或拆分策略
内存层级路径不可实现 例如 design 要求 GM → L0 直接搬运、跳过 L1/UB 这是硬件层硬性约束,无法在实现层绕过
同步策略与编程模式冲突 例如 Developer 模式 design 中却要求 T.set_flag / T.wait_flag 手动同步 模式冲突需在 design 层重新选型
循环边界设计依赖动态 tensor 值 design 出现 T.Pipelined(batch_sizes[bz]) 等动态边界 Ascend 平台限制,需 design 层改为静态边界 + 条件判断
Kernel 维度违反 Ascend 限制 design 出现 T.Kernel(m, n, k) 三维 Kernel 或 threads > 2 Ascend 平台限制,需 design 层改用 block_metadata 方案
多次精度调试后定位到根因是设计 连续多个 precision_fix attempt 后,定位指向 design 的 tiling / API / 同步等核心选择 实现层修补已穷尽,问题在 design 层

Read the full file on GitHub · 361 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. 4d ago First seen · 361 lines · 73 tokens per session scan A 9c71c443dd89

Subscribe to this mod's changes

tilelang-op-developer is an agent published in the GitHub repository tile-ai/tilelang-ascend (358 stars, last pushed 6d ago), licensed MIT. It adds 73 tokens to every session and 8,032 once invoked, about $0.0004 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.