hatchetProject / QuEST

QuEST: Efficient Finetuning for Low-bit Diffusion Models
26 stars 2 forks source link

KeyError in cross_attn_forward #1

Closed colorjam closed 4 months ago

colorjam commented 4 months ago

Thanks for the contribution of the author.

I try to reproduce the stable diffusion quantization, but encountered the KeyError in cross_attn_forward: image

Command I run:

python txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms --cond --ptq --weight_bit 8 --quant_mode qdiff --quant_act --act_bit 8 --cali_st 25 --cali_batch_size 8 --cali_n 128 --no_grad_ckpt --split --running_stat --sm_abit 16 --cali_data_path ./sd_coco-s75_sample1024_allst.pt --outdir ./experiment --ckpt ../stable-diffusion/models/ldm/stable-diffusion-v1/sd-v1-4.ckpt

sd_coco-s75_sample1024_allst.pt is from q-diffusion repo

hatchetProject commented 4 months ago

Hi, thank you for pointing this out. I have updated qdiff/quant_block.py and you can use the new file now. Currently there are some leftover issues in the code that were used for debugging. We will clean them up and reorganize the code as soon as possible.

hatchetProject commented 4 months ago

I updated some files in the repo (please refer to them according to update time, in the main folder and the qdiff folder), you can update your code according to them.