Skip to content

rdna35 prefill optimizations other than mmq - #129

Draft
liangliangchang wants to merge 14 commits into
gfx11from
lichang.rdna35-prefill-quant-rope
Draft

liangliangchang wants to merge 14 commits into
gfx11from
lichang.rdna35-prefill-quant-rope

Conversation

@liangliangchang

Copy link
Copy Markdown

Overview

Additional information

Requirements

Batch Qwen vision windows and tune guarded RDNA3.5 attention paths.
Fuse clamp conversion, normalization and activation packing, and
residual scaling while preserving existing dispatch and rounding.

Add backend coverage and document the matched VLM performance results.

Assisted-by: Codex
@liangliangchang liangliangchang changed the title Lichang.rdna35 prefill quant rope rdna35 prefill optimizations other than mmq Oct 7, 2026
Zero-pad compatible D72 self-attention to the existing D80 WMMA
kernel, retain the original attention scale, and extract D72 output.
Guard small workloads, unsupported layouts and attention features.
Add backend coverage for dispatch boundaries and fallback paths.

On gfx1151, Gemma-3-4B median HTTP TTFT improves from 1141.47 ms to
769.71 ms with context checkpoints enabled (32), using 20 timed
requests per configuration in ABBA order. D72 and D64/D80 backend
suites pass 909 and 224 cases; 32 generated token IDs match baseline.
Floating-point log probabilities differ with the WMMA arithmetic.

Assisted-by: Codex
Extend shared GLU producer kernels to SwiGLU and padded Q8 rows.
Use 128-thread blocks for eligible D128 Q/K norm-RoPE prefill.
Preserve existing dispatch, FP32 rounding and fallback paths.

On gfx1151 with checkpoints enabled, 3968-token HTTP TTFT falls
4.76% for Qwen2.5-3B and 3.85% for Qwen3-4B. Producer, graph and
generation checks pass with the recorded matching outputs.

Assisted-by: Codex
Document every branch optimization commit, structural eligibility,
measurement baseline and performance limits. Include the SwiGLU
results and distinguish isolated gains from combined experiments.

Assisted-by: Codex
@jimw567
jimw567 self-requested a review October 14, 2026 22:21
Share gate/up input conversion and retain FP16 GEMM intermediates.
Fuse conversion, bias and gated activation with FP32 arithmetic and
existing rounding, dispatch and fallback behavior. Add backend coverage
and document measured TTFT gains and scratch-memory costs.

Qwen2.5-VL-7B saves 5.1-5.7% TTFT; Gemma-3-4B saves 3.2% with
checkpoints enabled. All 104 backend cases and direct numerical checks
pass, with identical tested responses and returned probabilities.

Assisted-by: Codex
Reuse conversion/bias, GLU, gated FFN and clamp fusions for BF16.
Preserve FP32 arithmetic, rounding and existing dispatch guards,
including fallback for mixed projection types.

Add BF16 backend coverage and document numerical validation,
paired TTFT gains and the completed 14-row VLM comparison.

Assisted-by: Codex
Hoist window K/V casts, write attention into the final output, and extend normalization and residual producer fusions. Document Qwen2.5-VL-7B timing, checkpoint-on validation and numerical differences.

Assisted-by: OpenAI Codex
Extend affine LayerNorm, plain GELU and clamped gated FFN fusions, and
combine compatible two-axis norm-RoPE operations. Retain FP32 producer
rounding, clamp limits, dispatch guards and checkpoint behavior.

Document model coverage, paired TTFT results, numerical checks and
rejected variants.

Assisted-by: Codex
Skip partial-tile handling for complete dense D80 KV tiles, vectorize
aligned permuted F32-to-F16 copies, and use 128-thread affine LayerNorm
for 1152-wide vision rows. Keep final-tile checks and guarded fallbacks.

Document Gemma-3-12B TTFT of 857.01 to 818.46 ms with checkpoints and
overlap enabled, host-load limits, and LayerNorm rounding differences.

Assisted-by: Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant