| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b5c2050 commit 4af76d0
17 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ jobs: | |||
| 23 | 23 | runs-on: | |
| 24 | 24 | group: aws-g6-4xlarge-plus | |
| 25 | 25 | container: | |
| 26 | - image: diffusers/diffusers-pytorch-compile-cuda | ||
| 26 | + image: diffusers/diffusers-pytorch-cuda | ||
| 27 | 27 | options: --shm-size "16gb" --ipc host --gpus 0 | |
| 28 | 28 | steps: | |
| 29 | 29 | - name: Checkout diffusers | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,6 +41,12 @@ jobs: | |||
| 41 | 41 | run: | | |
| 42 | 42 | CHANGED_FILES="${{ steps.file_changes.outputs.all }}" | |
| 43 | 43 | for FILE in $CHANGED_FILES; do | |
| 44 | + # skip anything that isn’t still on disk | ||
| 45 | + if [[ ! -f "$FILE" ]]; then | ||
| 46 | + echo "Skipping removed file $FILE" | ||
| 47 | + continue | ||
| 48 | + fi | ||
| 49 | + | ||
| 44 | 50 | if [[ "$FILE" == docker/*Dockerfile ]]; then | |
| 45 | 51 | DOCKER_PATH="${FILE%/Dockerfile}" | |
| 46 | 52 | DOCKER_TAG=$(basename "$DOCKER_PATH") | |
@@ -65,7 +71,7 @@ jobs: | |||
| 65 | 71 | image-name: | |
| 66 | 72 | - diffusers-pytorch-cpu | |
| 67 | 73 | - diffusers-pytorch-cuda | |
| 68 | - - diffusers-pytorch-compile-cuda | ||
| 74 | + - diffusers-pytorch-cuda | ||
| 69 | 75 | - diffusers-pytorch-xformers-cuda | |
| 70 | 76 | - diffusers-pytorch-minimum-cuda | |
| 71 | 77 | - diffusers-flax-cpu | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -188,7 +188,7 @@ jobs: | |||
| 188 | 188 | group: aws-g4dn-2xlarge | |
| 189 | 189 | ||
| 190 | 190 | container: | |
| 191 | - image: diffusers/diffusers-pytorch-compile-cuda | ||
| 191 | + image: diffusers/diffusers-pytorch-cuda | ||
| 192 | 192 | options: --gpus 0 --shm-size "16gb" --ipc host | |
| 193 | 193 | ||
| 194 | 194 | steps: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -262,7 +262,7 @@ jobs: | |||
| 262 | 262 | group: aws-g4dn-2xlarge | |
| 263 | 263 | ||
| 264 | 264 | container: | |
| 265 | - image: diffusers/diffusers-pytorch-compile-cuda | ||
| 265 | + image: diffusers/diffusers-pytorch-cuda | ||
| 266 | 266 | options: --gpus 0 --shm-size "16gb" --ipc host | |
| 267 | 267 | ||
| 268 | 268 | steps: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -316,7 +316,7 @@ jobs: | |||
| 316 | 316 | group: aws-g4dn-2xlarge | |
| 317 | 317 | ||
| 318 | 318 | container: | |
| 319 | - image: diffusers/diffusers-pytorch-compile-cuda | ||
| 319 | + image: diffusers/diffusers-pytorch-cuda | ||
| 320 | 320 | options: --gpus 0 --shm-size "16gb" --ipc host | |
| 321 | 321 | ||
| 322 | 322 | steps: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1748,14 +1748,14 @@ class TorchCompileTesterMixin: | |||
| 1748 | 1748 | def setUp(self): | |
| 1749 | 1749 | # clean up the VRAM before each test | |
| 1750 | 1750 | super().setUp() | |
| 1751 | - torch._dynamo.reset() | ||
| 1751 | + torch.compiler.reset() | ||
| 1752 | 1752 | gc.collect() | |
| 1753 | 1753 | backend_empty_cache(torch_device) | |
| 1754 | 1754 | ||
| 1755 | 1755 | def tearDown(self): | |
| 1756 | 1756 | # clean up the VRAM after each test in case of CUDA runtime errors | |
| 1757 | 1757 | super().tearDown() | |
| 1758 | - torch._dynamo.reset() | ||
| 1758 | + torch.compiler.reset() | ||
| 1759 | 1759 | gc.collect() | |
| 1760 | 1760 | backend_empty_cache(torch_device) | |
| 1761 | 1761 | ||
@@ -1764,13 +1764,17 @@ def tearDown(self): | |||
| 1764 | 1764 | @is_torch_compile | |
| 1765 | 1765 | @slow | |
| 1766 | 1766 | def test_torch_compile_recompilation_and_graph_break(self): | |
| 1767 | - torch._dynamo.reset() | ||
| 1767 | + torch.compiler.reset() | ||
| 1768 | 1768 | init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common() | |
| 1769 | 1769 | ||
| 1770 | 1770 | model = self.model_class(**init_dict).to(torch_device) | |
| 1771 | 1771 | model = torch.compile(model, fullgraph=True) | |
| 1772 | 1772 | ||
| 1773 | - with torch._dynamo.config.patch(error_on_recompile=True), torch.no_grad(): | ||
| 1773 | + with ( | ||
| 1774 | + torch._inductor.utils.fresh_inductor_cache(), | ||
| 1775 | + torch._dynamo.config.patch(error_on_recompile=True), | ||
| 1776 | + torch.no_grad(), | ||
| 1777 | + ): | ||
| 1774 | 1778 | _ = model(**inputs_dict) | |
| 1775 | 1779 | _ = model(**inputs_dict) | |
| 1776 | 1780 | ||
@@ -1798,7 +1802,7 @@ def tearDown(self): | |||
| 1798 | 1802 | # It is critical that the dynamo cache is reset for each test. Otherwise, if the test re-uses the same model, | |
| 1799 | 1803 | # there will be recompilation errors, as torch caches the model when run in the same process. | |
| 1800 | 1804 | super().tearDown() | |
| 1801 | - torch._dynamo.reset() | ||
| 1805 | + torch.compiler.reset() | ||
| 1802 | 1806 | gc.collect() | |
| 1803 | 1807 | backend_empty_cache(torch_device) | |
| 1804 | 1808 | ||
@@ -1915,7 +1919,7 @@ def test_hotswapping_model(self, rank0, rank1): | |||
| 1915 | 1919 | def test_hotswapping_compiled_model_linear(self, rank0, rank1): | |
| 1916 | 1920 | # It's important to add this context to raise an error on recompilation | |
| 1917 | 1921 | target_modules = ["to_q", "to_k", "to_v", "to_out.0"] | |
| 1918 | - with torch._dynamo.config.patch(error_on_recompile=True): | ||
| 1922 | + with torch._dynamo.config.patch(error_on_recompile=True), torch._inductor.utils.fresh_inductor_cache(): | ||
| 1919 | 1923 | self.check_model_hotswap(do_compile=True, rank0=rank0, rank1=rank1, target_modules0=target_modules) | |
| 1920 | 1924 | ||
| 1921 | 1925 | @parameterized.expand([(11, 11), (7, 13), (13, 7)]) # important to test small to large and vice versa | |
@@ -1925,7 +1929,7 @@ def test_hotswapping_compiled_model_conv2d(self, rank0, rank1): | |||
| 1925 | 1929 | ||
| 1926 | 1930 | # It's important to add this context to raise an error on recompilation | |
| 1927 | 1931 | target_modules = ["conv", "conv1", "conv2"] | |
| 1928 | - with torch._dynamo.config.patch(error_on_recompile=True): | ||
| 1932 | + with torch._dynamo.config.patch(error_on_recompile=True), torch._inductor.utils.fresh_inductor_cache(): | ||
| 1929 | 1933 | self.check_model_hotswap(do_compile=True, rank0=rank0, rank1=rank1, target_modules0=target_modules) | |
| 1930 | 1934 | ||
| 1931 | 1935 | @parameterized.expand([(11, 11), (7, 13), (13, 7)]) # important to test small to large and vice versa | |
@@ -1935,7 +1939,7 @@ def test_hotswapping_compiled_model_both_linear_and_conv2d(self, rank0, rank1): | |||
| 1935 | 1939 | ||
| 1936 | 1940 | # It's important to add this context to raise an error on recompilation | |
| 1937 | 1941 | target_modules = ["to_q", "conv"] | |
| 1938 | - with torch._dynamo.config.patch(error_on_recompile=True): | ||
| 1942 | + with torch._dynamo.config.patch(error_on_recompile=True), torch._inductor.utils.fresh_inductor_cache(): | ||
| 1939 | 1943 | self.check_model_hotswap(do_compile=True, rank0=rank0, rank1=rank1, target_modules0=target_modules) | |
| 1940 | 1944 | ||
| 1941 | 1945 | @parameterized.expand([(11, 11), (7, 13), (13, 7)]) # important to test small to large and vice versa | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,20 +19,16 @@ | |||
| 19 | 19 | from diffusers import HunyuanVideoTransformer3DModel | |
| 20 | 20 | from diffusers.utils.testing_utils import ( | |
| 21 | 21 | enable_full_determinism, | |
| 22 | - is_torch_compile, | ||
| 23 | - require_torch_2, | ||
| 24 | - require_torch_gpu, | ||
| 25 | - slow, | ||
| 26 | 22 | torch_device, | |
| 27 | 23 | ) | |
| 28 | 24 | ||
| 29 | - from ..test_modeling_common import ModelTesterMixin | ||
| 25 | + from ..test_modeling_common import ModelTesterMixin, TorchCompileTesterMixin | ||
| 30 | 26 | ||
| 31 | 27 | ||
| 32 | 28 | enable_full_determinism() | |
| 33 | 29 | ||
| 34 | 30 | ||
| 35 | - class HunyuanVideoTransformer3DTests(ModelTesterMixin, unittest.TestCase): | ||
| 31 | + class HunyuanVideoTransformer3DTests(ModelTesterMixin, TorchCompileTesterMixin, unittest.TestCase): | ||
| 36 | 32 | model_class = HunyuanVideoTransformer3DModel | |
| 37 | 33 | main_input_name = "hidden_states" | |
| 38 | 34 | uses_custom_attn_processor = True | |
@@ -96,23 +92,8 @@ def test_gradient_checkpointing_is_applied(self): | |||
| 96 | 92 | expected_set = {"HunyuanVideoTransformer3DModel"} | |
| 97 | 93 | super().test_gradient_checkpointing_is_applied(expected_set=expected_set) | |
| 98 | 94 | ||
| 99 | - @require_torch_gpu | ||
| 100 | - @require_torch_2 | ||
| 101 | - @is_torch_compile | ||
| 102 | - @slow | ||
| 103 | - def test_torch_compile_recompilation_and_graph_break(self): | ||
| 104 | - torch._dynamo.reset() | ||
| 105 | - init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common() | ||
| 106 | 95 | ||
| 107 | - model = self.model_class(**init_dict).to(torch_device) | ||
| 108 | - model = torch.compile(model, fullgraph=True) | ||
| 109 | - | ||
| 110 | - with torch._dynamo.config.patch(error_on_recompile=True), torch.no_grad(): | ||
| 111 | - _ = model(**inputs_dict) | ||
| 112 | - _ = model(**inputs_dict) | ||
| 113 | - | ||
| 114 | - | ||
| 115 | - class HunyuanSkyreelsImageToVideoTransformer3DTests(ModelTesterMixin, unittest.TestCase): | ||
| 96 | + class HunyuanSkyreelsImageToVideoTransformer3DTests(ModelTesterMixin, TorchCompileTesterMixin, unittest.TestCase): | ||
| 116 | 97 | model_class = HunyuanVideoTransformer3DModel | |
| 117 | 98 | main_input_name = "hidden_states" | |
| 118 | 99 | uses_custom_attn_processor = True | |
@@ -179,23 +160,8 @@ def test_gradient_checkpointing_is_applied(self): | |||
| 179 | 160 | expected_set = {"HunyuanVideoTransformer3DModel"} | |
| 180 | 161 | super().test_gradient_checkpointing_is_applied(expected_set=expected_set) | |
| 181 | 162 | ||
| 182 | - @require_torch_gpu | ||
| 183 | - @require_torch_2 | ||
| 184 | - @is_torch_compile | ||
| 185 | - @slow | ||
| 186 | - def test_torch_compile_recompilation_and_graph_break(self): | ||
| 187 | - torch._dynamo.reset() | ||
| 188 | - init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common() | ||
| 189 | - | ||
| 190 | - model = self.model_class(**init_dict).to(torch_device) | ||
| 191 | - model = torch.compile(model, fullgraph=True) | ||
| 192 | - | ||
| 193 | - with torch._dynamo.config.patch(error_on_recompile=True), torch.no_grad(): | ||
| 194 | - _ = model(**inputs_dict) | ||
| 195 | - _ = model(**inputs_dict) | ||
| 196 | - | ||
| 197 | 163 | ||
| 198 | - class HunyuanVideoImageToVideoTransformer3DTests(ModelTesterMixin, unittest.TestCase): | ||
| 164 | + class HunyuanVideoImageToVideoTransformer3DTests(ModelTesterMixin, TorchCompileTesterMixin, unittest.TestCase): | ||
| 199 | 165 | model_class = HunyuanVideoTransformer3DModel | |
| 200 | 166 | main_input_name = "hidden_states" | |
| 201 | 167 | uses_custom_attn_processor = True | |
@@ -260,23 +226,10 @@ def test_gradient_checkpointing_is_applied(self): | |||
| 260 | 226 | expected_set = {"HunyuanVideoTransformer3DModel"} | |
| 261 | 227 | super().test_gradient_checkpointing_is_applied(expected_set=expected_set) | |
| 262 | 228 | ||
| 263 | - @require_torch_gpu | ||
| 264 | - @require_torch_2 | ||
| 265 | - @is_torch_compile | ||
| 266 | - @slow | ||
| 267 | - def test_torch_compile_recompilation_and_graph_break(self): | ||
| 268 | - torch._dynamo.reset() | ||
| 269 | - init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common() | ||
| 270 | 229 | ||
| 271 | - model = self.model_class(**init_dict).to(torch_device) | ||
| 272 | - model = torch.compile(model, fullgraph=True) | ||
| 273 | - | ||
| 274 | - with torch._dynamo.config.patch(error_on_recompile=True), torch.no_grad(): | ||
| 275 | - _ = model(**inputs_dict) | ||
| 276 | - _ = model(**inputs_dict) | ||
| 277 | - | ||
| 278 | - | ||
| 279 | - class HunyuanVideoTokenReplaceImageToVideoTransformer3DTests(ModelTesterMixin, unittest.TestCase): | ||
| 230 | + class HunyuanVideoTokenReplaceImageToVideoTransformer3DTests( | ||
| 231 | + ModelTesterMixin, TorchCompileTesterMixin, unittest.TestCase | ||
| 232 | + ): | ||
| 280 | 233 | model_class = HunyuanVideoTransformer3DModel | |
| 281 | 234 | main_input_name = "hidden_states" | |
| 282 | 235 | uses_custom_attn_processor = True | |
@@ -342,18 +295,3 @@ def test_output(self): | |||
| 342 | 295 | def test_gradient_checkpointing_is_applied(self): | |
| 343 | 296 | expected_set = {"HunyuanVideoTransformer3DModel"} | |
| 344 | 297 | super().test_gradient_checkpointing_is_applied(expected_set=expected_set) | |
| 345 | - | ||
| 346 | - @require_torch_gpu | ||
| 347 | - @require_torch_2 | ||
| 348 | - @is_torch_compile | ||
| 349 | - @slow | ||
| 350 | - def test_torch_compile_recompilation_and_graph_break(self): | ||
| 351 | - torch._dynamo.reset() | ||
| 352 | - init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common() | ||
| 353 | - | ||
| 354 | - model = self.model_class(**init_dict).to(torch_device) | ||
| 355 | - model = torch.compile(model, fullgraph=True) | ||
| 356 | - | ||
| 357 | - with torch._dynamo.config.patch(error_on_recompile=True), torch.no_grad(): | ||
| 358 | - _ = model(**inputs_dict) | ||
| 359 | - _ = model(**inputs_dict) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,20 +19,16 @@ | |||
| 19 | 19 | from diffusers import WanTransformer3DModel | |
| 20 | 20 | from diffusers.utils.testing_utils import ( | |
| 21 | 21 | enable_full_determinism, | |
| 22 | - is_torch_compile, | ||
| 23 | - require_torch_2, | ||
| 24 | - require_torch_gpu, | ||
| 25 | - slow, | ||
| 26 | 22 | torch_device, | |
| 27 | 23 | ) | |
| 28 | 24 | ||
| 29 | - from ..test_modeling_common import ModelTesterMixin | ||
| 25 | + from ..test_modeling_common import ModelTesterMixin, TorchCompileTesterMixin | ||
| 30 | 26 | ||
| 31 | 27 | ||
| 32 | 28 | enable_full_determinism() | |
| 33 | 29 | ||
| 34 | 30 | ||
| 35 | - class WanTransformer3DTests(ModelTesterMixin, unittest.TestCase): | ||
| 31 | + class WanTransformer3DTests(ModelTesterMixin, TorchCompileTesterMixin, unittest.TestCase): | ||
| 36 | 32 | model_class = WanTransformer3DModel | |
| 37 | 33 | main_input_name = "hidden_states" | |
| 38 | 34 | uses_custom_attn_processor = True | |
@@ -86,18 +82,3 @@ def prepare_init_args_and_inputs_for_common(self): | |||
| 86 | 82 | def test_gradient_checkpointing_is_applied(self): | |
| 87 | 83 | expected_set = {"WanTransformer3DModel"} | |
| 88 | 84 | super().test_gradient_checkpointing_is_applied(expected_set=expected_set) | |
| 89 | - | ||
| 90 | - @require_torch_gpu | ||
| 91 | - @require_torch_2 | ||
| 92 | - @is_torch_compile | ||
| 93 | - @slow | ||
| 94 | - def test_torch_compile_recompilation_and_graph_break(self): | ||
| 95 | - torch._dynamo.reset() | ||
| 96 | - init_dict, inputs_dict = self.prepare_init_args_and_inputs_for_common() | ||
| 97 | - | ||
| 98 | - model = self.model_class(**init_dict).to(torch_device) | ||
| 99 | - model = torch.compile(model, fullgraph=True) | ||
| 100 | - | ||
| 101 | - with torch._dynamo.config.patch(error_on_recompile=True), torch.no_grad(): | ||
| 102 | - _ = model(**inputs_dict) | ||
| 103 | - _ = model(**inputs_dict) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments