vxpu/kernels: fuse GQA decode attention (FlashDecoding / split-KV) on L4 #973
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #973"
general
weight: 0.35
justinsb
vxpu/kernels: add fused GQA decode attention op and L4 Triton kernelDefine the
vxpu::gqa_attentioncustom op, its SDPA reference body, and alowerable Triton CUDA FlashDecoding / split-KV kernel (
gpu_triton,M <= 8)for causal grouped-query attention over static KV caches.
Standard static-cache decode attention expands KV heads across each query
group, materializes a full
[1, 1, M, S_max]causal mask, and scans theentire static cache length even when only a short prefix is populated.
The
gpu_tritonvariant packs query heads within each KV group togetherwith decode tokens (
M <= 8) so each KV tile loads once per KV head. Itreads
cache_positionon the GPU with zero host synchronization, skipsinactive KV cache tail slots, and uses balanced FlashDecoding split-KV
stages across a static grid so
torch.export, AOTInductor, and CUDA graphcapture work without dynamic allocations.
Measured on NVIDIA L4 (driver 580.178.04, 23034 MiB, CUDA 13.0,
PyTorch 2.14.1+cu130, Triton 3.8.0;
vxpu::read268.4 MB in 1048.6 us,254.8 GB/s measured vs 300 GB/s nominal):
Eager
kernel-checklines on NVIDIA L4:CUDA-graph captured microbenchmark on NVIDIA L4 (
Hq=32, Hkv=4, D=128,bf16, p20 per call; cold-L2 streams across distinct layer KV caches
exceeding L4's 48 MB L2):
vxpu/planner: wire vxpu::gqa_attention into Qwen3-MoE, planner, and L4 GPU testsDispatch
Qwen3MoeAttentionthroughvxpu::gqa_attention, remove theper-step static
causal_maskmaterialization fromQwen3MoeModel, addvxpu::gqa_attentionto the Go kernel catalog and segment shape extractor,and verify end-to-end equivalence on NVIDIA L4.
1-layer
Qwen3-30B-A3BINT4 (hidden=2048, Hq=32, Hkv=4, D=128,,moe_intermediate=768, 128 experts, top_k=8, max_cache_len=2048
int4_linear+int4_moeongpu_triton, CUDA graph captured) on NVIDIA L4:Go-driven L4 GPU equivalence verified:
TestMultiShardInt4PlanAndExecute(awq_multishard,gptq_sym_multishard,awq_prestacked_multishard): PASS with exact token matchTestVerifyPlanEquivalence_GPU_GQAAttention: PASS (referencevsgpu_tritonthrough Go planner →PlanFile→ executor gRPC, exact greedy token match across both prompts)TestVerifyPlanEquivalence_GPU_FullPlan: PASS (exact greedy token match)python -m vxpu.hero_int4_moe --tiny: PASS (speedup=42.34x, tokens_match=True, explain planned=12 differing=0 unmatched=0)Fixes #969