Tilelang wiki

From wenyi-li/awesome-agent-kernel-skills · View interactive version

Tilelang wiki is an AI agent skill from the GitHub repository wenyi-li/awesome-agent-kernel-skills. A local, code-grounded TileLang reference skill for DSL semantics, kernel authoring, API lookup, tuning, debugging, examples, and compiler/runtime behavior. Use whenever you need to write, modify, explain, optimize, validate, or troubleshoot TileLang programming work.

How to use this skill

Skill file

TileLang Wiki

Use this skill when the user needs grounded help with TileLang concepts, kernel

authoring, optimization, debugging, operator selection, or compiler/runtime

internals.

Treat the bundled local files as the source of truth:

Do not rely on external TileLang docs unless the user explicitly asks for

outside information.

When To Invoke

Invoke this skill when the user asks:

Do not invoke this skill for unrelated CUDA, Triton, or generic TVM questions

unless the user is clearly working through TileLang material.

Primary Sources

Start with:

Open references/README.md, references/language_basics.md, and

references/jit_autotune.md early in development. They are the short path for

the current guide structure, basic kernel syntax, and compile/tuning workflow.

Use references/tilelang/README.md for top-level tilelang.* APIs and

references/tilelang_language/README.md for exact tilelang.language as T

APIs. Use references/python_compat.md for supported Python syntax, shapes,

tensors, dtypes, and casts.

Open FAQs.md early when the user reports a concrete compiler error, profiler

surprise, autotuning failure, or an example that compiles but does not validate

or perform as expected.

Also open FAQs.md early when the user says they changed kernel source but a

profile or autotune rerun did not appear to recompile. Cache behavior and cache

keys can be the real issue even when the kernel body changed.

Then open deeper files only as needed.

Language Basics

Always keep this mental model available when answering:

  1. Define a kernel with @tilelang.jit or a nested @T.prim_func.
  2. Declare shapes with T.const(...) or T.dynamic(...).
  3. Annotate buffers with T.Tensor(...) and outputs with T.empty(...).
  4. Launch work with T.Kernel(...).
  5. Allocate storage with T.alloc_shared(...), T.alloc_fragment(...), T.alloc_local(...), or T.alloc_var(...).
  6. Move tiles with T.copy(...).
  7. Compute with T.gemm(...), reductions, or elementwise loops.
  8. Optimize with T.Pipelined(...), swizzle, autotuning, or target-specific primitives.
  9. Validate against a reference and inspect generated code or profiling output if needed.

Important distinctions to explain clearly:

If the user is new to TileLang, start from references/README.md and the local

examples/quickstart.py pattern.

Working Style

Route by user intent, not by file tree.

  1. Identify the goal:
  1. Open references/README.md first for the compact overview, quick API table, and template shape.
  2. Open references/language_basics.md next for fast DSL basics, then route to references/tilelang_language/README.md for exact T.* APIs.
  3. Open examples/README.md when the user needs a matching runnable example.
  4. Open FAQs.md when the task sounds like a known failure mode or a practical

"why did this happen?" question.

  1. Use deeper pages under references/ only for exact semantics, caveats, or internals.
  2. Prefer the simplest correct example before advanced architecture-specific variants.

Answering Rules

assuming the source edit was ignored.

Important Caveats

runtime-internal notes live under references/old_programming_guiles/; use

them as archived background only after checking the newer cheatsheets and API

references.

surfaced in the higher-level guides; use it for surgical debugging advice.

recompile after a source edit. Do not assume the kernel body change alone

invalidated the active cache key; check the cache rules in the docs and FAQs.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.