You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/en/quantization/overview.md
+59Lines changed: 59 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -39,3 +39,62 @@ Diffusers currently supports the following quantization methods.
39
39
-[Quanto](./quanto.md)
40
40
41
41
[This resource](https://huggingface.co/docs/transformers/main/en/quantization/overview#when-to-use-what) provides a good overview of the pros and cons of different quantization techniques.
42
+
43
+
## Pipeline-level quantization
44
+
45
+
Diffusers allows users to directly initialize pipelines from checkpoints that may contain quantized models([example](https://huggingface.co/hf-internal-testing/flux.1-dev-nf4-pkg)). However, users may want to apply
46
+
quantization on-the-fly when initializing a pipeline from a pre-trained and non-quantized checkpoint. You can
47
+
do this with [`PipelineQuantizationConfig`].
48
+
49
+
Start by defining a `PipelineQuantizationConfig`:
50
+
51
+
```py
52
+
import torch
53
+
from diffusers import DiffusionPipeline
54
+
from diffusers.quantizers.quantization_config import QuantoConfig
55
+
from diffusers.quantizers import PipelineQuantizationConfig
0 commit comments