-
Notifications
You must be signed in to change notification settings - Fork 112
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
Load diffusers in native FP16/BF16 precision to reduce the memory usage #1033
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Ekaterina Aidova <ekaterina.aidova@intel.com>
Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
@mvafin, any chance to merge it soon? What is the blocker? |
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.
Cool! Are non-diffusion models already exported efficiently like this?
@@ -332,6 +333,48 @@ class StoreAttr(object): | |||
return model | |||
|
|||
GPTQQuantizer.post_init_model = post_init_model | |||
elif library_name == "diffusers" and is_safetensors_available() and is_openvino_version(">=", "2024.6"): | |||
if Path(model_name_or_path).is_dir(): |
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.
Can you please extract and encapsulate this code to a function with a meaningful name?
Only for text generation models. But it even beater there, since we do not use memory to load weights, we just copy them from one location on disk to another using mmap, for diffusers we couldn't achieve this yet. |
What does this PR do?
Load diffusers model in native
float16
orbfloat16
precision and apply 16bit patching for that case.Before submitting