Compare commits

...

16 Commits

Author SHA1 Message Date
Sayak Paul
0d6bddec0a Merge branch 'main' into gguf-compile-offload 2025-07-09 13:27:23 +05:30
Sayak Paul
e45dfebcca Merge branch 'main' into gguf-compile-offload 2025-07-09 13:11:39 +05:30
Sayak Paul
8ca075dc50 Merge branch 'main' into gguf-compile-offload 2025-07-09 12:28:40 +05:30
sayakpaul
7b41172d7d change to flux. 2025-07-09 12:28:21 +05:30
Sayak Paul
b09b888857 Merge branch 'main' into gguf-compile-offload 2025-07-09 11:00:49 +05:30
Sayak Paul
596014c240 Merge branch 'main' into gguf-compile-offload 2025-07-08 07:47:23 +05:30
Sayak Paul
c190e3f4cf Merge branch 'main' into gguf-compile-offload 2025-07-07 20:32:44 +05:30
sayakpaul
1cde06c70b updaye 2025-07-02 11:36:40 +05:30
sayakpaul
cc0a55a0f8 prop. 2025-06-28 11:08:31 +05:30
Sayak Paul
43e14d798c Merge branch 'main' into gguf-compile-offload 2025-06-28 10:56:10 +05:30
Sayak Paul
abcfb4776f Merge branch 'main' into gguf-compile-offload 2025-06-27 18:20:49 +05:30
Sayak Paul
38bb1be033 Merge branch 'main' into gguf-compile-offload 2025-06-23 18:27:57 +05:30
Dhruv Nair
c120032a4b Merge branch 'main' into gguf-compile-offload 2025-06-19 07:44:32 +02:00
sayakpaul
4278107aae add init. 2025-06-18 12:27:40 +05:30
sayakpaul
a67e16e380 quality 2025-06-18 12:20:56 +05:30
sayakpaul
e8a3eec04f add compile + offload tests for GGUF. 2025-06-18 12:18:50 +05:30
2 changed files with 32 additions and 0 deletions

View File

View File

@@ -8,6 +8,7 @@ import torch.nn as nn
from diffusers import (
AuraFlowPipeline,
AuraFlowTransformer2DModel,
DiffusionPipeline,
FluxControlPipeline,
FluxPipeline,
FluxTransformer2DModel,
@@ -32,9 +33,12 @@ from diffusers.utils.testing_utils import (
require_big_accelerator,
require_gguf_version_greater_or_equal,
require_peft_backend,
require_torch_version_greater,
torch_device,
)
from ..test_torch_compile_utils import QuantCompileTests
if is_gguf_available():
from diffusers.quantizers.gguf.utils import GGUFLinear, GGUFParameter
@@ -647,3 +651,31 @@ class WanVACEGGUFSingleFileTests(GGUFSingleFileTesterMixin, unittest.TestCase):
).to(torch_device, self.torch_dtype),
"timestep": torch.tensor([1]).to(torch_device, self.torch_dtype),
}
@require_torch_version_greater("2.7.1")
class GGUFCompileTests(QuantCompileTests):
torch_dtype = torch.bfloat16
gguf_ckpt = "https://huggingface.co/city96/FLUX.1-dev-gguf/blob/main/flux1-dev-Q2_K.gguf"
@property
def quantization_config(self):
return GGUFQuantizationConfig(compute_dtype=self.torch_dtype)
def test_torch_compile(self):
super()._test_torch_compile(quantization_config=self.quantization_config)
def test_torch_compile_with_cpu_offload(self):
super()._test_torch_compile_with_cpu_offload(quantization_config=self.quantization_config)
def test_torch_compile_with_group_offload_leaf(self):
super()._test_torch_compile_with_group_offload_leaf(quantization_config=self.quantization_config)
def _init_pipeline(self, *args, **kwargs):
transformer = FluxTransformer2DModel.from_single_file(
self.gguf_ckpt, quantization_config=self.quantization_config, torch_dtype=self.torch_dtype
)
pipe = DiffusionPipeline.from_pretrained(
"black-forest-labs/FLUX.1-dev", transformer=transformer, torch_dtype=self.torch_dtype
)
return pipe