AISpot

llama.cpp 最佳化 SYCL 短行 TOP_K,最高提速 18.5 倍

llama.cpp releases版本更新地端推論開源

llama.cpp 合併了一項 SYCL 後端改動:當 TOP_K 的行長度不超過 work-group 大小時,改為每個 work-item 負責一列、做 k 輪 work-group argmax,並列時取較小列號,NaN 不會被選中,長行仍走原有路徑。

原標題:b11963
閱讀原文

評分48 / 48(平均 48,門檻 60)
狀態未入選

原文

sycl: work-group argmax for short TOP_K rows ( #31110 ) sycl: work-group argmax for short TOP_K rows Used angelX to optimize SYCL/drama 3 coordination, results are as follows Rows with ncols <= max work-group size: one work-item per column, k rounds of work-group argmax. Ties take the lower column, NaN is never picked. Longer rows keep the existing paths. Arc Pro B70, oneAPI 2026.1, test-backend-ops perf (existing short-row cases), base 9b56ccf vs patch, median ratio of 6 rotating A/B/A rounds: ncols nrows k base us patch us speedup 16 1024 1 19.97 2.88 6.95x 16 1024 2 23.83 2.90 8.25x 16 1024 8 66.12 4.66 14.21x 16 8192 1 110.42 5.96 18.51x 16 8192 2 130.21 8.82 14.77x 16 8192 8 420.62 27.27 15.42x 128 1024 1 20.49 2.94 6.97x 128 1024 2 25.89 3.45 7.52x 128 1024 8 101.67 8.95 11.36x 128 8192 1 112.19 13.29 8.44x 128 8192 2 141.18 20.60 6.85x 128 8192 8 643.21 67.60 9.51x 1024 1024 1 17.32 14.98 1.16x 1024 1024 2 28.77 24.02 1.20x 1024 1024 8 151.87 77.88 1.95x 1024 8192 1 156.49 138.78 1.13x 1024 8192 2 201.47 209.18 0.96x 1024 8192 8 1006.25 632.60 1.59x The 1024 x 8192, k=2 case is 3.7% slower. Correctness: test-backend-ops -o TOP_K 533/533 and -o ARGSORT 98/98 on the patch, again on the rebase onto 3f03b17 . Full test-backend-ops aborts on base and patch alike at the non-F32 SWIGLU_OAI assert (element_wise.cpp:1187, see #30857 ). With only those cases excluded: 20145/20173 on base and patch. One CPY f16->q2_0 [256,2,3,4] failure was seen once on the patch, and 3/3 re-runs pass on base and patch. All other patch-run failures also fail on base. Assisted-by: Claude Opus 5.5 made changes as suggested Assisted-by: Claude Opus 5.5 Website: https://llama.app Attestations: https://github.com/ggml-org/llama.cpp/attestations/60868996 macOS/iOS: macOS Apple Silicon (arm64) macOS Apple Silicon (arm64, KleidiAI enabled) DISABLED macOS Intel (x64) iOS XCFramework Linux: Ubuntu x64 (CPU) Ubuntu arm64 (CPU) Ubuntu s390x (CPU) Ubuntu x64 (Vulkan) Ubuntu arm64 (Vulkan) Ubuntu x64 (CUDA 12) - CUDA 12.8 libraries Ubuntu x64 (CUDA 13) - CUDA 13.4 libraries Ubuntu arm64 (CUDA 13) - CUDA 13.4 libraries Ubuntu x64 (ROCm 10.0) Ubuntu x64 (OpenVINO) Ubuntu x64 (SYCL FP32) Ubuntu x64 (SYCL FP16) Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide Android: Android arm64 (CPU) Android arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide Windows: Windows x64 (CPU) Windows arm64 (CPU) Windows arm64 (OpenCL Adreno) Windows x64 (CUDA 12) - CUDA 12.4 DLLs Windows x64 (CUDA 13) - CUDA 13.4 DLLs Windows arm64 (CUDA 13) - CUDA 13.4 DLLs Windows x64 (Vulkan) Windows arm64 (Vulkan) Windows x64 (OpenVINO) Windows x64 (SYCL) Windows x64 (ROCm 10.0) openEuler: DISABLED openEuler x86 (310p) openEuler x86 (910b, ACL Graph) openEuler aarch64 (310p) openEuler aarch64 (910b, ACL Graph) UI: UI

相關報導

llama.cpp releasesAI 評分58

b11902: sycl: add set_tensor_2d for faster tensor-split loading (#30358)

llama.cpp 的 SYCL 後端新增 set_tensor_2d:當目標行連續時,它把主機資料打包成最大 64 MiB 的塊上傳,避免逐行呼叫複製。在兩張 Arc Pro B70 上跑 gpt-oss-120b UD-Q4_K_XL,llama-perplexity 總耗時從 263–268 秒降到 114–115 秒。實現複用 pinned staging 槽位,讓 CPU 打包與裝置複製重疊,只在複用槽位時等待;

llama.cpp releases● 精選AI 評分68

llama.cpp SYCL 為 GLM MLA 預填充接入 MKL,pp8192 提速 2.99 倍

llama.cpp 的 SYCL 後端放行了 GLM-4.7 Flash 的 MLA 形狀走 MKL flash attention,此前該形狀因 K/V 寬度不一致、head dim 上限 512 被排程器拒絕,預填充只能回退到更慢的 TILE kernel。在 Intel Arc Pro B70 上,pp8192 從 432.80 提升到 1292.29 tok/s(2.99 倍,+198.6%),tg256 在噪聲範圍內基本不變(45.67 對 45.65)。

llama.cpp releasesAI 評分37

llama.cpp b11748 修復 SYCL 重排量化權重的 get_rows

llama.cpp 發布 b11748 建置,主要修復 SYCL 後端在重排後的量化權重上呼叫 get_rows 的問題(PR #30430)。該版本同時更新了多平台預編譯產物:macOS/iOS 的 XCFramework、Linux 與 Windows 的 CPU、Vulkan、CUDA 12/13、ROCm 10.0、OpenVINO、SYCL 建置,以及驍龍平台的 CPU、Adreno GPU 與 Hexagon NPU 支援。