-
Notifications
You must be signed in to change notification settings - Fork 240
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
Low accuracy when use ipex + quantize #252
Comments
Please have a try with https://github.com/intel/neural-compressor. It can calibrate a model while trying to keep accuracy. |
@rnwang04 Do you mind also let us know what model you were quantizing? |
@jgong5 Hi, thanks for response. I was trying to quantize unet model in stable diffusion pipeline.
|
@jingxu10 Thanks for your quick response ! Actually I have tried inc quantization with ipex, but it failed to work. I will report this issue to inc also. |
Got it. We will look into it. |
This issue is reproducible with an updated code snippet.
You also need to add some changes to the stable diffusers pipeline source code as below : # Change this line from pipeline_stable_diffusion.py
noise_pred = self.unet(latent_model_input, t, encoder_hidden_states=text_embeddings).sample
# to
noise_pred = self.unet(latent_model_input, t, text_embeddings)[0] |
Hi, I am trying to use ipex to quantize unet model following https://github.com/intel/intel-extension-for-pytorch/blob/v1.12.0/docs/tutorials/features/int8.md.
Now the model can be quantized, but the generation results become very poor.
I wonder is there any method (e.g. change mode or modify some config) to avoid such low accuracy after quantization with ipex?
My torch version: 1.12.1
My ipex version: 1.12.100
Thanks !
The text was updated successfully, but these errors were encountered: