fix(lora): apply LoRAs at runtime for fp8 weights in auto mode

This commit is contained in:
Jasper Blues 2026-11-26 14:35:43 +10:00
parent 52491bd9f1
commit 2a0fa74b0b
No known key found for this signature in database
GPG key ID: D69F0A52E1FB250B

View file

@ -19,7 +19,9 @@ namespace sd::dgl::models {
const auto& tensors = loader.get_tensor_storage_map();
const bool quantized = std::any_of(tensors.begin(), tensors.end(), [](const auto& entry) {
const auto& tensor = entry.second;
return tensor.w4_convrot_kind ||
// Merging into fp8 weights needs a CPY to fp8, which Vulkan cannot run.
const ggml_type type = tensor.expected_type < GGML_TYPE_COUNT ? tensor.expected_type : tensor.type;
return tensor.w4_convrot_kind || type == GGML_TYPE_F8_E4M3 || type == GGML_TYPE_F8_E5M2 ||
(!tensor.is_int8_tensorwise &&
(ggml_is_quantized(tensor.type) ||
(tensor.expected_type < GGML_TYPE_COUNT && ggml_is_quantized(tensor.expected_type))));