Skip to content

update - #94

Closed
coutinhomarco wants to merge 2 commits into
TheTom:feature/turboquant-kv-cachefrom
coutinhomarco:feature/turboquant-kv-cache
Closed

update#94
coutinhomarco wants to merge 2 commits into
TheTom:feature/turboquant-kv-cachefrom
coutinhomarco:feature/turboquant-kv-cache

Conversation

@coutinhomarco

Copy link
Copy Markdown

Overview

Additional information

Requirements

Tuklus and others added 2 commits April 18, 2026 13:29
Origin's April upstream-sync rebase interleaved two changes that left the
Vulkan turbo3 KV path broken:

  * ggml-org/llama.cpp upstream PR ggml-org#21572 (1f30ac0) moved fp16 RTE
    rounding to a runtime SPIR-V patch and dropped the _rte shader
    variants plus rte.glsl itself.
  * TheTom/llama-cpp-turboquant PR TheTom#62 (ff8bb73) added turbo3 KV
    support against a base that still had those variants.

After the rebase, the tree had dangling cpy_f32_*_rte_len / _data
references, a two-arg SET_ROWS macro called with one arg, a
#include "rte.glsl" in a shader whose header no longer exists, and
MMQ shader variants generated for turbo3_0 even though the flash_attn
MMQ path has no turbo3 code. The result was that ggml-vulkan.cpp
failed to compile on a clean checkout (spirv-headers + all of the
above) and the shader-gen emitted garbage variants.

Separately, turbo3 flash-attn pipelines were only wired up for
FA_SCALAR. On a coopmat-capable device (e.g. RADV on a 7900 XTX) the
tuning heuristic picks FA_COOPMAT1 for most shapes, which landed in
ggml_vk_flash_attn with an uninitialized pipeline (wg_denoms={0,0,0})
and tripped the Br == wg_denoms[0] assertion as soon as a prefill
ubatch was dispatched. End-to-end llama-cli on Vulkan + -ctk turbo3
aborted on the first real forward pass.

Changes:

  * Drop the if (float_controls_rte_fp16) / else branches around
    cpy_f32_quant pipeline creation and collapse SET_ROWS to a single
    variant, matching upstream post-1f30ac0ce.
  * Remove the #include "rte.glsl" from copy_to_quant.comp.
  * Skip the MMQ flash_attn shader variant for turbo3_0 in the shader
    generator (no MMQ code path for it).
  * Register CREATE_FA(GGML_TYPE_TURBO3_0, turbo3_0, FA_COOPMAT1, _cm1)
    and the _cm2 counterpart alongside the other quant types.

Verified on AMD 7900 XTX (gfx1100 / RADV NAVI31, ROCm 7.2.1 + Vulkan
1.4.341, spirv-headers 1.4.341.0):

  * Full HIP+Vulkan build is clean with no shader compile errors.
  * test-backend-ops -o SET_ROWS -b Vulkan0 : 147/147
  * test-backend-ops -o FLASH_ATTN_EXT -b Vulkan0 -p type_KV=turbo3 :
    530 cases pass (previously aborted on case 3).
  * test-backend-ops -o FLASH_ATTN_EXT -b ROCm0 -p type_KV=turbo3 :
    still green (no HIP regression).
  * llama-cli on Qwen3-8B Q4_K_M with -ngl 99 -fa on -ctk turbo3
    -ctv turbo3 on Vulkan0 no longer aborts. The remaining head_dim=128
    correctness issue on the Vulkan turbo3 decode path is pre-existing
    and orthogonal to this change.

llama-bench on Qwen3.5-27B Q4_K_M, 7900 XTX OC, HIP backend:

  F16     tg128=20.98   turbo3 tg128=20.13   turbo4 tg128=20.17

Refs: TheTom/llama-cpp-turboquant issues TheTom#50, TheTom#64, TheTom#81
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Aug 2, 2026
…AtomicBot-ai#5)

4 parallele Subagents (Vulkan/AMD, CUDA/MoE, arXiv Papers, Multi-GPU/Batching).
51 Items gesammelt, dedupliziert, 5 Quick-Wins verifiziert.

Verifikation: 3/5 Quick-Wins bereits im Fork (ggml-org#15524=AtomicBot-ai#6, ggml-org#16391=--cram, ggml-org#19754= warmup).
PR ggml-org#25479 (Pascal MMVQ) bereits als AtomicBot-ai#3 ✅. PR ggml-org#22887 (4K per Iter) bereits im Fork.

9 neue ROADMAP-Items hinzugefügt:
- TheTom#89 Transfer Queue AMD RDNA3 (PR ggml-org#19976)
- TheTom#90 MUL_MAT_ID Non-Square Tile (Discussion ggml-org#22598)
- TheTom#91 Internal AllReduce Kernel (PR ggml-org#22299)
- TheTom#92 RateQuant KV Cache (arXiv:2605.06675)
- TheTom#93 InnerQ KV Cache (arXiv:2602.23200)
- TheTom#94 FineMoE Expert Offloading (arXiv:2502.05370)
- TheTom#95 Shared Expert Aux Stream (TensorRT-LLM)
- TheTom#96 Speculative Checkpointing (PR ggml-org#19493)
- TheTom#97 Backend-agnostic TP Meta Device (PR ggml-org#19378)

Vollständiger Report: docs/fork/2026-07-26_OPTIMIZATION_RESEARCH.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants