flydsl_fp8_gemm_playbook

Implements a fused FlyDSL fp8 blockscale GEMM core for AMD MI300X down-projection layers.

178|52|Updated Jul 30, 2025
One-click install
npx skills add https://github.com/AMD-AGI/GEAK --skill flydsl-fp8-gemm-playbook-amd-agi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flydsl_fp8_gemm_playbook
Source: https://github.com/AMD-AGI/GEAK/tree/main/perf_knowledge/expert_skills/skills/flydsl_fp8_gemm_playbook
Command: npx skills add https://github.com/AMD-AGI/GEAK --skill flydsl-fp8-gemm-playbook-amd-agi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When serving fp8 a8w8 block-scale models on AMD MI300X GPUs, config-level Triton tuning of dense GEMM heads plateaus at roughly 1.04-1.06x, leaving the K-heavy down-projection GEMM as a major GPU-time bottleneck with no further config-level gains available. ## Core Features & Use Cases - Fused fp8 GEMM authoring: Guides authoring a FlyDSL fused a8w8 blockscale GEMM core that folds block-scale into the operand scale and runs one full-K low-precision MFMA, achieving ~2.43x isolated speedup on the down-proj shape. - Capture-safe binding: Describes the bare-core bind overlay (nocgraph) that runs inside sglang's existing captured CUDA graph, avoiding the nested-graph capture crash that blocked earlier attempts. - Memory-safe caching: Constrains weight caching to compact fp8/preshuffled weights keyed by weight.data_ptr(), preventing KV-cache starvation and e2e regressions. - Use Case: Optimizing Qwen3.5-27B-FP8 serving on gfx942, where applying this playbook raised throughput from 931.6 to 1559.9 tok/s (+67.4%) with parity passing. ## Quick Start Ask the agent to apply the FlyDSL fused fp8 blockscale GEMM playbook to the down-projection head of your fp8 model on MI300X with a capture-safe bare-core bind.

Frequently Asked Questions about flydsl_fp8_gemm_playbook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I speed up fp8 blockscale GEMM on AMD MI300X?

Author a fused FlyDSL kernel that folds the 128x128 block-scale into the operand scale and runs one full-K low-precision MFMA core with fp32 accumulation. This removes the dequantization step and achieves about 2.43x isolated speedup on K-heavy down-projection shapes.

How to optimize the down-projection GEMM in fp8 LLM serving?

Target the K-heavy narrow-N down-proj head (for example N=5120, K=17408) with a fused FlyDSL core rather than more Triton config tuning, which plateaus near 1.06x. Bind the bare core over the live blockscale path so it runs inside the existing captured graph.

Why does my custom GEMM kernel crash sglang CUDA graph capture?

Nested-graph wrappers and host synchronization in the hot path are capture-unsafe and deadlock graph capture, yielding zero live forwards. The fix is a bare-core bind that overlays the fused core onto the existing blockscale GEMM so it executes inside the already-captured graph.

Does this FlyDSL GEMM approach work for all GEMM heads in the model?

No. The wide-N up/gate head was rejected because decode stays on the generic path, giving a net e2e regression, and the qkv/o head win is capture-unsafe. Only the K-heavy down-projection head benefits from the fused bare-core bind.

What are the memory constraints when caching preshuffled fp8 weights?

Cache only compact fp8 or preshuffled weights, roughly the model's own fp8 weight size, keyed once by weight.data_ptr(). Caching a bf16 expansion across all layers lowers memory fraction, starves the KV cache, and causes a net end-to-end regression.