You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #405 (README vs llama.cpp CUDA benchmark sweep). Lower priority — this is the residual kernel gap after the batched MMQ prefill is already engaged (unlike #406/#407, where the batched path is gated off).
Measured (RTX 4070 Ti, llama.cpp CUDA b9529, full offload, pp2048)
Model
README prefill
llama.cpp pp2048
gap
Qwen3-8B Q4_K_M
2 287
6 010
2.63×
Gemma4-E4B q4_0
3 666
9 236
2.52×
Gemma4-12B q4_0
1 714
4 201
2.45×
Gemma4-E4B Q8
4 145
8 577
2.07×
Decode for all four is within ~1.05–1.25× (near ceiling); only prefill trails. These models do use the batched int8-MMQ trunk + flash-attn prefill, so this is the genuine kernel-efficiency gap, consistent with the README's own note for Qwen3-8B ("gap is its cp.async MMQ + flash attn").
This is a stretch optimization (2–2.6×, deep kernel work) vs #406/#407 which are 100×+ and just need the existing batched path un-gated. Recommend tackling #406/#407 first. Track here so the dense-prefill ceiling isn't re-investigated from scratch; pursue cp.async MMQ when the dense trunk becomes the priority.
References
src/SharpInference.Engine/CudaForwardPass.cs (PrefillMmqEnabled:372, PrefillFlashTcEnabled:392, SoA _mmqSoa:394)
Part of #405 (README vs llama.cpp CUDA benchmark sweep). Lower priority — this is the residual kernel gap after the batched MMQ prefill is already engaged (unlike #406/#407, where the batched path is gated off).
Measured (RTX 4070 Ti, llama.cpp CUDA
b9529, full offload,pp2048)pp2048Decode for all four is within ~1.05–1.25× (near ceiling); only prefill trails. These models do use the batched int8-MMQ trunk + flash-attn prefill, so this is the genuine kernel-efficiency gap, consistent with the README's own note for Qwen3-8B ("gap is its cp.async MMQ + flash attn").
Where llama.cpp's prefill edge comes from
mmq.cupipelines global→shared loads withcp.asyncso the int8 tensor-core math overlaps weight DMA; ourllm_mmq_*(Gemma 4 GPU prefill is ~70x slower than llama.cpp — adopt cuBLAS GEMM for prefill #141) does a simpler load→compute. This is the biggest single piece.fattnis more aggressively tiled/pipelined.Scope / priority
This is a stretch optimization (2–2.6×, deep kernel work) vs #406/#407 which are 100×+ and just need the existing batched path un-gated. Recommend tackling #406/#407 first. Track here so the dense-prefill ceiling isn't re-investigated from scratch; pursue cp.async MMQ when the dense trunk becomes the priority.
References
src/SharpInference.Engine/CudaForwardPass.cs(PrefillMmqEnabled:372,PrefillFlashTcEnabled:392, SoA_mmqSoa:394)ggml/src/ggml-cuda/mmq.cu,fattn*.cu