Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,11 @@ class CLIPEmbeddings : public GGMLBlock {
enum ggml_type token_wtype = GGML_TYPE_F32;
if (!force_clip_f32) {
auto tensor_type = tensor_types.find(prefix + "token_embedding.weight");
if (tensor_type != tensor_types.end())
if (tensor_type != tensor_types.end() && tensor_type->second == GGML_TYPE_F16) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe lower quants could be kept at F16 too (or even Q8)? The main reason for quantization is reducing memory usage, so it'd be surprising if a Q8_0 or Q4_0 quant ended up using more VRAM than F16.

token_wtype = tensor_type->second;
}
}
enum ggml_type position_wtype = GGML_TYPE_F32;

params["token_embedding.weight"] = ggml_new_tensor_2d(ctx, token_wtype, embed_dim, vocab_size);
params["position_embedding.weight"] = ggml_new_tensor_2d(ctx, position_wtype, embed_dim, num_positions);
}
Expand Down
2 changes: 2 additions & 0 deletions model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,8 @@ bool ModelLoader::tensor_should_be_converted(const TensorStorage& tensor_storage
// Pass, do not convert. For MMDiT
} else if (contains(name, "time_embed.") || contains(name, "label_emb.")) {
// Pass, do not convert. For Unet
} else if (contains(name, "embedding")) {
// Pass, do not convert embedding
} else {
return true;
}
Expand Down
Loading