Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 936e6192b1 | |||
| 6a478569f0 | |||
| 719d0ce7a7 | |||
| be16b1bcdf |
@@ -64,18 +64,38 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install .[quality]
|
pip install .[quality]
|
||||||
|
|
||||||
- name: Download Makefile from main branch
|
- name: Download necessary files from main branch of Diffusers
|
||||||
run: |
|
run: |
|
||||||
curl -o main_Makefile https://raw.githubusercontent.com/huggingface/diffusers/main/Makefile
|
curl -o main_Makefile https://raw.githubusercontent.com/huggingface/diffusers/main/Makefile
|
||||||
|
curl -o main_setup.py https://raw.githubusercontent.com/huggingface/diffusers/refs/heads/main/setup.py
|
||||||
|
curl -o main_check_doc_toc.py https://raw.githubusercontent.com/huggingface/diffusers/refs/heads/main/utils/check_doc_toc.py
|
||||||
|
|
||||||
- name: Compare Makefiles
|
- name: Compare the files and raise error if needed
|
||||||
run: |
|
run: |
|
||||||
|
diff_failed=0
|
||||||
|
|
||||||
if ! diff -q main_Makefile Makefile; then
|
if ! diff -q main_Makefile Makefile; then
|
||||||
echo "Error: The Makefile has changed. Please ensure it matches the main branch."
|
echo "Error: The Makefile has changed. Please ensure it matches the main branch."
|
||||||
|
diff_failed=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! diff -q main_setup.py setup.py; then
|
||||||
|
echo "Error: The setup.py has changed. Please ensure it matches the main branch."
|
||||||
|
diff_failed=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! diff -q main_check_doc_toc.py utils/check_doc_toc.py; then
|
||||||
|
echo "Error: The utils/check_doc_toc.py has changed. Please ensure it matches the main branch."
|
||||||
|
diff_failed=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $diff_failed -eq 1 ]; then
|
||||||
|
echo "❌ Error happened as we detected changes in the files that should not be changed ❌"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "No changes in Makefile. Proceeding..."
|
|
||||||
rm -rf main_Makefile
|
echo "No changes in the files. Proceeding..."
|
||||||
|
rm -rf main_Makefile main_setup.py main_check_doc_toc.py
|
||||||
|
|
||||||
- name: Run make style and make quality
|
- name: Run make style and make quality
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ on:
|
|||||||
- "src/diffusers/loaders/lora_base.py"
|
- "src/diffusers/loaders/lora_base.py"
|
||||||
- "src/diffusers/loaders/lora_pipeline.py"
|
- "src/diffusers/loaders/lora_pipeline.py"
|
||||||
- "src/diffusers/loaders/peft.py"
|
- "src/diffusers/loaders/peft.py"
|
||||||
- "tests/pipelines/test_pipelines_common.py"
|
|
||||||
- "tests/models/test_modeling_common.py"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|||||||
@@ -1169,16 +1169,17 @@ class ModelTesterMixin:
|
|||||||
base_output = model(**inputs_dict)
|
base_output = model(**inputs_dict)
|
||||||
|
|
||||||
model_size = compute_module_sizes(model)[""]
|
model_size = compute_module_sizes(model)[""]
|
||||||
max_size = int(self.model_split_percents[0] * model_size)
|
|
||||||
# Force disk offload by setting very small CPU memory
|
|
||||||
max_memory = {0: max_size, "cpu": int(0.1 * max_size)}
|
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||||
model.cpu().save_pretrained(tmp_dir, safe_serialization=False)
|
model.cpu().save_pretrained(tmp_dir, safe_serialization=False)
|
||||||
|
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
|
max_size = int(self.model_split_percents[0] * model_size)
|
||||||
|
max_memory = {0: max_size, "cpu": max_size}
|
||||||
# This errors out because it's missing an offload folder
|
# This errors out because it's missing an offload folder
|
||||||
new_model = self.model_class.from_pretrained(tmp_dir, device_map="auto", max_memory=max_memory)
|
new_model = self.model_class.from_pretrained(tmp_dir, device_map="auto", max_memory=max_memory)
|
||||||
|
|
||||||
|
max_size = int(self.model_split_percents[0] * model_size)
|
||||||
|
max_memory = {0: max_size, "cpu": max_size}
|
||||||
new_model = self.model_class.from_pretrained(
|
new_model = self.model_class.from_pretrained(
|
||||||
tmp_dir, device_map="auto", max_memory=max_memory, offload_folder=tmp_dir
|
tmp_dir, device_map="auto", max_memory=max_memory, offload_folder=tmp_dir
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class OmniGenTransformerTests(ModelTesterMixin, unittest.TestCase):
|
|||||||
model_class = OmniGenTransformer2DModel
|
model_class = OmniGenTransformer2DModel
|
||||||
main_input_name = "hidden_states"
|
main_input_name = "hidden_states"
|
||||||
uses_custom_attn_processor = True
|
uses_custom_attn_processor = True
|
||||||
model_split_percents = [0.1, 0.1, 0.1]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dummy_input(self):
|
def dummy_input(self):
|
||||||
@@ -74,9 +73,9 @@ class OmniGenTransformerTests(ModelTesterMixin, unittest.TestCase):
|
|||||||
"num_attention_heads": 4,
|
"num_attention_heads": 4,
|
||||||
"num_key_value_heads": 4,
|
"num_key_value_heads": 4,
|
||||||
"intermediate_size": 32,
|
"intermediate_size": 32,
|
||||||
"num_layers": 20,
|
"num_layers": 1,
|
||||||
"pad_token_id": 0,
|
"pad_token_id": 0,
|
||||||
"vocab_size": 1000,
|
"vocab_size": 100,
|
||||||
"in_channels": 4,
|
"in_channels": 4,
|
||||||
"time_step_dim": 4,
|
"time_step_dim": 4,
|
||||||
"rope_scaling": {"long_factor": list(range(1, 3)), "short_factor": list(range(1, 3))},
|
"rope_scaling": {"long_factor": list(range(1, 3)), "short_factor": list(range(1, 3))},
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ enable_full_determinism()
|
|||||||
class SD3TransformerTests(ModelTesterMixin, unittest.TestCase):
|
class SD3TransformerTests(ModelTesterMixin, unittest.TestCase):
|
||||||
model_class = SD3Transformer2DModel
|
model_class = SD3Transformer2DModel
|
||||||
main_input_name = "hidden_states"
|
main_input_name = "hidden_states"
|
||||||
model_split_percents = [0.8, 0.8, 0.9]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dummy_input(self):
|
def dummy_input(self):
|
||||||
@@ -68,7 +67,7 @@ class SD3TransformerTests(ModelTesterMixin, unittest.TestCase):
|
|||||||
"sample_size": 32,
|
"sample_size": 32,
|
||||||
"patch_size": 1,
|
"patch_size": 1,
|
||||||
"in_channels": 4,
|
"in_channels": 4,
|
||||||
"num_layers": 4,
|
"num_layers": 1,
|
||||||
"attention_head_dim": 8,
|
"attention_head_dim": 8,
|
||||||
"num_attention_heads": 4,
|
"num_attention_heads": 4,
|
||||||
"caption_projection_dim": 32,
|
"caption_projection_dim": 32,
|
||||||
@@ -108,7 +107,6 @@ class SD3TransformerTests(ModelTesterMixin, unittest.TestCase):
|
|||||||
class SD35TransformerTests(ModelTesterMixin, unittest.TestCase):
|
class SD35TransformerTests(ModelTesterMixin, unittest.TestCase):
|
||||||
model_class = SD3Transformer2DModel
|
model_class = SD3Transformer2DModel
|
||||||
main_input_name = "hidden_states"
|
main_input_name = "hidden_states"
|
||||||
model_split_percents = [0.8, 0.8, 0.9]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dummy_input(self):
|
def dummy_input(self):
|
||||||
@@ -143,7 +141,7 @@ class SD35TransformerTests(ModelTesterMixin, unittest.TestCase):
|
|||||||
"sample_size": 32,
|
"sample_size": 32,
|
||||||
"patch_size": 1,
|
"patch_size": 1,
|
||||||
"in_channels": 4,
|
"in_channels": 4,
|
||||||
"num_layers": 4,
|
"num_layers": 2,
|
||||||
"attention_head_dim": 8,
|
"attention_head_dim": 8,
|
||||||
"num_attention_heads": 4,
|
"num_attention_heads": 4,
|
||||||
"caption_projection_dim": 32,
|
"caption_projection_dim": 32,
|
||||||
|
|||||||
Reference in New Issue
Block a user