-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Correctly keep vae in float16
when using PyTorch 2 or xFormers
#4019
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
The documentation is not available anymore as the PR was closed or merged. |
Very nice catch! |
Think this was a double bug that corrected itself which is why we didn't see an improvement in memory savings no? Think I rushed this implementation for IF and probably didn't add a test here. Good for merge for me! Feel free to add a test, but also ok to merge without given that we have trouble with testing memory savings |
* Update pipeline_stable_diffusion_xl.py fix a bug * Update pipeline_stable_diffusion_xl_img2img.py * Update pipeline_stable_diffusion_xl_img2img.py * Update pipeline_stable_diffusion_upscale.py * style --------- Co-authored-by: Hu Ye <[email protected]>
* add: controlnet sdxl. * modifications to controlnet. * run styling. * add: __init__.pys * incorporate #4019 changes. * run make fix-copies. * resize the conditioning images. * remove autocast. * run styling. * disable autocast. * debugging * device placement. * back to autocast. * remove comment. * save some memory by reusing the vae and unet in the pipeline. * apply styling. * Allow low precision sd xl * finish * finish * changes to accommodate the improved VAE. * modifications to how we handle vae encoding in the training. * make style * make existing controlnet fast tests pass. * change vae checkpoint cli arg. * fix: vae pretrained paths. * fix: steps in get_scheduler(). * debugging. * debugging./ * fix: weight conversion. * add: docs. * add: limited tests./ * add: datasets to the requirements. * update docstrings and incorporate the usage of watermarking. * incorporate fix from #4083 * fix watermarking dependency handling. * run make-fix-copies. * Empty-Commit * Update requirements_sdxl.txt * remove vae upcasting part. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make style * run make fix-copies. * disable suppot for multicontrolnet. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make fix-copies. * dtyle/. * fix-copies. --------- Co-authored-by: Patrick von Platen <[email protected]>
* add: controlnet sdxl. * modifications to controlnet. * run styling. * add: __init__.pys * incorporate huggingface#4019 changes. * run make fix-copies. * resize the conditioning images. * remove autocast. * run styling. * disable autocast. * debugging * device placement. * back to autocast. * remove comment. * save some memory by reusing the vae and unet in the pipeline. * apply styling. * Allow low precision sd xl * finish * finish * changes to accommodate the improved VAE. * modifications to how we handle vae encoding in the training. * make style * make existing controlnet fast tests pass. * change vae checkpoint cli arg. * fix: vae pretrained paths. * fix: steps in get_scheduler(). * debugging. * debugging./ * fix: weight conversion. * add: docs. * add: limited tests./ * add: datasets to the requirements. * update docstrings and incorporate the usage of watermarking. * incorporate fix from huggingface#4083 * fix watermarking dependency handling. * run make-fix-copies. * Empty-Commit * Update requirements_sdxl.txt * remove vae upcasting part. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make style * run make fix-copies. * disable suppot for multicontrolnet. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make fix-copies. * dtyle/. * fix-copies. --------- Co-authored-by: Patrick von Platen <[email protected]>
* add: controlnet sdxl. * modifications to controlnet. * run styling. * add: __init__.pys * incorporate huggingface#4019 changes. * run make fix-copies. * resize the conditioning images. * remove autocast. * run styling. * disable autocast. * debugging * device placement. * back to autocast. * remove comment. * save some memory by reusing the vae and unet in the pipeline. * apply styling. * Allow low precision sd xl * finish * finish * changes to accommodate the improved VAE. * modifications to how we handle vae encoding in the training. * make style * make existing controlnet fast tests pass. * change vae checkpoint cli arg. * fix: vae pretrained paths. * fix: steps in get_scheduler(). * debugging. * debugging./ * fix: weight conversion. * add: docs. * add: limited tests./ * add: datasets to the requirements. * update docstrings and incorporate the usage of watermarking. * incorporate fix from huggingface#4083 * fix watermarking dependency handling. * run make-fix-copies. * Empty-Commit * Update requirements_sdxl.txt * remove vae upcasting part. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make style * run make fix-copies. * disable suppot for multicontrolnet. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make fix-copies. * dtyle/. * fix-copies. --------- Co-authored-by: Patrick von Platen <[email protected]>
* add: controlnet sdxl. * modifications to controlnet. * run styling. * add: __init__.pys * incorporate huggingface#4019 changes. * run make fix-copies. * resize the conditioning images. * remove autocast. * run styling. * disable autocast. * debugging * device placement. * back to autocast. * remove comment. * save some memory by reusing the vae and unet in the pipeline. * apply styling. * Allow low precision sd xl * finish * finish * changes to accommodate the improved VAE. * modifications to how we handle vae encoding in the training. * make style * make existing controlnet fast tests pass. * change vae checkpoint cli arg. * fix: vae pretrained paths. * fix: steps in get_scheduler(). * debugging. * debugging./ * fix: weight conversion. * add: docs. * add: limited tests./ * add: datasets to the requirements. * update docstrings and incorporate the usage of watermarking. * incorporate fix from huggingface#4083 * fix watermarking dependency handling. * run make-fix-copies. * Empty-Commit * Update requirements_sdxl.txt * remove vae upcasting part. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make style * run make fix-copies. * disable suppot for multicontrolnet. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make fix-copies. * dtyle/. * fix-copies. --------- Co-authored-by: Patrick von Platen <[email protected]>
…gingface#4019) * Update pipeline_stable_diffusion_xl.py fix a bug * Update pipeline_stable_diffusion_xl_img2img.py * Update pipeline_stable_diffusion_xl_img2img.py * Update pipeline_stable_diffusion_upscale.py * style --------- Co-authored-by: Hu Ye <[email protected]>
* add: controlnet sdxl. * modifications to controlnet. * run styling. * add: __init__.pys * incorporate huggingface#4019 changes. * run make fix-copies. * resize the conditioning images. * remove autocast. * run styling. * disable autocast. * debugging * device placement. * back to autocast. * remove comment. * save some memory by reusing the vae and unet in the pipeline. * apply styling. * Allow low precision sd xl * finish * finish * changes to accommodate the improved VAE. * modifications to how we handle vae encoding in the training. * make style * make existing controlnet fast tests pass. * change vae checkpoint cli arg. * fix: vae pretrained paths. * fix: steps in get_scheduler(). * debugging. * debugging./ * fix: weight conversion. * add: docs. * add: limited tests./ * add: datasets to the requirements. * update docstrings and incorporate the usage of watermarking. * incorporate fix from huggingface#4083 * fix watermarking dependency handling. * run make-fix-copies. * Empty-Commit * Update requirements_sdxl.txt * remove vae upcasting part. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make style * run make fix-copies. * disable suppot for multicontrolnet. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make fix-copies. * dtyle/. * fix-copies. --------- Co-authored-by: Patrick von Platen <[email protected]>
…gingface#4019) * Update pipeline_stable_diffusion_xl.py fix a bug * Update pipeline_stable_diffusion_xl_img2img.py * Update pipeline_stable_diffusion_xl_img2img.py * Update pipeline_stable_diffusion_upscale.py * style --------- Co-authored-by: Hu Ye <[email protected]>
* add: controlnet sdxl. * modifications to controlnet. * run styling. * add: __init__.pys * incorporate huggingface#4019 changes. * run make fix-copies. * resize the conditioning images. * remove autocast. * run styling. * disable autocast. * debugging * device placement. * back to autocast. * remove comment. * save some memory by reusing the vae and unet in the pipeline. * apply styling. * Allow low precision sd xl * finish * finish * changes to accommodate the improved VAE. * modifications to how we handle vae encoding in the training. * make style * make existing controlnet fast tests pass. * change vae checkpoint cli arg. * fix: vae pretrained paths. * fix: steps in get_scheduler(). * debugging. * debugging./ * fix: weight conversion. * add: docs. * add: limited tests./ * add: datasets to the requirements. * update docstrings and incorporate the usage of watermarking. * incorporate fix from huggingface#4083 * fix watermarking dependency handling. * run make-fix-copies. * Empty-Commit * Update requirements_sdxl.txt * remove vae upcasting part. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make style * run make fix-copies. * disable suppot for multicontrolnet. * Apply suggestions from code review Co-authored-by: Patrick von Platen <[email protected]> * run make fix-copies. * dtyle/. * fix-copies. --------- Co-authored-by: Patrick von Platen <[email protected]>
This is a continuation of #3979
@xiaohu2015 noticed this bug, but I'm not seeing memory savings in my system for SDXL (maybe it's a cuda cache problem). @williamberman do you remember how you tested it on the upscale pipeline?