fix: preserve BF16 embedding weights for get_rows (#1959)

This commit is contained in:
LED-M
2026-09-11 23:09:45 +08:00
committed by GitHub
parent b68d58624d
commit e95ab96997
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -309,6 +309,7 @@ public:
__STATIC_INLINE__ bool support_get_rows(ggml_type wtype) {
switch (wtype) {
case GGML_TYPE_F16:
case GGML_TYPE_BF16:
case GGML_TYPE_Q8_0:
case GGML_TYPE_Q5_1:
case GGML_TYPE_Q5_0:
+4
View File
@@ -145,6 +145,10 @@ protected:
params["position_embedding.weight"] = ggml_new_tensor_2d(ctx, position_wtype, embed_dim, num_positions);
}
enum ggml_op param_usage_op(const std::string& name) const override {
return name == "token_embedding.weight" ? GGML_OP_GET_ROWS : GGML_OP_NONE;
}
public:
CLIPEmbeddings(int64_t embed_dim,
int64_t vocab_size = 49408,