Repository navigation
[Docs] Add ROCm decode megakernel (MonoKernel) authoring guide - #62256
Draft
mpashkovskii wants to merge 1 commit into
Draft
mpashkovskii wants to merge 1 commit into
mpashkovskii wants to merge 1 commit into
Conversation
Contributor
|
Documentation preview: https://vllm--62256.org.readthedocs.build/en/62256/ |
mpashkovskii
force-pushed
the
docs/rocm-decode-megakernel
branch
3 times, most recently
from
October 18, 2026 07:30
8b2b8a7 to
6c45a77
Compare
Document how to write a decode megakernel / specialized decode for a dense transformer on AMD ROCm (CDNA3/CDNA4) inside vLLM: architecture, the tagged mailbox + peer-memory execution model, the K1/K2 split, a from-zero FlyDSL bootcamp, step-by-step implementation, testing, a task breakdown, and pitfalls, with a Gemma-style dense FP8 model as the worked example. Ties together the in-flight AMD mono decode PRs under RFC vllm-project#60904. Co-authored-by: Sisyphus <agent@ohmyopencode> Signed-off-by: Matvei Pashkovskii <mpashkov@amd.com>
mpashkovskii
force-pushed
the
docs/rocm-decode-megakernel
branch
from
October 18, 2026 07:35
6c45a77 to
d29c6a8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a single developer guide,
docs/design/rocm_decode_megakernel.md, documenting how towrite a decode megakernel ("MonoKernel" / specialized decode) for a dense transformer on AMD
ROCm (MI300X / MI355X, CDNA3 / CDNA4) inside vLLM — the technique behind the in-flight AMD mono
decode work (DeepSeek-V4.1 #60397/#61082, Qwen3.8-27B dense #61573, Kimi-K3 #60683/#61435,
GLM-5.2 #60889) and the NVIDIA CuTeDSL specialized decode (#61867), standardized by RFC #60904.
It is top-down: architecture → compute contract → toolchain → a from-zero FlyDSL bootcamp →
step-by-step implementation → testing → an executable task breakdown → pitfalls → reference
appendices. It uses a Gemma-style dense FP8 model as the worked example (the closest template
is the dense Qwen3.8-27B path), but the technique sections are model-agnostic.
Why this is not a duplicate
gh pr list --repo vllm-project/vllm --state all --search "<mono decode / megakernel / specialized decode / kernel authoring> docs/guide in:title"andgh issue view 60904— no existing documentation PR covers this.umbrella design discussion; the related PRs ([ROCm][Perf][DSv4.1] Mono decode layer for DeepSeek-V4.1-Flash on MI355X #60397, [ROCm][Perf][Qwen3.8] Add dense mono decode for Qwen3.8-27B on MI355X. #61573, [ROCm][Perf][Kimi-K3] Specialized decode for Kimi-K3 on MI355X #60683, [ROCm] MonoKernel for GLM 5.2 #60889, [Core] Shared abstractions for specialized decode kernels #61311, [Perf] Kimi K3 Specialized Decode: CuTeDSL Optimized GB300 (1.5-2x) #61867…)
are code, not end-to-end authoring documentation. This page is the missing how-to that ties
them together and points readers at the canonical sources.
Proposed split (the analysis requested)
The page is intentionally one file today, but it maps cleanly onto vLLM's docs conventions, which
separate
docs/design/("how it works" — e.g.paged_attention.md,cuda_graphs.md,model_runner_v2.md,fused_moe_modular_kernel.md) fromdocs/contributing/("how to build"— e.g.
model/,profiling.md). A megakernel guide has both halves, so the natural seam is:docs/design/specialized_decode/— conceptualindex.mdcompute_contract.mdtoolchain.mddocs/contributing/specialized_decode/— how-toindex.mdflydsl_bootcamp.mdimplementation.mdtesting.mdtask_breakdown.mdpitfalls.mdreference.mdRationale:
#H1 and afocused nav entry, instead of this draft's many
# PART …sections in one file.awesome-navauto-includes files in a directory; a small.nav.ymlper subdir would setorder/titles. No root
nav:edits are needed (the design dir has no.nav.ymland auto-navstoday).
specialized_decodeto match the in-tree package(
vllm/models/common/specialized_decode/) and RFC [RFC]: A standard for Specialized (MonoKernels) Decodes in vllm/models #60904's terminology. Open question forreviewers: prefer
specialized_decodeormonokernel? And should the conceptual halflive in
docs/design/while the how-to lives indocs/contributing/, or should the whole thingsit under one tree?
docs/models/, since the guide is about the method, not a specific model.Test plan / commands run
markdownlint-cli2 --config tools/pre_commit/.markdownlint.yaml docs/design/rocm_decode_megakernel.md→ 0 issues (single H1, code-fence languages, blanks, table style, no bare URLs — matches the
repo's CI config).
MD001increments.mkdocs build --strictand arendered-nav check — please let CI exercise these, or I can add a
.nav.yml+ run it in thesplit follow-up.
Caveats for reviewers
moving
VLLM_ROCM_MONO_DECODE→--monokernel→--additional-config decode_backendper[RFC]: A standard for Specialized (MonoKernels) Decodes in vllm/models #60904). The guide flags this and the stable-vs-in-flux parts explicitly; paths/flags should be
re-checked against tip before anyone implements from it.
Disclosure
AI assistance was used to research the referenced PRs/sources and draft this document. As the
human submitter I will review every line, keep it in sync with RFC #60904, and own it end-to-end;
the DCO sign-off should be re-applied with the submitter's identity before this leaves draft.