ICYM: llama.cpp b9455 --SM Tensor KV Cache Fix is MERGED

Reddit r/LocalLLaMA Tools

Summary

llama.cpp version b9455 merges a fix for `-sm tensor` KV cache quantization on multi-GPU setups, addressing a shape information loss issue when flattening tensors.

Them boys can cook, one big fix after another! If you're running --sm tensor on multi-gpu this is the KV cache quantization fix [https://github.com/ggml-org/llama.cpp/releases/tag/b9455](https://github.com/ggml-org/llama.cpp/releases/tag/b9455) > [**JohannesGaessler**](https://github.com/JohannesGaessler)commented[5 days ago](https://github.com/ggml-org/llama.cpp/pull/23792#issue-4535454876) This PR implements support for the combination of `-sm tensor` and quantized KV cache. The reason why this doesn't work on master is that the flattening of tensors for the KV cache rotation leads to the loss of shape information which the meta backend cannot handle. There were previous PRs which resolved the issue by changing the shapes of the KV cache rotation but that is an undesirable solution because batched matrix multiplications may not be as well-supported in ggml backends as a single large matrix multiplication. Also it is generally better to extend the meta backend with capabilities to handle a compute graph than to require compute graphs to conform to the meta backend's requirments. The approach in this PR is to extend the specification `ggml_backend_meta_split_state` with a value that specifies how often a given segment repeats. When a tensor is flattened the meta backend uses segments to specify the data layout within the flattened dimension so that upon a further reshape the correct data layout can be restored. No changes to the llama.cpp compute graphs are required.
Original Article

Similar Articles

llama.cpp b9966 for sm-tensor

Reddit r/LocalLLaMA

llama.cpp b9966 introduces a fix for the -sm tensor mode that caches regex patterns, eliminating 29 recompilations per tensor per token on the decode thread, resulting in significantly reduced CPU overhead.

Llama.cpp : Split Mode Tensor Fix Incoming?

Reddit r/LocalLLaMA

Llama.cpp is expected to receive a fix for split mode tensor crashes on multi-GPU setups, which currently cause VRAM exhaustion every 90-120 minutes. The fix also reportedly brings a ~35% throughput improvement over layer mode.

Dual GPU llama.cpp speedup

Reddit r/LocalLLaMA

A fork of llama.cpp fixes the --split-mode tensor issue with quantized KV caches, achieving up to 40% speed improvement on dual GPU setups without quality loss.