Skip to content

Commit 3a9d7d9

Browse files
[Tests] parallelize (#3078)
* [Tests] parallelize * finish folder structuring * Parallelize tests more * Correct saving of pipelines * make sure logging level is correct * try again * Apply suggestions from code review Co-authored-by: Pedro Cuenca <[email protected]> --------- Co-authored-by: Pedro Cuenca <[email protected]>
1 parent e748b3c commit 3a9d7d9

File tree

63 files changed

+109
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+109
-84
lines changed

.github/workflows/pr_tests.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,27 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
config:
24-
- name: Fast PyTorch CPU tests on Ubuntu
25-
framework: pytorch
24+
- name: Fast PyTorch Pipeline CPU tests
25+
framework: pytorch_pipelines
2626
runner: docker-cpu
2727
image: diffusers/diffusers-pytorch-cpu
28-
report: torch_cpu
29-
- name: Fast Flax CPU tests on Ubuntu
28+
report: torch_cpu_pipelines
29+
- name: Fast PyTorch Models & Schedulers CPU tests
30+
framework: pytorch_models
31+
runner: docker-cpu
32+
image: diffusers/diffusers-pytorch-cpu
33+
report: torch_cpu_models_schedulers
34+
- name: Fast Flax CPU tests
3035
framework: flax
3136
runner: docker-cpu
3237
image: diffusers/diffusers-flax-cpu
3338
report: flax_cpu
34-
- name: Fast ONNXRuntime CPU tests on Ubuntu
39+
- name: Fast ONNXRuntime CPU tests
3540
framework: onnxruntime
3641
runner: docker-cpu
3742
image: diffusers/diffusers-onnxruntime-cpu
3843
report: onnx_cpu
39-
- name: PyTorch Example CPU tests on Ubuntu
44+
- name: PyTorch Example CPU tests
4045
framework: pytorch_examples
4146
runner: docker-cpu
4247
image: diffusers/diffusers-pytorch-cpu
@@ -71,21 +76,29 @@ jobs:
7176
run: |
7277
python utils/print_env.py
7378
74-
- name: Run fast PyTorch CPU tests
75-
if: ${{ matrix.config.framework == 'pytorch' }}
79+
- name: Run fast PyTorch Pipeline CPU tests
80+
if: ${{ matrix.config.framework == 'pytorch_pipelines' }}
7681
run: |
7782
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
7883
-s -v -k "not Flax and not Onnx" \
7984
--make-reports=tests_${{ matrix.config.report }} \
80-
tests/
85+
tests/pipelines
86+
87+
- name: Run fast PyTorch Model Scheduler CPU tests
88+
if: ${{ matrix.config.framework == 'pytorch_models' }}
89+
run: |
90+
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
91+
-s -v -k "not Flax and not Onnx" \
92+
--make-reports=tests_${{ matrix.config.report }} \
93+
tests/models tests/schedulers tests/others
8194
8295
- name: Run fast Flax TPU tests
8396
if: ${{ matrix.config.framework == 'flax' }}
8497
run: |
8598
python -m pytest -n 2 --max-worker-restart=0 --dist=loadfile \
8699
-s -v -k "Flax" \
87100
--make-reports=tests_${{ matrix.config.report }} \
88-
tests/
101+
tests
89102
90103
- name: Run fast ONNXRuntime CPU tests
91104
if: ${{ matrix.config.framework == 'onnxruntime' }}
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/models/test_models_unet_1d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from diffusers import UNet1DModel
2121
from diffusers.utils import floats_tensor, slow, torch_device
2222

23-
from ..test_modeling_common import ModelTesterMixin
23+
from .test_modeling_common import ModelTesterMixin
2424

2525

2626
torch.backends.cuda.matmul.allow_tf32 = False

tests/models/test_models_unet_2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from diffusers import UNet2DModel
2323
from diffusers.utils import floats_tensor, logging, slow, torch_all_close, torch_device
2424

25-
from ..test_modeling_common import ModelTesterMixin
25+
from .test_modeling_common import ModelTesterMixin
2626

2727

2828
logger = logging.get_logger(__name__)

tests/models/test_models_unet_2d_condition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
)
3535
from diffusers.utils.import_utils import is_xformers_available
3636

37-
from ..test_modeling_common import ModelTesterMixin
37+
from .test_modeling_common import ModelTesterMixin
3838

3939

4040
logger = logging.get_logger(__name__)

tests/models/test_models_unet_3d_condition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
)
3131
from diffusers.utils.import_utils import is_xformers_available
3232

33-
from ..test_modeling_common import ModelTesterMixin
33+
from .test_modeling_common import ModelTesterMixin
3434

3535

3636
logger = logging.get_logger(__name__)

tests/models/test_models_vae.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from diffusers import AutoencoderKL
2323
from diffusers.utils import floats_tensor, load_hf_numpy, require_torch_gpu, slow, torch_all_close, torch_device
2424

25-
from ..test_modeling_common import ModelTesterMixin
25+
from .test_modeling_common import ModelTesterMixin
2626

2727

2828
torch.backends.cuda.matmul.allow_tf32 = False

0 commit comments

Comments
 (0)