Skip to content

Commit 7f0ed79

Browse files
committed
Add TurboQuant turbo4 Vulkan goal prompt
1 parent e1adfd4 commit 7f0ed79

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/goal
2+
Create a new PR that fixes TurboQuant `turbo4` KV-cache support in llama.cpp Vulkan.
3+
4+
Repository:
5+
`CompleteTech-LLC-AI-Research/llama.cpp`, based on the synced `master` that includes upstream `ggml-org/llama.cpp` through `b0df4c0cf` plus these retained fixes:
6+
- `fix Gemma 4 thinking generation prompt`
7+
- `Add audio transcription fallback for chat input`
8+
9+
Problem:
10+
Gemma4 fails on the B60 Vulkan install when launched with `--cache-type-k q8_0 --cache-type-v turbo4`. The scheduler aborts with:
11+
12+
`pre-allocated tensor (cache_v_l0 (view)) in a buffer (Vulkan0) that cannot run the operation (SET_ROWS)`
13+
14+
Cause to confirm and fix:
15+
The V KV cache is preallocated in Vulkan memory as `GGML_TYPE_TURBO4_0`. Decode updates cache rows through `GGML_OP_SET_ROWS`, but the Vulkan backend does not fully support SET_ROWS into `GGML_TYPE_TURBO4_0`. Existing TurboQuant wiring handles related paths such as turbo3, but turbo4 needs its own Vulkan shader, pipeline registration, support checks, and dispatch/copy behavior.
16+
17+
Implementation target:
18+
Make `GGML_OP_SET_ROWS` work on Vulkan when the destination tensor type is `GGML_TYPE_TURBO4_0`.
19+
20+
Work plan:
21+
1. Create a feature branch from current `master`.
22+
2. Inspect `ggml/src/ggml-vulkan/` for SET_ROWS shader generation, quantized copy/dequant helpers, pipeline registration, and backend op-support checks.
23+
3. Add or port the required Vulkan block/type declarations for TurboQuant turbo4, including dependent turbo2 definitions if turbo4 packing requires them.
24+
4. Extend the Vulkan `copy_to_quant.comp` / generated SET_ROWS shader path for turbo4:
25+
- support both i32 and i64 row-index variants
26+
- implement turbo4 transform/quantization correctly
27+
- pack 4-bit centroid indices into the expected GGML/TurboQuant layout
28+
- follow neighboring quantized SET_ROWS workgroup and dispatch conventions
29+
5. Register `set_rows_turbo4_0_i32` and `set_rows_turbo4_0_i64` pipelines, populate `pipeline_set_rows_i32/i64[GGML_TYPE_TURBO4_0]`, and update Vulkan SET_ROWS support checks so graph scheduling accepts this op on Vulkan buffers.
30+
6. Keep turbo3 behavior unchanged except for shared helper code that is covered by tests.
31+
7. Build and test locally or on the train/B60 host.
32+
8. Push the branch and open a PR with the code fix.
33+
34+
Required verification:
35+
- Build: `cmake --build build --target test-chat llama-server -j$(nproc)`
36+
- Run: `./build/bin/test-chat`
37+
- On the B60 Vulkan host, launch Gemma4 with production-like settings including:
38+
`--cache-type-k q8_0 --cache-type-v turbo4 -ngl 999 -ngld 999 -ncmoe 38 -ncmoed 38 -c 65537 -b 512 -ub 512 -fa on --reasoning-budget 0 -np 1`
39+
- Confirm startup no longer hits the Vulkan SET_ROWS scheduler abort, `/health` responds, and a short completion succeeds.
40+
- Smoke compare against `--cache-type-v q8_0` or `turbo3` to catch obvious output corruption.
41+
42+
Constraints:
43+
- Keep the patch narrowly scoped to Vulkan/TurboQuant SET_ROWS support.
44+
- Do not regress CPU, CUDA, Metal, turbo3, the Gemma4 prompt fix, or the audio transcription fallback.
45+
- Do not switch production to turbo4 until runtime validation passes.
46+
47+
Deliverable:
48+
Return the PR URL, changed files, verification results, and any remaining risks.

0 commit comments

Comments
 (0)