Update src/pipeline.py
Browse files- src/pipeline.py +2 -2
src/pipeline.py
CHANGED
|
@@ -12,7 +12,7 @@ from pipelines.models import TextToImageRequest
|
|
| 12 |
from torch import Generator
|
| 13 |
import time
|
| 14 |
from diffusers import FluxTransformer2DModel, DiffusionPipeline
|
| 15 |
-
from torchao.quantization import quantize_, PerRow,
|
| 16 |
import os
|
| 17 |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:False,garbage_collection_threshold:0.01"
|
| 18 |
Pipeline = None
|
|
@@ -39,7 +39,7 @@ def load_pipeline() -> Pipeline:
|
|
| 39 |
text_encoder_2 = text_encoder_2,
|
| 40 |
torch_dtype=dtype,
|
| 41 |
)
|
| 42 |
-
quantize_(pipeline.transformer, float8_dynamic_activation_float8_weight(
|
| 43 |
torch.backends.cudnn.benchmark = True
|
| 44 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 45 |
torch.cuda.set_per_process_memory_fraction(0.99)
|
|
|
|
| 12 |
from torch import Generator
|
| 13 |
import time
|
| 14 |
from diffusers import FluxTransformer2DModel, DiffusionPipeline
|
| 15 |
+
from torchao.quantization import quantize_, float8_dynamic_activation_float8_weight #PerRow,
|
| 16 |
import os
|
| 17 |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:False,garbage_collection_threshold:0.01"
|
| 18 |
Pipeline = None
|
|
|
|
| 39 |
text_encoder_2 = text_encoder_2,
|
| 40 |
torch_dtype=dtype,
|
| 41 |
)
|
| 42 |
+
quantize_(pipeline.transformer, float8_dynamic_activation_float8_weight())
|
| 43 |
torch.backends.cudnn.benchmark = True
|
| 44 |
torch.backends.cuda.matmul.allow_tf32 = True
|
| 45 |
torch.cuda.set_per_process_memory_fraction(0.99)
|