]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
sycl: Increase minimum buffer size for USM system allocations (#25525)
authorFrancois Dugast <redacted>
Wed, 15 Jul 2026 07:28:24 +0000 (09:28 +0200)
committerGitHub <redacted>
Wed, 15 Jul 2026 07:28:24 +0000 (10:28 +0300)
Raise the threshold for minimum buffer size from 1 GiB to 4 GiB, based
on real-world experiments of overcommitting device memory with model
weights larger than available VRAM, for example Qwen3.5-35B-A3B-Q8
running on a B70.

Also add a debug message to better track USM system allocations.

Signed-off-by: Francois Dugast <redacted>
ggml/src/ggml-sycl/ggml-sycl.cpp

index df7159db5e0a3651bbaa17e0210f949bdaea8d87..f534d237d7576b1358f1cc3def367cf9243bcb3b 100644 (file)
@@ -843,7 +843,7 @@ static const char * ggml_backend_sycl_buffer_type_get_name(ggml_backend_buffer_t
 }
 
 static bool check_usm_system(int device, size_t size) {
-    bool use_usm_system = g_ggml_sycl_usm_system && size >= MEM_SIZE_1G;
+    bool use_usm_system = g_ggml_sycl_usm_system && size >= ((size_t)4 * MEM_SIZE_1G);
 
     if (use_usm_system && !ggml_sycl_info().devices[device].usm_system_support) {
         GGML_LOG_INFO("Device does not support USM system allocations\n");
@@ -882,6 +882,7 @@ ggml_backend_sycl_buffer_type_alloc_buffer(ggml_backend_buffer_type_t buft,
 
     void * dev_ptr;
     if (use_usm_system) {
+        GGML_SYCL_DEBUG("[SYCL] allocating %lu Bytes with USM system\n", size);
         dev_ptr = (void *)aligned_malloc_host(alignment, aligned_size);
         if (!dev_ptr) {
             GGML_LOG_ERROR("%s: can't allocate %lu Bytes of memory on host\n", __func__, size);