Repository navigation
vulkan : support non-contiguous src in SCALE - #32735
Conversation
Assisted-By: Opus 5.5
|
Should I do something about failed check? |
|
No, we're just waiting for CI to finish. |
…upstream's head, Vulkan and ROCm llama-bench on one R9700, two passes each, the fork (f7d126a) against upstream at e300919, which has its own fix for the SCALE of a view (ggml-org#32735) and the loop fix: UD-Q4_K_XL generates at 48.0-48.2 tok/s against 37.1-37.3 (Vulkan) and 33.7 (ROCm), the Q8_0 at 46.2 against 36.2 and 31.2; prompts of 512 within 1-3% of ROCm, at a depth of 2048 57-60% ahead of it. The guide's R9700 section and FORK.md's line take these in place of the numbers against the fork's base. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
FYI: It appears that this change took my test run documented here: From 212 splits to 20! |
Assisted-By: Opus 5.5
Moves llama.cpp from the PR head 0ea4ffd00 to upstream master 8a97fa98a, the merge commit of ggml-org/llama.cpp#32735. The only API delta is additive mtmd audio fields, which InferDeck does not use.
Assisted-By: Opus 5.5
|
Windows Vulkan confirmation on one AMD Radeon AI PRO R9700. Official ggml-org Inkling-2-Mini-IQ4_NL, llama-server Raw
A 17×3 chat returned 51 on both builds. One shot from llama-server timings, not llama-bench, and flash attention was off. Different quant and harness from the Q8_K_XL table above. |
|
Follow-up on the same Radeon AI PRO R9700, Windows Vulkan b12628 (8a97fa9), official Inkling-2-Mini IQ4_NL. llama-server -c 17408 -fa off -ngl 99 --no-mmproj. One raw /completion, not llama-bench (no context cap, and this GGUF defaults to 1M). Prompt was 16378 tokens so 128 generated tokens fit. prompt 943.88 tok/s, predicted 128 at 54.38 tok/s. The PR table is Q8_K_XL, FA on, llama-bench tg128 47.8 at depth 16384. Different quant and harness. Short-context pair on this machine is unchanged: 66.06 at -c 2048, FA off. |
… own The base is upstream f4f6f2e. Upstream's weight scales (ggml-org#32669), the lightning indexer always fused (ggml-org#32650), SCALE through the strides (ggml-org#32735, the fork's own change line for line) and the whole copy of a looped model's experts (ggml-org#32807, kept to the shared tensors). docs/inkling2-mini.md no longer lists the loop fix and the SCALE as the fork's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Port of ggml-org#32735. Inkling 2's SITU activation scales the strided gate and up views of the fused gate_up output; with a contiguous src required, both SCALEs ran on the CPU, two round trips per MoE layer. Inkling 2 Mini UD-Q4_K_XL on RADV gfx1151: pp512 +39%, tg128 +40%. test-backend-ops adds a view that starts half a row in, like the up half of gate_up.
Port of ggml-org#32735. Inkling 2's SITU activation scales the strided gate and up views of the fused gate_up output; with a contiguous src required, both SCALEs ran on the CPU, two round trips per MoE layer. Inkling 2 Mini UD-Q4_K_XL on RADV gfx1151: pp512 +39%, tg128 +40%. test-backend-ops adds a view that starts half a row in, like the up half of gate_up.
Backport of upstream 8a97fa9 (ggml-org#32735). scale.comp indexes src and dst with src0_idx / dst_idx, so supports_op no longer needs a contiguous src. Before, the scheduler put every SCALE of a view on the CPU: Inkling 2 Mini's situ activation scales the gate and up views of the merged gate_up output, 96 SCALE ops per decoded token, 194 graph splits instead of 2. Upstream's F16 view test is not added: Vulkan SCALE in this fork is F32 only. Assisted-by: Claude Code
Overview
I've tried the new model
Inkling 2 Minithat gave only 20 tok/s on my R9700. The GPU was utilized around 47% on decode, and about 5% was on copy. So, I tried to find the issue and fix it.The issue is that Vulkan's
supports_oprejectedSCALEon non-contiguous input, so the scheduler sent those ops to the CPU. Inbuild_moe_ffn, SiTU applies SCALE to the gate and up halves of the fusedgate_upoutput, but because these are non-contiguous, strided views, Vulkan rejects them, forcing both scale operations in every layer to run on the CPU and resulting in 194 graph splits.After my fix
scale.compindexes throughsrc0_idx()/dst_idx(), aslog.compand other unary shaders do. Those strides were already in the push constants. The contiguity check is dropped fromsupports_op. That brings Vulkan in line with CUDA and Metal, which already accept this.Additional information
Used
Inkling-2-Mini-UD-Q8_K_XL.gguffrom Unsloth repo (from Mainline_Support folder) on my Radeon AI PRO R9700.b019be0c, master)0ea4ffd0, fix)Tested with
llama-bench -ngl 99 -fa 1 -ctk q8_0 -ctv q8_0 -p 512 -n 128 -d 0,16384 -r 3.And the splits in log went from 194 to 2. Long-context output checked on a coding task in my harness - it worked for 22 minutes and finished the test project successfully.
The existing non-contiguous SCALE view tests used to be skipped on Vulkan and now run, I've added an f16 view case.
Also, this slowness is mentioned in issue #32707. It doesn't close that issue, since others there report slowness on CUDA, which this fix doesn't touch, but may help in identifying the cause.
Requirements