How sgl-project/sgl-amd-mono works
SGLang-AMD-Mono is an AMD GPU monokernel plugin for SGLang inference. SGLang routes supported decode and speculative-verification steps to model specs, which invoke persistent GPU kernels; unsupported steps remain on SGLang’s standard path. The model implementations cover distinct decoder stages such as attention, indexing, MoE/FFN, tensor-parallel reductions, and speculative-draft glue. Shared device utilities provide planning, synchronization, epoch tracking, and fail-stop guards. Model-specific paths and capabilities are grounded in the README and source index; unsampled implementation details are not expanded.
Main entry points: sgl_amd_mono Model Specs · sync.py Tagged Mailboxes · kernel.py GLM-5.3 Kernels · guard.py Fail-stop Guard
Components 26
SGLang Integration
- AMD Plugin
sgl_amd_mono/__init__.py - Model Specs
sgl_amd_mono
Shared Runtime
- Execution Planning
sgl_amd_mono/common/plan.py - Device Operations
sgl_amd_mono/common/ops.py - Tagged Mailboxes
sgl_amd_mono/common/sync.py - Fail-stop Guard
sgl_amd_mono/common/guard.py - Launch Epochs
sgl_amd_mono/common/epoch.py - Peer Coordination
sgl_amd_mono/common/peer.py - MX Formats
sgl_amd_mono/common/mx.py
DeepSeek Kernels
- DeepSeek V4.1 Spec
sgl_amd_mono/deepseek_v41/spec.py - Indexer Query
sgl_amd_mono/deepseek_v41/gfx950/attention/index_query.py - V4.1 Layer Stages
sgl_amd_mono/deepseek_v41/gfx950/stages - Speculative Glue
sgl_amd_mono/deepseek_v41/glue - DeepSeek V4 Spec
sgl_amd_mono/deepseek_v4/spec.py
Other Model Kernels
- GLM-5.3 Kernels
sgl_amd_mono/glm53/gfx950/kernel.py - GLM-5.3 Layout
sgl_amd_mono/glm53/gfx950/layout.py - GLM Flash Kernels
sgl_amd_mono/glm53_flash/gfx950/kernel.py - Kimi K3 Stages
sgl_amd_mono/kimi_k3/gfx950/stages/moe.py - Kimi K3.1 Chain
sgl_amd_mono/kimi_k31/gfx950/chain.py - MiniMax M3 Layer
sgl_amd_mono/minimax_m3/gfx950/post_attn.py - MiniMax M3.1 FFN
sgl_amd_mono/minimax_m31/ffn.py - Muse Spark Draft
sgl_amd_mono/muse_spark/draft.py - Qwen 3.5 FP8
sgl_amd_mono/qwen35_a17b/fp8/gfx950/verify.py - Qwen 3.8 Layer
sgl_amd_mono/qwen38_a95b_mxfp4/gfx950/layer.py - Qwen Flash Kernel
sgl_amd_mono/qwen38_flash_next/gfx950/kernel.py
Other components
- SGLang Serving
Connections 40
- SGLang Serving → AMD Plugin: loads plugin
- AMD Plugin → Model Specs: registers specs
sgl_amd_mono/__init__.py - SGLang Serving → Model Specs: routes decode
- Model Specs → DeepSeek V4.1 Spec: selects spec
- Model Specs → DeepSeek V4 Spec: selects spec
sgl_amd_mono/deepseek_v4/spec.py - Model Specs → GLM-5.3 Kernels: dispatches supported steps
sgl_amd_mono/glm53/gfx950/kernel.py - Model Specs → GLM Flash Kernels: dispatches supported steps
sgl_amd_mono/glm53_flash/spec.py - Model Specs → Kimi K3 Stages: dispatches supported steps
sgl_amd_mono/kimi_k3/spec.py - Model Specs → Kimi K3.1 Chain: dispatches supported steps
sgl_amd_mono/kimi_k31/wide.py - Model Specs → MiniMax M3 Layer: dispatches supported steps
sgl_amd_mono/minimax_m3/gfx950/post_attn.py - Model Specs → MiniMax M3.1 FFN: dispatches supported steps
sgl_amd_mono/minimax_m31/ffn.py - Model Specs → Muse Spark Draft: dispatches draft steps
sgl_amd_mono/muse_spark/draft.py - Model Specs → Qwen 3.5 FP8: dispatches supported steps
sgl_amd_mono/qwen35_a17b/fp8/spec.py - Model Specs → Qwen 3.8 Layer: dispatches supported steps
sgl_amd_mono/qwen38_a95b_mxfp4/spec.py - Model Specs → Qwen Flash Kernel: routes verify steps
sgl_amd_mono/qwen38_flash_next/gfx950/kernel.py - DeepSeek V4.1 Spec → Indexer Query: uses index query
sgl_amd_mono/deepseek_v41/gfx950/attention/index_query.py - DeepSeek V4.1 Spec → V4.1 Layer Stages: runs layer stages
- DeepSeek V4.1 Spec → Speculative Glue: applies step glue
- DeepSeek V4 Spec → Execution Planning: uses planning
sgl_amd_mono/deepseek_v4/spec.py - DeepSeek V4 Spec → Execution Planning: configures execution
sgl_amd_mono/deepseek_v4/spec.py - GLM-5.3 Kernels → GLM-5.3 Layout: uses layout
sgl_amd_mono/glm53/gfx950/kernel.py - GLM-5.3 Kernels → Fail-stop Guard: checks waits
sgl_amd_mono/glm53/gfx950/kernel.py - GLM-5.3 Kernels → Launch Epochs: tracks launches
sgl_amd_mono/glm53/gfx950/kernel.py - GLM-5.3 Kernels → MX Formats: uses MX helpers
sgl_amd_mono/glm53/gfx950/kernel.py - GLM Flash Kernels → Fail-stop Guard: checks waits
sgl_amd_mono/glm53_flash/gfx950/kernel.py - GLM Flash Kernels → Launch Epochs: tracks launches
sgl_amd_mono/glm53_flash/gfx950/kernel.py - Kimi K3 Stages → Tagged Mailboxes: uses mailboxes
sgl_amd_mono/kimi_k3/gfx950/stages/moe.py - Kimi K3 Stages → MX Formats: uses MX helpers
sgl_amd_mono/kimi_k3/gfx950/stages/moe.py - Kimi K3.1 Chain → Kimi K3 Stages: uses KDA stage
- Kimi K3.1 Chain → Peer Coordination: coordinates peers
sgl_amd_mono/kimi_k31/wide.py - MiniMax M3 Layer → Tagged Mailboxes: uses mailboxes
sgl_amd_mono/minimax_m3/gfx950/post_attn.py - MiniMax M3 Layer → MX Formats: uses MX helpers
sgl_amd_mono/minimax_m3/gfx950/post_attn.py - MiniMax M3.1 FFN → Tagged Mailboxes: uses mailboxes
sgl_amd_mono/minimax_m31/ffn.py - Qwen 3.8 Layer → Tagged Mailboxes: uses mailboxes
sgl_amd_mono/qwen38_a95b_mxfp4/gfx950/layer.py - Qwen 3.8 Layer → Peer Coordination: coordinates peers
- Qwen Flash Kernel → Fail-stop Guard: checks waits
sgl_amd_mono/qwen38_flash_next/gfx950/kernel.py - Launch Epochs → Fail-stop Guard: uses guard layout
sgl_amd_mono/common/epoch.py - Launch Epochs → Tagged Mailboxes: spins via sync
sgl_amd_mono/common/epoch.py - Tagged Mailboxes → Fail-stop Guard: guards polling
sgl_amd_mono/common/sync.py - Device Operations → Execution Planning: uses planning
sgl_amd_mono/common/ops.py