-
Notifications
You must be signed in to change notification settings - Fork 396
Fix loading diffusers model (+support F64/I64 types) #681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It would be nice to get it to work for DiT models too, but it looks like a lot of work, because qkv matrices are split in diffusers format. That would probably require a significant refactor of the model loading logic... |
model.cpp
Outdated
std::string new_name = prefix + name; | ||
new_name = convert_tensor_name(new_name); | ||
|
||
TensorStorage tensor_storage(new_name, type, ne, n_dims, file_index, ST_HEADER_SIZE_LEN + header_size_ + begin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is breaking some LoRAs.
Thank you for your contribution. |
@stduhpf , I'm getting an 'f64 unsupported' error trying the model mentioned on #153 ( https://civitai.com/models/7371/rev-animated?modelVersionId=425083 , fp32 file):
This is on master-dafc32d . |
Yeah, F64 is still not properly supported. I didn't realize there isn't a built in "dequantization" (or rather quantization in that case) function for F64 to F32 in GGML, so I just implemented it with #726. This fix the crash during loading time, but I can't get inference to run with either Vulkan or CPU backends when using the models with F64 weights. Forcing it to use F32 works with the new new changes I made ( |
Loading diffusers models wasn't working, this fixes it for me,. I also added support for SDXL diffusers model (the second text encoder wasn't being handled).
During testing, I came across models with 64bit types, so I added support for those too since they are supported by GGML. (Fixes #153, #669)