From e19b7b975f150d10e32b445d69dfc1d37d89aaf7 Mon Sep 17 00:00:00 2001 From: anton- Date: Wed, 7 Dec 2022 12:01:55 +0100 Subject: [PATCH 1/2] Fix common tests for FP16 --- .github/workflows/push_tests.yml | 5 ++++- tests/pipelines/ddim/test_ddim.py | 1 + tests/test_pipelines_common.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index ad1821621ffb..2ef6fdb48619 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main env: DIFFUSERS_IS_CI: yes @@ -74,7 +77,7 @@ jobs: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ - -s -v -k "not Flax and not Onnx" \ + -s -v -k "StableDiffusion" \ --make-reports=tests_${{ matrix.config.report }} \ tests/ diff --git a/tests/pipelines/ddim/test_ddim.py b/tests/pipelines/ddim/test_ddim.py index 26ea10caeabd..df721efcf46b 100644 --- a/tests/pipelines/ddim/test_ddim.py +++ b/tests/pipelines/ddim/test_ddim.py @@ -29,6 +29,7 @@ class DDIMPipelineFastTests(PipelineTesterMixin, unittest.TestCase): pipeline_class = DDIMPipeline + test_cpu_offload = False def get_dummy_components(self): torch.manual_seed(0) diff --git a/tests/test_pipelines_common.py b/tests/test_pipelines_common.py index 6565a52c2a6c..af5dd6a403f1 100644 --- a/tests/test_pipelines_common.py +++ b/tests/test_pipelines_common.py @@ -190,7 +190,7 @@ def test_save_load_float16(self): with tempfile.TemporaryDirectory() as tmpdir: pipe.save_pretrained(tmpdir) - pipe_loaded = self.pipeline_class.from_pretrained(tmpdir) + pipe_loaded = self.pipeline_class.from_pretrained(tmpdir, torch_dtype=torch.float16) pipe_loaded.to(torch_device) pipe_loaded.set_progress_bar_config(disable=None) From 1f06a6e89685d3fe56c5f017d88473539b4e07eb Mon Sep 17 00:00:00 2001 From: anton- Date: Wed, 7 Dec 2022 12:20:39 +0100 Subject: [PATCH 2/2] revert --- .github/workflows/push_tests.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index 2ef6fdb48619..ad1821621ffb 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main env: DIFFUSERS_IS_CI: yes @@ -77,7 +74,7 @@ jobs: HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }} run: | python -m pytest -n 1 --max-worker-restart=0 --dist=loadfile \ - -s -v -k "StableDiffusion" \ + -s -v -k "not Flax and not Onnx" \ --make-reports=tests_${{ matrix.config.report }} \ tests/