mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-10-22 03:48:19 +02:00
sycl : fix the B70 mem allocate error when >19.3GB (llama/28953)
This commit is contained in:
committed by
Georgi Gerganov
parent
84a020e308
commit
b9e5f3acb0
@@ -1011,12 +1011,25 @@ static size_t ggml_backend_sycl_buffer_type_get_alignment(ggml_backend_buffer_ty
|
|||||||
GGML_UNUSED(buft);
|
GGML_UNUSED(buft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_bmg_g31_arch(int device) {
|
||||||
|
return ggml_sycl_info().devices[device].hw_info.arch == gpu_arch::intel_gpu_bmg_g31;
|
||||||
|
}
|
||||||
|
|
||||||
static size_t ggml_backend_sycl_buffer_type_get_max_size(ggml_backend_buffer_type_t buft) {
|
static size_t ggml_backend_sycl_buffer_type_get_max_size(ggml_backend_buffer_type_t buft) {
|
||||||
size_t max_alloc_size = dpct::get_current_device().get_max_mem_alloc_size();
|
size_t max_alloc_size = dpct::get_current_device().get_max_mem_alloc_size();
|
||||||
if (g_ggml_sycl_host_pinned_mem_2g) {
|
if (g_ggml_sycl_host_pinned_mem_2g) {
|
||||||
return std::min(max_alloc_size, (size_t) 2LL*1024*1024*1024);
|
return std::min(max_alloc_size, (size_t) 2LL*1024*1024*1024);
|
||||||
} else {
|
} else {
|
||||||
|
ggml_backend_sycl_buffer_type_context * ctx = (ggml_backend_sycl_buffer_type_context *)buft->context;
|
||||||
|
int device = ctx->device;
|
||||||
|
if(is_bmg_g31_arch(device)) {
|
||||||
|
//Todo, it's workaround for BMG-G31, which has a known issue with large allocations.
|
||||||
|
//The max alloc size is reduced to 60% of the reported max alloc size.
|
||||||
|
//remove it after https://github.com/intel/compute-runtime/issues/998 is fixed.
|
||||||
|
max_alloc_size = max_alloc_size*0.6;
|
||||||
|
}
|
||||||
return max_alloc_size;
|
return max_alloc_size;
|
||||||
|
|
||||||
}
|
}
|
||||||
GGML_UNUSED(buft);
|
GGML_UNUSED(buft);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user