跳到主要内容
TileLang 系统教程

tilelang-tutorial.huandu.me

资料与版本

教材正文里出现的每一处源码与资料引用,都指向这里列出的上游地址。本地快照只用于写作与核对, 不上线;下面给出的是可以公开访问的原文链接。

例外的只有教程编者自己撰写的三篇综合笔记——它们是本项目的原创内容,因此随教程一起发布, 见 编者笔记。

版本锁定

版本锁定(全项目唯一事实来源)

所有章节、所有代码、所有引用,必须基于下表版本。任何地方出现「最新版」这类 模糊说法都算缺陷。若上游发布新 tag,只更新本文件并整体重审,不允许单章漂移。

组件 版本 commit 日期 本地路径
TileLang(主干) v0.1.15 a35f8ddf45eba16c21211ec8822d56ce5363036f 2026-09-30 _vendor/tilelang-v0.1.15/
TileLang-Ascend(昇腾适配器) TileLang-ascend-v0.1.2.000-release(仓库内 VERSION 文件写 0.1.4,以 tag 为准) 89a9364e47a341fffdd65ed94786b1d4f9b6a78c 2026-09-08 _vendor/tilelang-ascend-v0.1.2.000/

辅助(仅供对照,不是分析基线):

组件 版本 commit 用途
TileLang(上一个 release) v0.1.14 7e3bbf3703e769479757eb7ecec2f2626f3cd0a8 回答「某能力是不是 v0.1.15 新增的」,见 _vendor/tilelang-v0.1.14/

取自 tag 而不是 main:main 每天都在动,无法让多个章节、多个作者得出可复核的结论。 两个仓库都是 git clone --depth 1 --branch <tag>,工作树干净,git status 为空。

v0.1.15 里有什么(写章节前先确认过的事实)

  • tilelang/ascend/ 与 src/ascend/ 已经存在:昇腾后端已进主干,不只是适配器仓库。
  • tilelang/{language,transform,layout,engine,backend,jit,cache,autotuner,carver,cuda,rocm,metal,cpu,webgpu,tools,profiler}/ 全部存在;examples/ 有 54 个子目录 + 3 个顶层文件(conftest.py、pytest.ini、 quickstart.py,合计 57 项);docs/ 有 37 个 Markdown。
  • VERSION 文件 = 0.1.15。

引用规则

  • 引用源码时写成 _vendor/tilelang-v0.1.15/<相对路径>,并给出行号区间(path:120-138)。
  • 引用资料时写成 corpus 路径:资料库索引。
  • 引用上游链接时必须是本 corpus 里已存在或已核验可达的 URL;无法核验的写 「未核验」并说明原因。
  • 涉及「这个功能在不在 release 里」的判断,一律以本表版本为准;如果要讨论 main 上更新的东西,必须显式标注「仅 main / 未进 v0.1.15」,并且放到第 30 章(前沿)里。

第五部分(第 32–39 章)的版本锁定

第五部分分析的是 2026-09-30 DeepSeek 面向昇腾开源的整套基础设施。它的对象不是一个 release tag,而是 13 个仓库在 2026-10-01 的 main 快照,以及官方发布文章的正文转录。 逐个仓库的 commit 与日期记录在 资料库索引, 站点构建时会把 资料库索引 的引用解析成对应 commit 的 GitHub blob/tree 链接,所以行号是稳定可复核的。

组件 快照 commit 说明
TileKernels 66258df6175d 用 TileLang 写的双后端算子库(第 33、34 章)
DeepGEMM-Ascend 8491bbb4b8c0 昇腾 BLAS 与 MegaMoE(第 35 章)
DeepEP-Ascend 3b25377d04b2 昇腾专家并行通信(第 38 章)
FlashMLA 2e5429fc5653 含昇腾稀疏注意力与技术报告(第 36 章)
DeepSelect bfa4507d935f TopK 算子与算法报告(第 37 章)
DeepJIT / Engram / DeepSeek-V3.2-Exp / DualPipe / EPLB / clangd-ascend main 快照 配套组件与论文
DeepGEMM / DeepEP main 快照 NVIDIA 侧对照物

引用规则同上:写成 资料库索引。

与 v0.1.15 的关系:TileKernels 明确要求 TileLang >= 0.1.15,所以第五部分与全书其他 部分共用同一个 TileLang 基线;凡是第五部分用到 TileLang 语言层面的结论,一律回到 _vendor/tilelang-v0.1.15/ 核对,不要用 DeepSeek 仓库里的二手说法。

验证边界(第五部分特别重要):本机既没有昇腾 NPU,也没有 NVIDIA GPU,也没有 CANN。 第五部分所有代码都只能静态阅读;所有性能数字都来自各仓库 README / 技术报告并注明 测量条件(硬件型号、CANN 版本、形状、口径)。任何地方不得出现本机实测的说法。

环境记录

写作时使用的本机环境(供代码章节标注测试条件):

  • macOS (Apple Silicon),Python 3.11(miniconda)
  • 没有 NVIDIA GPU,没有 昇腾 NPU

这条限制决定了两件事:

  1. 任何需要真实加速器才能运行的代码,章节必须提供:可离线静态检查的版本(语法/API 一致性)、代码阅读说明、以及「在有卡机器上如何验证」的步骤。禁止宣称跑过没跑过的 结果。
  2. 性能数字一律引用 corpus 内的原始出处(论文/官方文档),并标注来源 id。

引用清单(121 条)

按主题分组。每条给出上游地址与可信度标注;「一手」表示论文或源码本身,「厂商」表示厂商文档, 「社区」表示第三方文章。

DeepSeek 昇腾全栈开源 18

  • DeepSeek 开源昇腾基础组件(官方发布说明)
    DeepSeek· 2026· 一手· deepseek-article-20260930

    2026-09-30 的官方发布文章,列出了本次开源的六个组件与各自仓库地址。 本部分的所有章节都以这篇文章给出的清单为范围基线。

  • deepseek-ai/TileKernels
    DeepSeek· 2026· 一手· github-deepseek-tilekernels

    用 TileLang 写的生产算子库,同一份算法提供 CUDA 与 Ascend 两个后端。 是「一份算法、两个后端」写法的最佳教材,也是本教程第 33、34 章的主线。

  • deepseek-ai/DeepGEMM-Ascend
    DeepSeek· 2026· 一手· github-deepseek-deepgemm-ascend

    DeepGEMM 的昇腾实现,支持 BF16/FP8/FP4 GEMM、MQA logits、MegaMoE 与 mHC prenorm。 主体是 Ascend C 与 MAD 原语抽象,mHC prenorm 由 TileLang 实现,适合讲两条路线的分工。

  • deepseek-ai/DeepEP-Ascend
    DeepSeek· 2026· 一手· github-deepseek-deepep-ascend

    昇腾上的专家并行通信库:EP dispatch/combine、FP8 dispatch、延迟 epilogue, 以及 PP/Bucket/Engram 等通信原语。README 给出了 EP8–EP128 的实测带宽。

  • deepseek-ai/DeepGEMM(NVIDIA 版)
    DeepSeek· 2026· 一手· github-deepseek-deepgemm

    DeepGEMM-Ascend 的对照物。官方明确说 Ascend 版「完全兼容 DeepGEMM 的 API」, 所以两边对照着读才能看清哪些是平台无关的接口、哪些是平台相关的实现。

  • deepseek-ai/DeepEP(NVIDIA 版)
    DeepSeek· 2026· 一手· github-deepseek-deepep

    DeepEP-Ascend 公开 API 的对齐目标(V2.5 的 EPBuffer 接口)。

  • deepseek-ai/FlashMLA
    DeepSeek· 2026· 一手· github-deepseek-flashmla

    DeepSeek 的注意力算子库。2026-09-30 增加了昇腾 950 的稀疏 prefill/decode 算子, 并附一篇昇腾实现的技术报告(docs/20260930-ascend-prefill-deep-dive-zh.md)。

  • Ascend Sparse Attention Forward 算法与优化技术简析
    DeepSeek· 2026· 一手· doc-flashmla-ascend-prefill-deep-dive

    昇腾稀疏注意力算子的设计说明:1C2V 的推导、rescale 放哪、ND2NZ 时机、 gather2、高速 ND2NZ、icache 与 L1 bank 配平。本教程第 36 章的主要依据。

  • deepseek-ai/DeepSelect
    DeepSeek· 2026· 一手· github-deepseek-deepselect

    DSA 与采样器用的 TopK 算子,CUDA 与昇腾双平台。算法(阈值筛选 + RadixSelect) 与实现技巧分开讲,是「算法先行」的范例。

  • DeepSelect 算法与实现简析
    DeepSeek· 2026· 一手· doc-deepselect-deep-dive

    含随机块序下的期望复杂度证明,以及 CUDA 侧用 PTX 与位运算压低常数的技巧。

  • deepseek-ai/DeepJIT
    DeepSeek· 2026· 一手· github-deepseek-deepjit

    DeepGEMM-Ascend 与 DeepEP-Ascend 共用的运行时编译层。 和 TileLang 自己的 JIT 是同一层抽象的两个实现,值得对照。

  • deepseek-ai/Engram:Conditional Memory via Scalable Lookup
    DeepSeek· 2026· 一手· github-deepseek-engram

    TileKernels 里 Engram 算子的来源论文与参考实现。仓库内含 Engram_paper.pdf。

  • Conditional Memory via Scalable Lookup: A New Axis of Sparsity for LLMs(Engram 论文)
    DeepSeek-AI / Peking University· 2026· 一手· paper-deepseek-engram

    TileKernels 里 Engram 算子族的来源论文。给出 MoE(条件计算)与 Engram(条件记忆) 之间的容量分配 scaling law,并说明为什么确定性寻址可以把大表卸载到 host memory。 本地文本抽取见 14-deepseek-ascend-stack/raw/paper-deepseek-engram.md。

  • mHC: Manifold-Constrained Hyper-Connections
    DeepSeek-AI· 2025· 一手· paper-deepseek-mhc

    TileKernels 的 mhc/ 算子族与 DeepGEMM-Ascend 的 HC prenorm GEMM 的论文依据。 第 4.3 节(Kernel Fusion / Recomputing / Overlapping Communication in DualPipe) 正是这几个 kernel 与 DualPipe 的设计来源。本地文本抽取见 14-deepseek-ascend-stack/raw/paper-deepseek-mhc.md,PDF 为 paper-deepseek-mhc.pdf。

  • deepseek-ai/DeepSeek-V3.2-Exp
    DeepSeek· 2025· 一手· github-deepseek-v3-2-exp

    DeepSeek Sparse Attention(DSA)的首次公开实现。FlashMLA 的稀疏算子与 DeepSelect 的 TopK 都是为它服务的,先读这里再看算子更顺。

  • deepseek-ai/DualPipe
    DeepSeek· 2026· 一手· github-deepseek-dualpipe

    双向流水并行算法,用来讲「通信与计算重叠」在训练侧的组织方式。

  • deepseek-ai/EPLB
    DeepSeek· 2025· 一手· github-deepseek-eplb

    专家并行负载均衡器。DeepEP-Ascend 的 lb_prefetch_weights / lb_reduce_grads 接口就是为它预留的。

  • deepseek-ai/clangd-ascend
    DeepSeek· 2026· 一手· github-deepseek-clangd-ascend

    昇腾 C/C++ 与 Ascend C 的 clangd 配置。写 Ascend C 侧代码时的补全与 lint 基础。

NVIDIA 后端与工具链 15

  • CUDA C++ Programming Guide
    NVIDIA· 2026· 厂商· nvidia-cuda-c-programming-guide

    The grid/block/warp/thread model, the memory hierarchy, and the async primitives (cp.async, TMA, mbarrier). Everything TileLang's "expert level" interface exposes is defined here first.

  • CUDA C++ Best Practices Guide
    NVIDIA· 2026· 厂商· nvidia-cuda-best-practices

    Practical performance model: occupancy, coalescing, arithmetic intensity. The baseline against which kernel authors judge a tile configuration.

  • Parallel Thread Execution ISA
    NVIDIA· 2026· 厂商· nvidia-ptx-isa

    The instruction set TileLang ultimately emits. Read the sections on `mma`/`wgmma`/`tcgen05.mma`, `cp.async.bulk.tensor` (TMA), and the memory consistency model when you want to know what a TileLang intrinsic expands to.

  • Hopper Tuning Guide
    NVIDIA· 2026· 厂商· nvidia-hopper-tuning-guide

    Vendor tuning advice for sm90: TMA, clusters, distributed shared memory. The direct target of TileLang's cluster/TMA programming guide.

  • Blackwell Tuning Guide
    NVIDIA· 2026· 厂商· nvidia-blackwell-tuning-guide

    sm100/sm120 specifics: tensor memory (TMEM), tcgen05 MMA, block scaling. TileLang already has tcgen05 examples and macro generators; this is the document that explains the constraints they encode.

  • CUTLASS Documentation
    NVIDIA· 2026· 厂商· nvidia-cutlass-docs

    The C++ tile library TileLang competes with and partly mirrors (CuTe layouts, MMA atoms, epilogues). Reading it makes `T.gemm`'s layout/policy parameters much less magical.

  • CuTe: C++ template abstractions for layout algebra
    NVIDIA· 2026· 厂商· nvidia-cutlass-media-docs-cute

    Layout algebra (shape/stride/layout composition, tiling and partitioning of threads and values). TileLang's layout inference solves the same problem symbolically; this is the concrete formulation to compare against.

  • NVIDIA Hopper Architecture In-Depth
    NVIDIA· 2022· 厂商· nvidia-blog-hopper-architecture-in-depth

    The vendor overview of Hopper: TMA (descriptor-based bulk async copy), thread block clusters and distributed shared memory, and the fourth-gen tensor core. This is the hardware story behind the `T.copy` -> TMA lowering and the cluster/TMA programming guide.

  • CUDA Blackwell Compatibility Guide
    NVIDIA· 2026· 厂商· nvidia-blackwell-compatibility-guide

    What changed for programs on Blackwell (sm100/sm120): new tensor-core and tensor-memory (TMEM) semantics, tcgen05 instructions, and the compatibility rules. Pair with the Blackwell Tuning Guide; the earlier blog-style architecture overview we tried to cite 404s, so this official guide is used instead.

  • Nsight Compute Documentation
    NVIDIA· 2026· 厂商· nvidia-nsight-compute-docs

    How to measure a kernel: SOL sections, memory workload analysis, warp stalls. Needed for any serious tuning claim about a TileLang kernel.

  • Benchmarking and Dissecting the Nvidia Hopper GPU Architecture
    arXiv· 2024· 一手· arxiv-2402-13499

    Measured latencies/bandwidths for Hopper rather than vendor claims. The numbers you want when sanity-checking a pipeline stage count.

  • Dissecting the NVIDIA Volta GPU Architecture via Microbenchmarking
    arXiv· 2018· 一手· arxiv-1804-06826

    The original methodology paper for the Hopper/Blackwell dissections; useful when you need to measure an unfamiliar machine yourself.

  • Dissecting the NVidia Turing T4 GPU via Microbenchmarking
    arXiv· 2019· 一手· arxiv-1903-07486

    The intermediate step of the same series; retained for completeness of the hardware-model reading path.

  • NVIDIA/cuda-samples
    GitHub· 2026· 厂商· nvidia-cuda-samples

    Reference CUDA implementations (including Hopper TMA/WGMMA samples). When a TileLang codegen path looks odd, compare the generated CUDA against the vendor's own sample.

  • NVIDIA/cutlass
    GitHub· 2026· 厂商· github-nvidia-cutlass

    Source for the C++ tile abstractions TileLang's CuTe/PTX intrinsics mirror, including the tcgen05 and block-scaled MMA generators.

TileLang 主干仓库 2

  • tile-ai/tilelang
    GitHub· 2026· 一手· github-tile-ai-tilelang

    The main repository (also cloned in full at 02-tilelang-core-repo/raw/tilelang). The README, docs/ tree, examples/ and tilelang/ + src/ trees are the ground truth for every claim in this corpus.

  • microsoft/BitBLAS
    GitHub· 2026· 一手· github-microsoft-bitblas

    The low-bit operator library from the same MSRA group. Several ideas and contributors carried over into TileLang; reading it clarifies where the project's low-precision focus came from.

TileLang 昇腾后端 4

  • TileLang AscendNPU IR 从入门到专家算子开发知识点
    HiAscend· 2026· 厂商· huawei-techarticle-tilelang-npuir

    Huawei's own TileLang+Ascend training material: TileLang and MLIR basics, Pythonic programming, and a hand-written FlashAttention operator. The most direct official bridge between the two halves of this corpus.

  • tile-ai/tilelang-ascend
    GitHub· 2026· 一手· github-tile-ai-tilelang-ascend

    The dedicated Ascend adapter: two backend routes (Ascend C & PTO, and AscendNPU IR), a programming guide, per-operator tutorials, and DeepSeek V4 kernels. This is the single most important source for the Huawei side.

  • tile-ai/tilelang-mlir-ascend
    GitHub· 2026· 一手· github-tile-ai-tilelang-mlir-ascend

    The MLIR-based Ascend path. Where the TVM/TIR route and the MLIR route diverge is exactly the kind of question a would-be backend contributor has to answer, so both sources are needed.

  • tile-ai/TileFoundry
    GitHub· 2026· 一手· github-tile-ai-tilefoundry

    Infrastructure for standing up new TileLang backends. Read together with 08-frontier-unmerged/raw/github-issue-2115 (multi-backend refactoring) to understand how a third chip vendor is expected to plug in.

前沿与未合入 14

华为昇腾与 CANN 15

  • Pangu Ultra MoE: How to Train Your Big MoE on Ascend NPUs
    arXiv (Huawei)· 2025· 厂商· arxiv-2505-04519

    Huawei's own account of training a large MoE on Ascend, including the software-stack constraints. Vendor source, and the least bad description of how the Ascend stack behaves at scale.

  • NPUEval: Optimizing NPU Kernels with LLMs and Open Source Compilers
    arXiv· 2025· 一手· arxiv-2507-14403

    Benchmark/eval for NPU kernel generation on Ascend; a concrete yardstick for the "LLM writes Ascend kernels" workflows that TileLang@Ascend is part of.

  • CANN 异构计算架构总览
    HiAscend· 2026· 厂商· huawei-hiascend-cann

    Entry point to CANN: GE/Graph Engine, runtime, compiler (bisheng), operator libraries, HCCL. Establishes which layer a given Ascend problem belongs to.

  • Ascend C 算子开发
    HiAscend· 2026· 厂商· huawei-hiascend-ascend-c

    The C/C++ kernel language TileLang@Ascend's PTO route lowers to. Reading it first makes the comparison "what does TileLang remove from Ascend C" concrete.

  • CANN 编译器(毕昇编译器)
    HiAscend· 2026· 厂商· huawei-hiascend-bisheng

    Huawei's LLVM-based compiler for Host-Device heterogeneous code. The backend TileLang's generated source is handed to.

  • 昇腾算子开发场景
    HiAscend· 2026· 厂商· huawei-hiascend-operator

    Vendor overview of the operator development options available on Ascend (Ascend C, TBE, Triton, and now TileLang), useful for positioning TileLang inside Huawei's own story.

  • CANN 开源项目列表
    HiAscend· 2026· 厂商· huawei-hiascend-open-map

    Map of Huawei's open-sourced CANN components (Ascend C, CATLASS, PTO, graph engine, ...). Use it as the authoritative list of where the source lives.

  • cann/pto-isa — PTO instruction set architecture
    GitCode (CANN)· 2026· 厂商· gitcode-cann-pto-isa

    The PTO (Programmable Tensor Operations) ISA specification — the tile-level instruction set that TileLang@Ascend's PTO backend targets, and the subject of the 知乎 author's article series.

  • cann/catlass — Ascend C template library
    GitCode (CANN)· 2026· 厂商· gitcode-cann-catlass

    Huawei's CUTLASS analogue for Ascend C. The baseline TileLang@Ascend GEMM kernels are benchmarked against.

  • huawei-csl/pto-dsl
    GitHub· 2026· 厂商· github-huawei-csl-pto-dsl

    A Pythonic interface and JIT compiler for PTO-ISA — i.e. Huawei's own tile-DSL experiment next to TileLang. Comparing the two designs is one of the more informative exercises in this corpus.

  • PTO-ISA/pto-spec
    GitHub· 2026· 厂商· github-pto-isa-pto-spec

    Formal definition of the PTO ISA (normative language / ASL model). The precise semantics behind the Ascend tile instruction set.

  • PTO-ISA/PTO-Gym
    GitHub· 2026· 厂商· github-pto-isa-pto-gym

    Tile-operation tutorials and examples for PTO-based programming; the hands-on half of the PTO spec.

  • huawei-csl/pto-kernels
    GitHub· 2026· 厂商· github-huawei-csl-pto-kernels

    Hand-written PTO kernels. These are the performance ceiling that a TileLang kernel on Ascend has to be compared against.

  • huawei-csl/megagdn-pto
    GitHub· 2026· 厂商· github-huawei-csl-megagdn-pto

    Megakernel for Gated DeltaNet written with PTO-ISA. A concrete "what the low-level tile ISA can express" example on Ascend.

  • PTO-ISA/pyCircuit
    GitHub· 2026· 厂商· github-pto-isa-pyciruit

    Python-first hardware construction toolkit with MLIR compilation. Included because the 知乎 author's article set treats it as the hardware-generation end of the same PTO story, and it shows where the tile abstraction is heading beyond kernel writing.

相邻编译器 13

  • MLIR: A Compiler Infrastructure for the End of Moore's Law
    arXiv· 2020· 一手· arxiv-2002-11054

    The multi-level IR philosophy. TileLang keeps its own TVM/TIR path but the Ascend backend has an MLIR-based sibling (tilelang-mlir-ascend), so this is the common language between the two approaches.

  • The Deep Learning Compiler: A Comprehensive Survey
    arXiv· 2020· 一手· arxiv-2002-03794

    Best single orientation to the whole compiler landscape (graph IR, operator level, multi-level IR, backends). Use it as the first reading for anyone who has only used PyTorch and never seen a compiler pass pipeline.

  • Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions
    arXiv· 2018· 一手· arxiv-1802-04730

    The polyhedral-scheduling ancestor of today's tensor DSLs. Shows the alternative design point (automatic scheduling) that TileLang consciously trades away for predictability and controllability.

  • Triton: An Intermediate Language and Compiler for Tiled Neural Network Computations
    MAPL 2019 (Harvard / IBM)· 2019· 一手· triton-mapl-2019

    The original Triton paper (DOI 10.1145/3315508.3329973), mirrored locally as triton-mapl-2019.pdf with a page-by-page text extraction in triton-mapl-2019.md. This is the design point TileLang is measured against: Triton treats the program as blocks over a tensor with a compiler-chosen schedule; TileLang keeps explicit tiles, layouts and memory placement in the language. Read it for what "tiled intermediate language" originally meant, and note that the 2019 language is much smaller than today's Triton.

  • triton-lang/triton
    GitHub· 2026· 一手· github-triton-lang-triton

    The Triton implementation, i.e. TileLang's most common comparison target. The original paper is "Triton: An Intermediate Language and Compiler for Tiled Neural Network Computations" (MAPL 2019, DOI 10.1145/3315508.3329973); it is not mirrored here because the open copies we probed 404 and the ACM PDF is bot-blocked, so cite the DOI and use this repo plus the docs for detail. The decisive contrast with TileLang is that Triton hides the tile and lets the compiler pick the schedule, while TileLang keeps explicit tiles, layouts and memory placement in the language.

  • Triton documentation
    Triton· 2026· 一手· triton-docs

    Current Triton language/API reference, for side-by-side reading with the TileLang language guide.

  • CuTe DSL 文档(CUTLASS Python DSL)
    NVIDIA· 2026· 厂商· nvidia-cutedsl-docs

    NVIDIA 官方的 Python tile DSL 文档。它是 TileLang 在 NVIDIA 侧最直接的对照物: 同样用 Python 写 tile 程序,但绑定 CUTLASS/CuTe 的抽象与 NVIDIA 自己的编译路径。 第 5 章对比与第 24 章 NVIDIA 后端都用它来界定「TileLang 自己的边界在哪里」。

  • NVIDIA/cutile-python
    GitHub· 2026· 厂商· github-nvidia-cutile-python

    cuTile 的开源实现(Python 包)。NVIDIA 新一代 tile 编程模型,面向 Blackwell 一代的硬件特性;与 TileLang 属于同一抽象层次的竞争路线。第 1、5、24 章引用它 说明「tile DSL」这一波的产业走向。

  • Apache TVM documentation
    Apache· 2026· 一手· tvm-docs

    Upstream TVM/TIR documentation: IR structure, schedules, target/device abstraction. TileLang is a TVM dialect in practice, so this is its standard library documentation.

  • MLIR documentation
    LLVM· 2026· 一手· mlir-docs

    Dialect and pass infrastructure. Required reading for the AscendNPU IR route, which is MLIR-based rather than TVM-based.

  • Halide documentation — a language for fast, portable data-parallel computation
    Halide· 2026· 一手· halide-docs

    The ancestor of the "separate algorithm from schedule" idea that TVM adopted and TileLang re-specialised for AI tiles.

  • torch.compile documentation
    PyTorch· 2026· 一手· pytorch-torch-compile-docs

    The graph-capture/Inductor pipeline that a TileLang kernel has to fit into when it is used from PyTorch. Explains the boundary TileLang does *not* cover (graph-level fusion and autotuning).

  • PyTorch Inductor: generated kernels
    PyTorch· 2026· 一手· pytorch-inductor-kernels

    How to see the kernels Inductor generates. The practical way to decide when torch.compile is enough and when a TileLang kernel has to be dropped in.

知乎(乱序摸鱼) 1

  • DeepSeek 开源昇腾基础组件将会带来哪些影响?
    知乎(乱序摸鱼)· 2026· 社区· zhihu-dazhiruoyu-deepseek-ascend

    The single 知乎 article the user pointed at, and the best Chinese-language account of TileLang's Ascend port. Covers the NV-vs-950 architectural mismatch table, the new Ascend-specific intrinsics (T.alloc_l1/l0a/l0b/l0c, T.SimtVF/T.SimdVF, T.dual_copy), layout inference and ND->NZ fractal normalization, and how Z3 is used to solve the multi-pipeline scheduling and buffer-multiplicity constraints that Ascend C leaves to the human. Full text and images live in 09-zhihu-da-zhi-ruo-yu/raw/answers/.

社区、课程与讲解 4

  • GPU MODE lectures
    GitHub· 2026· 社区· gpu-mode-lectures

    Community lecture series on GPU programming that repeatedly covers TileLang alongside CUDA/Triton. Good source of talk recordings and slides links for the learning-path document.

  • TileLang-Ascend 视频课程(5 讲)
    Bilibili (tilelang-ascend team)· 2026· 一手· bilibili-tilelang-ascend-lessons

    Official course: environment setup, programming basics, the developer programming model, performance-tuning/debug tools, and deployment. Recorded in Chinese; the companion repo is tile-ai/tilelang-ascend. (Only the landing page is archived here; this corpus does not mirror video.)

  • tile-ai/tilelang-puzzles
    GitHub· 2026· 一手· github-tile-ai-tilelang-puzzles

    Ten graded exercises that teach TileLang by making you write kernels. The best existing starting point for the "learn by doing" track of a course.

  • tile-ai/tilelang-lsp
    GitHub· 2026· 一手· github-tile-ai-tilelang-lsp

    Language server for TileLang kernels. Minor for learning, but it documents the developer-experience side of the frontend.

端到端训练与推理 13

  • Hugging Face Transformers 文档
    Hugging Face· 2026· 厂商· hf-transformers-docs

    端到端章节的基础工具文档:模型加载、tokenizer、Trainer/训练参数、混合精度、 checkpoint 保存与恢复。第 17 章「用 HF 资产训练 7B」直接依赖它。 (原地址 https://huggingface.co/docs/transformers/index 在本机不可达:huggingface.co 直连与走本地代理均 SSL EOF,改用中国镜像 hf-mirror.com 抓取;镜像内容与官网一致,引用时以原地址为准。)

  • Hugging Face Datasets 文档
    Hugging Face· 2026· 厂商· hf-datasets-docs

    数据集加载、流式读取、tokenize 与打包(packing)的官方说明;训练章节数据管线的 权威出处。 (原地址 https://huggingface.co/docs/datasets/index 在本机不可达:huggingface.co 直连与走本地代理均 SSL EOF,改用中国镜像 hf-mirror.com 抓取;镜像内容与官网一致,引用时以原地址为准。)

  • Hugging Face Accelerate 文档
    Hugging Face· 2026· 厂商· hf-accelerate-docs

    单机多卡/多机训练的抽象层,解释 device placement、混合精度与梯度同步在 HF 生态里 怎么表达。写训练章节时需要它来说明「哪些部分不归 TileLang 管」。 (原地址 https://huggingface.co/docs/accelerate/index 在本机不可达:huggingface.co 直连与走本地代理均 SSL EOF,改用中国镜像 hf-mirror.com 抓取;镜像内容与官网一致,引用时以原地址为准。)

  • Hugging Face PEFT 文档
    Hugging Face· 2026· 厂商· hf-peft-docs

    参数高效微调的官方文档;用于说明「不做全量预训练时,TileLang 该优化哪几个算子」。 (原地址 https://huggingface.co/docs/peft/index 在本机不可达:huggingface.co 直连与走本地代理均 SSL EOF,改用中国镜像 hf-mirror.com 抓取;镜像内容与官网一致,引用时以原地址为准。)

  • Qwen2.5-7B 模型卡
    Hugging Face / 阿里通义· 2024· 厂商· hf-qwen2-5-7b-card

    7B 规模、权重与配置完全开放、许可证清晰的开源模型,作为端到端章节的训练/推理 对象。模型卡给出结构参数(层数、hidden、GQA 配置),是算子选择与显存估算的依据。 (原地址 https://huggingface.co/Qwen/Qwen2.5-7B 在本机不可达:huggingface.co 直连与走本地代理均 SSL EOF,改用中国镜像 hf-mirror.com 抓取;镜像内容与官网一致,引用时以原地址为准。)

  • FineWeb-Edu 数据集卡
    Hugging Face· 2024· 厂商· hf-fineweb-edu-card

    公开的预训练语料样例,支持流式读取,适合教学规模的训练实验;训练章节用它构造 数据管线。 (原地址 https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu 在本机不可达:huggingface.co 直连与走本地代理均 SSL EOF,改用中国镜像 hf-mirror.com 抓取;镜像内容与官网一致,引用时以原地址为准。)

  • TinyStories 数据集卡
    Hugging Face· 2023· 厂商· hf-tinystories-card

    小规模、可在单卡上跑完的语料,用于「先把训练循环跑通再放大」的教学路径。 (原地址 https://huggingface.co/datasets/roneneldan/TinyStories 在本机不可达:huggingface.co 直连与走本地代理均 SSL EOF,改用中国镜像 hf-mirror.com 抓取;镜像内容与官网一致,引用时以原地址为准。)

  • Qwen2.5-7B config.json(结构参数)
    Hugging Face / 阿里通义· 2024· 厂商· hf-qwen2-5-7b-config

    模型卡散文里没有的结构参数(hidden 3584 / intermediate 18944 / 28 层 / 28 头 / 4 个 KV 头 / vocab 152064 / rope_theta 1e6 / bf16)。第 17、18 章的显存与 KV cache 账本直接依赖这几个数字,所以单独存档(含原始 JSON 与摘要 Markdown)。

  • pytorch/torchtitan
    GitHub· 2026· 一手· github-pytorch-torchtitan

    PyTorch 官方的 LLM 训练参考实现(并行策略、checkpoint、显存优化)。第 17 章用它 说明「哪些部分可以换成 TileLang kernel,哪些部分不要动」。

  • Lightning-AI/litgpt
    GitHub· 2026· 一手· github-litgpt

    可读性最强的 LLM 训练/微调参考实现之一,适合作为教学骨架;与 HF 生态衔接良好。

  • karpathy/nanoGPT
    GitHub· 2024· 社区· github-nanogpt

    最小可读的训练循环实现。教学价值在于「整条链路没有魔法」;用它讲清楚训练循环的 结构与可替换点。

  • vLLM 文档
    vLLM· 2026· 一手· vllm-docs

    推理服务章节的权威参考:PagedAttention、continuous batching、KV cache 管理与 自定义算子接入方式。第 18 章依赖它。

  • vllm-ascend
    GitHub· 2026· 一手· github-vllm-ascend

    昇腾上的 vLLM 硬件插件。用于说明昇腾推理部署的实际形态,也是「TileLang 算子如何 进入服务框架」的对照物。

算子库与运行时 6

  • DeepSeek-V3 Technical Report
    arXiv (DeepSeek)· 2024· 一手· arxiv-2412-19437

    Defines MLA and the MoE structure that TileLang's flagship examples (deepseek_mla, fusedmoe, deepgemm) implement.

  • DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning
    arXiv (DeepSeek)· 2025· 一手· arxiv-2501-12948

    Context for why DeepSeek's kernels (and hence TileLang's DeepSeek examples) became an industry reference point; kept for the workload-level narrative.

  • tile-ai/TileOPs
    GitHub· 2026· 一手· github-tile-ai-tileops

    High-performance LLM operator library built on TileLang. The natural reference for "what production TileLang kernels look like", including integration with PyTorch/vLLM.

  • tile-ai/TileRT
    GitHub· 2026· 一手· github-tile-ai-tilert

    Tile-based runtime for ultra-low-latency LLM inference. Shows what the kernels are deployed into, and the launch/scheduling constraints that come back as compiler requirements.

  • tile-ai/tilelang-benchmark
    GitHub· 2026· 一手· github-tile-ai-tilelang-benchmark

    The project's own benchmark harness. Needed if you intend to make performance claims or detect regressions in a contribution.

  • tile-ai/TileSight
    GitHub· 2026· 一手· github-tile-ai-tilesight

    Companion repo of the TileSight analytical model; used to reason about tile choices without brute-force autotuning.

论文 12

语言与中间表示 4

  • TVM: An Automated End-to-End Optimizing Compiler for Deep Learning
    arXiv (OSDI 2018)· 2018· 一手· arxiv-1802-04799

    The compiler TileLang is implemented on top of. Reading it explains the schedule/compute separation, the Halide-derived IR, and why TileLang can reuse TVM's lowering and target machinery instead of writing its own.

  • TensorIR: An Abstraction for Automatic Tensorized Program Optimization
    arXiv (ASPLOS 2023)· 2022· 一手· arxiv-2207-04296

    Defines the block/axis IR that TileLang emits into. Inductor, TVM 0.9+ and TileLang all speak this dialect, so it is the vocabulary in which TileLang passes (layout inference, pipeline transform, warp specialization) are written.

  • Ansor: Generating High-Performance Tensor Programs for Deep Learning
    arXiv (OSDI 2020)· 2020· 一手· arxiv-2006-06762

    The search-based auto-scheduling line of TVM. TileLang's autotuner inherits its split/reorder/fuse vocabulary, so this is the right background for understanding what TileLang deliberately does *not* do (it keeps the user in control of the tiling decision).

  • Tensor Program Optimization with Probabilistic Programs
    arXiv (NeurIPS 2022, MetaSchedule)· 2022· 一手· arxiv-2205-13603

    The design behind TVM's MetaSchedule, which TileLang's autotuner sits on. Explains trace-based scheduling and the cost-model/search machinery that TileLang reuses for `autotune` runs on real hardware.