[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114229":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},114229,"modern-gpu-programming-for-mlsys","mlc-ai\u002Fmodern-gpu-programming-for-mlsys","mlc-ai","A tutorial on modern GPU programming for machine learning systems","",null,"HTML",1397,149,5,1,0,6,8,4,55.33,false,"main",true,[],"2026-11-02 18:44:05","2026-11-23 16:30:06","# Modern GPU Programming For MLSys\n\nThis book teaches modern GPU kernel programming as a progression: **understand the\nGPU hardware → learn to program it → write state-of-the-art kernels.** It treats\nthe Blackwell-class GPU — its memory hierarchy and Tensor Memory, its tensor-core and\nasynchronous data-movement engines, warpgroups and clusters — as the real subject. The\nvehicle is **TIRx** (Tensor IR next), a Python DSL for writing GPU kernels at the IR level.\n\n📖 **Read it online: \u003Chttps:\u002F\u002Fmlc.ai\u002Fmodern-gpu-programming-for-mlsys\u002F>**\n\n**Chinese version: \u003Chttps:\u002F\u002Fmlc.ai\u002Fmodern-gpu-programming-for-mlsys\u002Fzh\u002F>**\n\n🤝 **Contribute:** Corrections, examples, and improvements are welcome through the\n[GitHub repository](https:\u002F\u002Fgithub.com\u002Fmlc-ai\u002Fmodern-gpu-programming-for-mlsys).\n\n## What's inside\n\n- **Part I — Understanding the GPU.** Execution and memory model, the performance model\n  (roofline, overlap), a deep dive into data layout, the memory and compute engines (TMA,\n  Tensor Memory, Tensor Cores), asynchronous coordination, and advanced scheduling (CLC).\n- **Part II — Programming a GPU with TIRx.** An introduction to TIRx through one runnable\n  single-MMA GEMM — scope, layout, and dispatch, and how compilation works — plus the tensor\n  layout model (`TileLayout`, named axes, swizzle).\n- **Part III — GEMM: Tiled to SOTA.** A tiled GEMM built up through TMA pipelining,\n  persistent scheduling, warp specialization, and 2-CTA clusters.\n- **Part IV — Flash Attention 4.** A complete attention kernel built from the Part III techniques:\n  two MMAs with softmax between them, online-softmax rescaling, causal masking, and GQA.\n- **Appendices.** TIRx language reference, [reproducible GPU benchmarking and\n  profiling](appendix\u002Fbenchmarking_gpu_kernels.md), compiler internals, and asynchronous-kernel\n  debugging.\n\n## Build the book locally\n\nThe book is a [Sphinx](https:\u002F\u002Fwww.sphinx-doc.org\u002F) site (Markdown\u002FMyST + reStructuredText):\n\n```bash\npip install -r requirements-docs.txt\nsphinx-build -b html . _build\u002Fhtml\n```\n\n### Preview\n\n```bash\npython -m http.server -d _build\u002Fhtml 8000\n```\n\nOpen \u003Chttp:\u002F\u002Flocalhost:8000>. On a remote machine the server runs there, so forward the\nport — `ssh -L 8000:localhost:8000 user@your-server` — then open the URL locally. (VS Code\nRemote SSH auto-forwards it.)\n\n## Running the kernels (requires a Blackwell GPU)\n\nThe kernels in this book target Blackwell (`sm_100a`), so running them needs a Blackwell GPU\n(such as a B200), the TIRx compiler, and a CUDA build of PyTorch.\n\n**1. Install the TIRx compiler.** Its Python module is `tvm_tirx`:\n\n```bash\npip install apache-tvm-tirx cuda-bindings\n```\n\nThe default wheel includes native LLVM support. For additional cross-compilation targets,\ninstall `apache-tvm-tirx[all-targets]`.\n\nVerify:\n\n```bash\npython -c \"import tvm_tirx; print(tvm_tirx.__version__)\"\n```\n\n**2. Install PyTorch** with a CUDA build matching your GPU (used for the example inputs and the\nreference checks) — see \u003Chttps:\u002F\u002Fpytorch.org>.\n\n**3. Install the reference kernels to run the complete Flash Attention example.**\nUse the latest `main` branch of the companion repository:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fmlc-ai\u002FTIRx-kernels.git\ncd TIRx-kernels\npip install -e .\n```\n\nRun it with, e.g., `python -m tirx_kernels.test --kernel fp16_bf16_gemm`.\n\nTIRx parses kernel source via Python source inspection, so examples should live in a file\nor notebook cell rather than inside `python -c`.\n\n## Deployment\n\nEvery push to `main` is built and published automatically by GitHub Actions\n(`.github\u002Fworkflows\u002Fbuild_deploy.yaml`) to \u003Chttps:\u002F\u002Fmlc.ai\u002Fmodern-gpu-programming-for-mlsys\u002F>.\n","这是一本面向机器学习系统（MLSys）工程师的现代GPU编程教程，聚焦Blackwell架构GPU的底层硬件特性与高性能内核开发。项目以TIRx（Tensor IR next）Python DSL为核心工具，系统讲解GPU执行模型、内存层次（含Tensor Memory与TMA）、张量核心编程、异步数据移动及集群级调度（如warp groups、2-CTA clusters），并逐步构建GEMM与Flash Attention 4等前沿内核。内容覆盖硬件理解、IR级编程、性能建模与可复现基准测试，适用于ML编译器开发者、高性能算子优化工程师及GPU内核研究者。",2,"2026-11-24 04:47:59","high_star"]