Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,46 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
```shell
|
| 7 |
pip install -i https://pypi.org/simple/ mixdq-extension --upgrade
|
| 8 |
```
|
|
@@ -47,7 +85,10 @@ run the pipeline:
|
|
| 47 |
image.save('mixdq_pipeline.png')
|
| 48 |
```
|
| 49 |
|
|
|
|
|
|
|
| 50 |
Performance tested on NVIDIA 4080:
|
|
|
|
| 51 |
| UNet Latency (ms) | No CUDA Graph | With CUDA Graph |
|
| 52 |
|-------------------|---------------|-----------------|
|
| 53 |
| FP16 version | 44.6 | 36.1 |
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
pipeline_tag: text-to-image
|
| 4 |
+
tags:
|
| 5 |
+
- diffusion
|
| 6 |
+
- efficient
|
| 7 |
+
- quantization
|
| 8 |
+
- Diffusers
|
| 9 |
+
- StableDiffusionXLPipeline
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# MixDQ Model Card
|
| 13 |
+
|
| 14 |
+
## Model Description
|
| 15 |
+
|
| 16 |
+
MixDQ is a mixed precision quantization methods that compress the memory and computational usage of text-to-image diffusion models while preserving genration quality.
|
| 17 |
+
It supports few-step diffusion models (e.g., SDXL-turbo, LCM-lora) to construct both fast and tiny diffusion models. Efficient CUDA kernel implemention is provided for practical resource savings.
|
| 18 |
+
|
| 19 |
+
<img src="https://github.com/A-suozhang/MyPicBed/raw/master/img/mixdq_model_card_0.jpg" width="600">
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
## Model Sources
|
| 23 |
+
|
| 24 |
+
for more information, please refer to:
|
| 25 |
+
|
| 26 |
+
- Project Page: [https://a-suozhang.xyz/mixdq.github.io/](https://a-suozhang.xyz/mixdq.github.io/).
|
| 27 |
+
- Arxiv paper: [https://arxiv.org/abs/2405.17873](https://arxiv.org/abs/2405.17873)
|
| 28 |
+
- Github Repository: [https://github.com/A-suozhang/MixDQ](https://github.com/A-suozhang/MixDQ)
|
| 29 |
+
|
| 30 |
+
## Evaluation
|
| 31 |
+
|
| 32 |
+
We evaluate the MixDQ model using various metrics, including FID (fidelity), CLIPScore (image-text alignment), and ImageReward (human preference). MixDQ can achieve W8A8 quantization without performance loss. The differences between images generated by MixDQ and those generated by FP16 models are negligible.
|
| 33 |
+
|
| 34 |
+
| Method | FID (↓) | ClipScore | ImageReward |
|
| 35 |
+
|------------|---------|-----------|-------------|
|
| 36 |
+
| FP16 | 17.15 | 0.2722 | 0.8631 |
|
| 37 |
+
| MixDQ-W8A8 | 17.03 | 0.2703 | 0.8415 |
|
| 38 |
+
| MixDQ-W5A8 | 17.23 | 0.2697 | 0.8307 |
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
install the prerequisite for Mixdq:
|
| 44 |
```shell
|
| 45 |
pip install -i https://pypi.org/simple/ mixdq-extension --upgrade
|
| 46 |
```
|
|
|
|
| 85 |
image.save('mixdq_pipeline.png')
|
| 86 |
```
|
| 87 |
|
| 88 |
+
|
| 89 |
+
|
| 90 |
Performance tested on NVIDIA 4080:
|
| 91 |
+
|
| 92 |
| UNet Latency (ms) | No CUDA Graph | With CUDA Graph |
|
| 93 |
|-------------------|---------------|-----------------|
|
| 94 |
| FP16 version | 44.6 | 36.1 |
|