Open moonlightian opened 11 months ago
@moonlightian Fabric's setup only accepts torfch.nn.Module
models. You get the error because StableDiffusionXLPipeline
is not a PyTorch module.
I looked a bit but I couldn't find an easy way to apply bitsandbytes to this pipeline.
I looked a bit but I couldn't find an easy way to apply bitsandbytes to this pipeline.
Thank you for your response, but I still want to know if there is a way to implement quantization operations related to SDXL as shown on the webpage.
And I found it would work if I quantize the unet with
quantized_unet = fabric.setup_module(pipe.unet)
pipe.unet = quantized_unet
while it would not be good to replace SDXL's origin unet with quantized one when doing inference , because of the dismatch of the data type for input and output. What should I do if I want to quantize a model module by module?
Bug description
It seems not good to use BitsandbytesPrecision directly as shown at front pages of Lightning.
what should I do to quantize SDXL and make it saved after quantization? Codes and bugs are shown below
What version are you seeing the problem on?
v2.1
How to reproduce the bug
Error messages and logs
Bugs are like this:
Environment
Current environment
``` #- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow): #- PyTorch Lightning Version (e.g., 1.5.0): #- Lightning App Version (e.g., 0.5.2): #- PyTorch Version (e.g., 2.0): #- Python version (e.g., 3.9): #- OS (e.g., Linux): #- CUDA/cuDNN version: #- GPU models and configuration: #- How you installed Lightning(`conda`, `pip`, source): #- Running environment of LightningApp (e.g. local, cloud): ```More info
No response