Skip to content

Commit 4ed2510

Browse files
committed
Support BF16 model
1 parent b453d68 commit 4ed2510

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ggml/src/ggml-openvino/ggml-decoder.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,14 @@ std::map<std::string, std::shared_ptr<ov::Node>> GgmlOvDecoder::create_weight_no
419419

420420
std::shared_ptr<ov::Node> GgmlOvDecoder::create_weight_node(ggml_tensor* tensor,
421421
std::optional<ExtraQuantType> requant_type) {
422-
std::set<ggml_type> weight_types = {
423-
GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_Q8_0, GGML_TYPE_Q4_0, GGML_TYPE_Q4_1, GGML_TYPE_Q4_K, GGML_TYPE_Q6_K};
422+
std::set<ggml_type> weight_types = {GGML_TYPE_F32,
423+
GGML_TYPE_F16,
424+
GGML_TYPE_BF16,
425+
GGML_TYPE_Q8_0,
426+
GGML_TYPE_Q4_0,
427+
GGML_TYPE_Q4_1,
428+
GGML_TYPE_Q4_K,
429+
GGML_TYPE_Q6_K};
424430
if (weight_types.find(tensor->type) == weight_types.end()) {
425431
throw std::runtime_error("Unexpected weight tensor type: " + std::string(tensor->name) + " with type " +
426432
ggml_type_name(tensor->type));

ggml/src/ggml-openvino/utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ std::map<ggml_type, ExtraQuantType> get_types_to_requant(const std::string& devi
276276
{GGML_TYPE_Q6_K, ExtraQuantType::Q8_1_C},
277277
};
278278
}
279+
return {};
279280
}
280281

281282
ov::AnyMap get_npu_generate_config() {

0 commit comments

Comments
 (0)