Agent skill

Tilelang A5 Sim Convert

by tile-ai in tile-ai/tilelang-ascend

将 tilelang example 脚本转换为可在 A5 camodel 仿真器上直接运行的版本。输入脚本路径,输出一个新的 sim.py 文件,不覆盖原始文件。触发:仿真运行、camodel、A5 仿真、sim 模式、转换脚本为仿真、不需要 NPU 跑 kernel、simulate A5。

MITAuto-check passed

Install Tilelang A5 Sim Convert

skills CLI
$ npx skills add tile-ai/tilelang-ascend --skill tilelang-a5-sim-convert -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tile-ai/tilelang-ascend tilelang-a5-sim-convert --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tile-ai/tilelang-ascend.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/tilelang-a5-sim-convert .claude/skills/tilelang-a5-sim-convert && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tilelang-a5-sim-convert
GitHub stars
402
Token cost
~1.1k tokens
SKILL.md length
171 words
Files
3 (incl. scripts)
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

将 tilelang example 脚本转换为可在 A5 camodel 仿真器上直接运行的版本。输入脚本路径,输出一个新的 sim.py 文件,不覆盖原始文件。触发:仿真运行、camodel、A5 仿真、sim 模式、转换脚本为仿真、不需要 NPU 跑 kernel、simulate A5。

  • Works in 3 steps: 运行解析脚本获取 kernel 信息 → 读取模板 + 原始脚本 → 生成 *_sim.py
  • SKILL.md covers 模板结构(260 行,只改两处), 工作流程, 改动清单 and 测试数据生成规则
  • Runs Python scripts from its folder; calls python

What it does

Tilelang A5 Sim Convert is an agent skill from tile-ai/tilelang-ascend. 将 tilelang example 脚本转换为可在 A5 camodel 仿真器上直接运行的版本。输入脚本路径,输出一个新的 sim.py 文件,不覆盖原始文件。触发:仿真运行、camodel、A5 仿真、sim 模式、转换脚本为仿真、不需要 NPU 跑 kernel、simulate A5。

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `scripts/parse_example.py` and `scripts/run_a5_sim_template.py`).

The repository describes itself as: Ascend TileLang adapter. The licence is MIT.

Example prompts

  • “/tilelang-a5-sim-convert”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. 运行解析脚本获取 kernel 信息
  2. 读取模板 + 原始脚本
  3. 生成 *_sim.py

What it can do on your machine

Read from SKILL.md and the folder at commit 83b0ece. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tilelang A5 Sim Convert loads about 1.1k tokens when it runs. Until then it costs about 44 tokens; SKILL.md has 171 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from tile-ai/tilelang-ascend at commit 83b0ece, republished under its MIT licence (© tile-ai). 171 words, ~1,062 tokens.

Download SKILL.mdSave it as .claude/skills/tilelang-a5-sim-convert/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
tilelang-a5-sim-convert
description
将 tilelang example 脚本转换为可在 A5 camodel 仿真器上直接运行的版本。输入脚本路径,输出一个新的 *_sim.py 文件,不覆盖原始文件。触发:仿真运行、camodel、A5 仿真、sim 模式、转换脚本为仿真、不需要 NPU 跑 kernel、simulate A5。

TileLang A5 Camodel 仿真脚本转换

将任意 tilelang DSL 脚本转换为 A5 camodel 仿真可运行的独立脚本。

模板结构(260 行,只改两处)

模板文件:.agents/skills/tilelang-a5-sim-convert/scripts/run_a5_sim_template.py

行 1-24    import 语句            ← 不动
行 25-96   环境自动设置            ← 不动(_find_ascend_home, _source_cann, _find_sim_lib, setup)
行 99-133  加载 camodel 运行时    ← 不动(load_runtime, dev_malloc)
行 136-166 kernel 定义            ← ★ 第 1 处要改
行 169-260 main() 编译+运行+验证   ← 部分要改(详见下方)

工作流程

收到脚本路径后,按以下步骤执行:

Step 1: 运行解析脚本获取 kernel 信息
bash
cd <tilelang-ascend-root>
python .agents/skills/tilelang-a5-sim-convert/scripts/parse_example.py <target_script>

输出 JSON,包含 kernel_name、buffers(shape/dtype 列表)。

Step 2: 读取模板 + 原始脚本
  • 读取 .agents/skills/tilelang-a5-sim-convert/scripts/run_a5_sim_template.py
  • Read 目标脚本,找到 kernel 定义部分(@T.prim_func 或 @tilelang.jit 装饰的函数体)
Step 3: 生成 *_sim.py

输出路径:<原路径>/<原名>_sim.py(绝不覆盖原始文件)。


改动清单

改动 1:kernel 定义(模板 136-166 行)
原始脚本仿真脚本
@tilelang.jit(out_idx=[-1])删掉
def matmul(M, N, K, ...):def make_kernel():
T.Tensor((M, K), dtype)T.Tensor((1024, 256), "float16") ← 用 Step1 解析出的具体数值
T.alloc_L0C(..., "float16")T.alloc_L0C(..., "float") ← A5 pto-isa 要求 float32
func = matmul(...) 触发编译删掉,编译在 main() 里统一处理

生成的代码结构:

python
def make_kernel():
    import tilelang.language as T
    @T.prim_func
    def main(
        A: T.Tensor((1024, 256), "float16"),   # ← 具体数值
        B: T.Tensor((256, 1024), "float16"),
        C: T.Tensor((1024, 1024), "float16"),
    ):
        # ... kernel 逻辑(和原始脚本一模一样)...
    return main
改动 2:数据准备(模板 214-233 行)

a) 维度变量(第 215 行)

根据 Step1 的 buffers 设置:

python
# 原始模板(gemm 专用)
M, N, K = 1024, 512, 256

# 通用写法:从 buffers 提取
# buffers[0].shape = [M, K]  →  M = shape[0], K = shape[1]
# buffers[1].shape = [K, N]  →  N = shape[1]
# buffers[2].shape = [M, N]

如果不是矩阵(比如 1D/3D tensor),按实际 shape 处理。

b) 数据 dtype(第 216-218 行)

python
# float16 → np.float16
# float32 → np.float32
# int32   → np.int32

c) 数据填充(第 219-224 行)

float16 必须用小值防止溢出(>65504 就变成 inf):

python
# 模式:np.float16((i % 100 + 1) * (j % 100 + 1) * 0.0001)
# 根据实际 tensor 维度调整循环层数

d) 设备内存分配(第 227-229 行)

python
# float16:每个元素 2 字节 → size * 2
# float32:每个元素 4 字节 → size * 4
itemsize = 2 if dtype == "float16" else 4
d_A = dev_malloc(rt, total_elements * itemsize)

e) 参考计算(第 225 行)

python
# gemm:       h_Ref = h_A.astype(np.float32) @ h_B.astype(np.float32)
# elementwise:h_Ref = (h_A.astype(np.float32) + h_B.astype(np.float32))
# 其他:根据原始脚本的逻辑写对等的 numpy 计算
改动 3:call 函数签名(模板 210 行)
python
# 原始模板(3 输入 + stream = 4 个参数)
kl.call.argtypes = [ctypes.c_void_p] * 4

# 实际参数数量 = kernel 的 buffer 数量 + 1(stream)
# buffers 有 3 个 → argtypes = [ctypes.c_void_p] * 4
# buffers 有 2 个 → argtypes = [ctypes.c_void_p] * 3
# buffers 有 4 个 → argtypes = [ctypes.c_void_p] * 5

call() 的调用(第 237 行)也要对应:

python
# 3 个 buffer:kl.call(d_A, d_B, d_C, stream)
# 2 个 buffer:kl.call(d_in, d_out, stream)
# 4 个 buffer:kl.call(d_A, d_B, d_C, d_D, stream)
改动 4:H2D 和 D2H 拷贝
python
# H2D(CPU → 设备),第 230-231 行
rt.rtMemcpy(d_A, size, h_A.ctypes.data, size, 1)  # 最后一个参数 1 = host→device
                                                    # 每个输入 buffer 都要拷一次

# D2H(设备 → CPU),第 239 行
rt.rtMemcpy(h_C.ctypes.data, size, d_C, size, 2)  # 最后一个参数 2 = device→host
                                                    # 只有输出 buffer 需要拷
不需要改的部分

以下代码在任何转换中都保持原样:

  • import 语句(12-18 行)
  • _find_ascend_home()、_source_cann()、_find_sim_lib()、setup()(25-96 行)
  • load_runtime()、dev_malloc()(99-133 行)
  • tilelang.lower() + LibraryGenerator 编译流程(189-211 行)
  • rtStreamCreate / rtStreamSynchronize / rtStreamDestroy(232-233、238、254 行)
  • 验证逻辑框架(242-251 行)
  • 清理代码(253-256 行)

测试数据生成规则

  • float16:np.float16((i % 100 + 1) * (j % 100 + 1) * 0.0001),防溢出(max ≈ 65504)
  • float32:直接用 np.float32(...),范围宽不溢出
  • 参考输出:统一用 float32 计算,保证精度

© tile-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in .agents/skills/tilelang-a5-sim-convert of tile-ai/tilelang-ascend.

  • SKILL.md
  • scripts/parse_example.py
  • scripts/run_a5_sim_template.py

Open the folder on GitHubat commit 83b0ece

Compare with similar skills

Tilelang A5 Sim Convert next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tilelang A5 Sim Convert compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tilelang A5 Sim Convert this skilltile-ai/tilelang-ascend402—~1.1kAutomated safety check: PassMIT
Convertremotion-dev/remotion63k—~247Automated safety check: PassCustom licence
Sim Helmsimstudioai/sim30k—~2.2kAutomated safety check: PassApache-2.0
Word to Markdown Convertergithub/awesome-copilot40k—~1.6kAutomated safety check: PassMIT
Codebase To Wordpress Convertersickn33/agentic-awesome-skills47k1 repos~1.1kAutomated safety check: PassMIT
Postman Openapi Convertersickn33/agentic-awesome-skills47k1 repos~1.5kAutomated safety check: PassMIT

Similar skills

  • Convert

    remotion-dev/remotion

    Official

    Start the local @remotion/convert app and open it in the Codex browser.

    63k GitHub stars~247 tokensUpdated today
    Media & CreativeAuto-check passed
  • Sim Helm

    simstudioai/sim

    Install, upgrade, and operate the Sim Helm chart on Kubernetes.

    30k GitHub stars~2.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Word to Markdown Converter

    github/awesome-copilot

    Official

    Converts Word .docx files to Markdown with a bundled script before analysis, extracting embedded images and handling whole folders alongside the PDF and Excel converters.

    40k GitHub stars~1.6k tokensUpdated today
    Documents & OfficeAuto-check passed
  • Codebase To Wordpress Converter

    sickn33/agentic-awesome-skills

    Expert skill for converting any codebase (React/HTML/Next.js) into a pixel-perfect, SEO-optimized, and dynamic WordPress theme.

    47k GitHub starsUsed in 1 repo~1.1k tokens
    Frontend & DesignAuto-check passed
  • Postman Openapi Converter

    sickn33/agentic-awesome-skills

    Convert OpenAPI 3.x or Swagger 2.0 specs (YAML or JSON) into complete, import-ready Postman Collection v2.1 JSON files.

    47k GitHub starsUsed in 1 repo~1.5k tokens
    Backend & APIsAuto-check passed
  • Analyzes Chinese A-share convertible bonds with a three-part valuation, clause game analysis, the double-low strategy and a rotation framework for choosing bonds; instructions are in Chinese.

    35k GitHub stars~1.1k tokensUpdated today
    Business, Finance & HRAuto-check passed

More from tile-ai/tilelang-ascend

All 20 skills in this repo
  • Tilelang Submodule Pull

    tile-ai/tilelang-ascend

    Automatically pull tilelang repository and its third-party code.

    402 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Tilelang Debug Helper

    tile-ai/tilelang-ascend

    How to add debugging capabilities to TileLang Ascend example operators.

    402 GitHub stars~1.7k tokensUpdated today
    Auto-check: notes
  • Tilelang Env Check

    tile-ai/tilelang-ascend

    TileLang-Ascend 环境检查与配置验证技能。检查代码仓库完整性、编译安装状态、环境变量配置,并运行简单测试验证环境。发现问题会自动调用相关 skill 进行修复,并按依赖顺序重新执行后续步骤。触发关键词:"环境检查"、"检查环境"、"验证环境"、"环境配置"、"环境搭建"、"env check"、"check environment"、"verify…

    402 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Tilelang Op Test Design

    tile-ai/tilelang-ascend

    TileLang-Ascend 算子测试设计技能。支持多种场景:(1) 从 design.md 设计测试配置 (2) 从 examples/{op}/.py 补充测试 (3) 手动提供算子信息生成测试 (4) 测试覆盖率分析。理解算子实现逻辑后智能判断测试策略。触发:设计算子测试、生成测试用例、补充测试、测试覆盖率不足。

    402 GitHub stars~5.6k tokensUpdated today
    Auto-check passed
  • Tilelang Review

    tile-ai/tilelang-ascend

    检查代码格式是否符合 CI 规则。自动检测并安装缺失工具(ruff、clang-format),先运行检查生成报告,使用醒目方式询问用户后,仅在用户同意时执行修复。工作流程:检测环境→自动安装缺失工具→运行检查→生成报告→醒目询问→用户确认→执行修复。使用此技能当:用户要求"格式检查"、"格式化代码"、"代码格式化"、"检查代码格式"、"代码…

    402 GitHub stars~2.8k tokensUpdated today
    Auto-check: notes
  • Tilelang Op Develop

    tile-ai/tilelang-ascend

    基于设计文档生成 TileLang-Ascend 算子实现代码与测试。从 design.md 中提取关键信息,结合 examples/ 中的参考实现生成可运行代码。触发:实现算子、写 kernel、生成代码、算子编码、根据设计文档实现。

    402 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Questions about Tilelang A5 Sim Convert

What does Tilelang A5 Sim Convert do?

将 tilelang example 脚本转换为可在 A5 camodel 仿真器上直接运行的版本。输入脚本路径,输出一个新的 sim.py 文件,不覆盖原始文件。触发:仿真运行、camodel、A5 仿真、sim 模式、转换脚本为仿真、不需要 NPU 跑 kernel、simulate A5。. Tilelang A5 Sim Convert is an agent skill from tile-ai/tilelang-ascend.

How do I install Tilelang A5 Sim Convert in Claude Code?

Run `npx skills add tile-ai/tilelang-ascend --skill tilelang-a5-sim-convert -a claude-code`. Or copy the skill folder (.agents/skills/tilelang-a5-sim-convert in tile-ai/tilelang-ascend) into .claude/skills/tilelang-a5-sim-convert in your project. Claude Code loads it when a task matches its description.

How do I install Tilelang A5 Sim Convert in Codex?

Run `npx skills add tile-ai/tilelang-ascend --skill tilelang-a5-sim-convert -a codex`. Or copy the skill folder (.agents/skills/tilelang-a5-sim-convert in tile-ai/tilelang-ascend) into .agents/skills/tilelang-a5-sim-convert in your project. Codex loads it when a task matches its description.

Can I use Tilelang A5 Sim Convert in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tile-ai/tilelang-ascend --skill tilelang-a5-sim-convert -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tilelang-a5-sim-convert, .gemini/skills/tilelang-a5-sim-convert, .github/skills/tilelang-a5-sim-convert and .opencode/skills/tilelang-a5-sim-convert in your project.

What does Tilelang A5 Sim Convert need to run?

Going by SKILL.md and its folder, Tilelang A5 Sim Convert needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Tilelang A5 Sim Convert access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tilelang A5 Sim Convert safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Tilelang A5 Sim Convert use?

Tilelang A5 Sim Convert is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tilelang A5 Sim Convert use?

About 1.1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tilelang A5 Sim Convert?

Skills that share tags, products or a category with Tilelang A5 Sim Convert: Convert (remotion-dev/remotion, 63k stars), Sim Helm (simstudioai/sim, 30k stars), Word to Markdown Converter (github/awesome-copilot, 40k stars) and Codebase To Wordpress Converter (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tilelang A5 Sim Convert?

tile-ai (a GitHub organization) maintains it in tile-ai/tilelang-ascend, which has 402 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 9, 2026.

Source: tile-ai/tilelang-ascend on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.