llama.cpp b12034:修复 WebGPU scratch 分配尺寸非单调问题
原标题:b12034
AI 摘要
llama.cpp 发布 b12034 版本,主要修复 WebGPU 后端的 CI 问题:此前 flash attention vec 路径与 MMVQ 路径会在 dst 之后追加 scratch 区域,但 get_alloc_size 仅在该批次走对应路径时计入该开销,导致分配尺寸对 batch 长度不单调,在 GGML_SCHED_NO_REALLOC 构建下触发意外重分配而中止。修复方式是把行数传入两个路径判定函数,并按短路径支持的最长批次对行数做 clamp 来计算 scratch 大小;同时按 clang-format 22 对齐 MMVQ pipeline key,并命名 mat-vec 行阈值。该版本同时提供 macOS、Linux、Windows、Android 等多平台预编译包。
正文节选
<details open> webgpu : fix CI by keeping scratch alloc sizes monotonic in batch length (#31422) * webgpu: keep scratch alloc sizes monotonic in the batch length The flash attention vec path and the MMVQ path append a scratch area after dst, but get_alloc_size only accounted for it when the current batch takes that path. The size was therefore not monotonic in the batch length: a graph reserved at n_ubatch (tiled path, no scratch) or at one token did not cover batches of 2 to 19 query rows, a