Agent skill

Tilelang API Best Practices

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

TileLang Ascend API 使用最佳实践。提供内存分配、数据搬运、矩阵计算、归约、元素级运算、同步、调度原语等 API 的正确用法和最佳实践。触发:使用 TileLang API 编写 Ascend NPU kernel 时或遇到 API 相关问题时。

MITAuto-check passedDevelopment

Install Tilelang API Best Practices

skills CLI
$ npx skills add tile-ai/tilelang-ascend --skill tilelang-api-best-practices -a claude-code

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

GitHub CLI
$ gh skill install tile-ai/tilelang-ascend tilelang-api-best-practices --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-custom-skill/tilelang-api-best-practices .claude/skills/tilelang-api-best-practices && 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-api-best-practices
GitHub stars
402
Token cost
~697 tokens
SKILL.md length
162 words
Files
4 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
MIT

At a glance

TileLang Ascend API 使用最佳实践。提供内存分配、数据搬运、矩阵计算、归约、元素级运算、同步、调度原语等 API 的正确用法和最佳实践。触发:使用 TileLang API 编写 Ascend NPU kernel 时或遇到 API 相关问题时。

  • Works in 5 steps: 先按场景读取一份 reference;不要一次加载全部文档。 → Reference 中链接的 docs/ 是公开契约,API… → 写 kernel 前检查最接近的 examples/;文档未覆盖时再查 → …
  • Development work in your project
  • SKILL.md covers API 文档索引, 场景索引 and 使用规则
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Tilelang API Best Practices is an agent skill from tile-ai/tilelang-ascend. TileLang Ascend API 使用最佳实践。提供内存分配、数据搬运、矩阵计算、归约、元素级运算、同步、调度原语等 API 的正确用法和最佳实践。触发:使用 TileLang API 编写 Ascend NPU kernel 时或遇到 API 相关问题时。

Its SKILL.md is about 700 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/api-compute.md`, `references/api-kernel-memory.md` and `references/api-schedule-sync.md`).

It sits in Development. The repository describes itself as: Ascend TileLang adapter. The licence is MIT.

When your agent uses it

  • Development work in your project

Example prompts

  • “/tilelang-api-best-practices”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 先按场景读取一份 reference;不要一次加载全部文档。
  2. Reference 中链接的 docs/ 是公开契约,API 签名和支持范围以该文档及当前源码为准。
  3. 写 kernel 前检查最接近的 examples/;文档未覆盖时再查
  4. 不从旧代码或 PR 描述推断当前接口,也不使用 legacy tilelang/language/pto.py。
  5. 更新本 skill 时只增加会改变 Agent 决策的规则;API 手册内容应在 canonical docs 中维护,

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

    No scripts in the folder and no shell commands in SKILL.md.

    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 API Best Practices loads about 697 tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 40 tokens; SKILL.md has 162 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~697
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

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); files beside SKILL.md are not scanned.

SKILL.md

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

Download SKILL.mdSave it as .claude/skills/tilelang-api-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
tilelang-api-best-practices
description
TileLang Ascend API 使用最佳实践。提供内存分配、数据搬运、矩阵计算、归约、元素级运算、同步、调度原语等 API 的正确用法和最佳实践。触发:使用 TileLang API 编写 Ascend NPU kernel 时或遇到 API 相关问题时。

TileLang Ascend API 最佳实践


API 文档索引

文档涵盖内容典型场景
api-kernel-memory.mdKernel 定义、JIT/compile_flags、内存分配、数据搬运Kernel 编写、编译配置、片上存储管理
api-compute.mdGEMM、归约、tmp arena、Element-wise、Tile 扩展原语GEMM、Softmax、逐元素计算、排序、显式 UB 规划
api-schedule-sync.md循环(T.serial, T.unroll)、流水线(T.Pipelined)、持久化调度(T.Persistent)、同步(T.set_flag/wait_flag, T.barrier_all, T.set_cross_flag)、调试(T.printf, T.dump_tensor)流水线优化、多核均衡、同步、调试

场景索引

使用场景相关文档关键技巧
GEMM 矩阵乘api-compute, api-kernel-memory内存层级、layout、init 与模式对应的同步
Softmax/LayerNormapi-computeT.reduce_max/sum、T.tile.exp/sub/div
逐元素计算api-computeT.Parallel + 符号 API 或 T.tile.xxx 两种范式
多 block/core 累加到 GMapi-computeT.tile.atomic_add(dst_gm, src_local),调用前显式清零 GM
CV 融合算子api-kernel-memory, api-schedule-syncDeveloper/Hybrid 用 threads + passes;Expert 用显式 scope/sync
流水线优化api-schedule-syncT.Pipelined num_stages、核间/核内流水线
多核负载均衡api-schedule-syncT.Persistent 缓存友好调度
排序api-computeT.tile.sort → T.tile.merge_sort → T.tile.topk
显式 UB scratch / row-expandapi-compute区分通用 tmp arena 与 row-expand 专用布局
JIT 编译选项api-kernel-memory使用 kernel-scoped compile_flags,不修改进程环境
手动缓冲复用api-schedule-sync同时审计 ready 与 free 两个 ownership 方向
Kernel 调试api-schedule-syncT.printf、T.dump_tensor、get_kernel_source()
dtype 标量回退适配api-compute先确认硬件支持;同宽 reinterpret / kernel 内 cast / record-aware DMA / 块 DMA + UB-local fallback;宽 dtype lane 拆分仅作已验证实验

使用规则

  1. 先按场景读取一份 reference;不要一次加载全部文档。
  2. Reference 中链接的 docs/ 是公开契约,API 签名和支持范围以该文档及当前源码为准。
  3. 写 kernel 前检查最接近的 examples/;文档未覆盖时再查 tilelang/language/ascend.py、ascend_tile.py 和 testing/python/language/。
  4. 不从旧代码或 PR 描述推断当前接口,也不使用 legacy tilelang/language/pto.py。
  5. 更新本 skill 时只增加会改变 Agent 决策的规则;API 手册内容应在 canonical docs 中维护, 这里通过链接引用,不复制第二份。

© 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 3 other files (references) in .agents/skills/tilelang-custom-skill/tilelang-api-best-practices of tile-ai/tilelang-ascend.

  • SKILL.md
  • references/api-compute.md
  • references/api-kernel-memory.md
  • references/api-schedule-sync.md

Open the folder on GitHubat commit 83b0ece

Compare with similar skills

Tilelang API Best Practices 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 API Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tilelang API Best Practices this skilltile-ai/tilelang-ascend402—~697Automated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-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 A5 Sim Convert

    tile-ai/tilelang-ascend

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

    402 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • 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

Categories

Questions about Tilelang API Best Practices

What does Tilelang API Best Practices do?

TileLang Ascend API 使用最佳实践。提供内存分配、数据搬运、矩阵计算、归约、元素级运算、同步、调度原语等 API 的正确用法和最佳实践。触发:使用 TileLang API 编写 Ascend NPU kernel 时或遇到 API 相关问题时。. Tilelang API Best Practices is an agent skill from tile-ai/tilelang-ascend.

When should I use Tilelang API Best Practices?

Tilelang API Best Practices fits situations like: development work in your project.

How do I install Tilelang API Best Practices in Claude Code?

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

How do I install Tilelang API Best Practices in Codex?

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

Can I use Tilelang API Best Practices 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-api-best-practices -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-api-best-practices, .gemini/skills/tilelang-api-best-practices, .github/skills/tilelang-api-best-practices and .opencode/skills/tilelang-api-best-practices in your project.

What does Tilelang API Best Practices need to run?

SKILL.md names no scripts, command-line tools or credentials: Tilelang API Best Practices is instructions for the agent only.

Does Tilelang API Best Practices 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 API Best Practices 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. Review the folder before installing.

What licence does Tilelang API Best Practices use?

Tilelang API Best Practices 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 API Best Practices use?

About 697 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 14k tokens, read only when the agent opens those files.

What are the alternatives to Tilelang API Best Practices?

Skills that share tags, products or a category with Tilelang API Best Practices: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tilelang API Best Practices?

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.