From e16ecdf577f19556028f26f9416eed3e9b0993bd Mon Sep 17 00:00:00 2001 From: Dhruv Nair Date: Tue, 17 Oct 2023 08:40:44 +0000 Subject: [PATCH 1/2] fix pipe fetcher --- utils/fetch_torch_cuda_pipeline_test_matrix.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/fetch_torch_cuda_pipeline_test_matrix.py b/utils/fetch_torch_cuda_pipeline_test_matrix.py index 41a9c1c8270d..96156a2fd075 100644 --- a/utils/fetch_torch_cuda_pipeline_test_matrix.py +++ b/utils/fetch_torch_cuda_pipeline_test_matrix.py @@ -70,7 +70,12 @@ def fetch_pipeline_modules_to_test(): test_modules = [] for pipeline_name in pipeline_objects: - module = getattr(diffusers, pipeline_name) + try: + module = getattr(diffusers, pipeline_name) + except Exception: + logger.warning(f"Unable to fetch {pipeline_name} from diffusers") + continue + test_module = module.__module__.split(".")[-2].strip() test_modules.append(test_module) From c7c1b16632f9a1c764a86c3049d217ef2e73106b Mon Sep 17 00:00:00 2001 From: Dhruv Nair Date: Tue, 17 Oct 2023 16:42:39 +0000 Subject: [PATCH 2/2] filter out community pipelines --- utils/fetch_torch_cuda_pipeline_test_matrix.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utils/fetch_torch_cuda_pipeline_test_matrix.py b/utils/fetch_torch_cuda_pipeline_test_matrix.py index 96156a2fd075..302898789728 100644 --- a/utils/fetch_torch_cuda_pipeline_test_matrix.py +++ b/utils/fetch_torch_cuda_pipeline_test_matrix.py @@ -34,8 +34,11 @@ def filter_pipelines(usage_dict, usage_cutoff=10000): if usage < usage_cutoff: continue - if "Pipeline" in diffusers_object: - output.append(diffusers_object) + is_diffusers_pipeline = hasattr(diffusers.pipelines, diffusers_object) + if not is_diffusers_pipeline: + continue + + output.append(diffusers_object) return output @@ -70,11 +73,7 @@ def fetch_pipeline_modules_to_test(): test_modules = [] for pipeline_name in pipeline_objects: - try: - module = getattr(diffusers, pipeline_name) - except Exception: - logger.warning(f"Unable to fetch {pipeline_name} from diffusers") - continue + module = getattr(diffusers, pipeline_name) test_module = module.__module__.split(".")[-2].strip() test_modules.append(test_module)