mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-06-17 11:46:38 +00:00
fix: allow oversized Vulkan parameter tensors (#1662)
This commit is contained in:
parent
bb90bfa00f
commit
6e66a1a4a4
@ -577,13 +577,8 @@ bool ModelManager::alloc_params_buffers(const std::vector<TensorState*>& states,
|
|||||||
for (TensorState* state : states) {
|
for (TensorState* state : states) {
|
||||||
ggml_tensor* tensor = state->tensor;
|
ggml_tensor* tensor = state->tensor;
|
||||||
size_t tensor_size = GGML_PAD(ggml_backend_buft_get_alloc_size(params_buft, tensor), alignment);
|
size_t tensor_size = GGML_PAD(ggml_backend_buft_get_alloc_size(params_buft, tensor), alignment);
|
||||||
if (max_size > 0 && tensor_size > max_size) {
|
// Some backends, e.g. Vulkan, report a preferred chunk size here rather than a
|
||||||
LOG_ERROR("model manager tensor '%s' is too large for params buffer: %zu > %zu",
|
// hard per-tensor allocation limit. Oversized tensors are allocated alone.
|
||||||
ggml_get_name(tensor),
|
|
||||||
tensor_size,
|
|
||||||
max_size);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!chunk.empty() && max_size > 0 && chunk_size + tensor_size > max_size) {
|
if (!chunk.empty() && max_size > 0 && chunk_size + tensor_size > max_size) {
|
||||||
if (!alloc_chunk(chunk, chunk_size)) {
|
if (!alloc_chunk(chunk, chunk_size)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user