Deselect VGF tests when model-converter is not installed (#19282)#19282
Deselect VGF tests when model-converter is not installed (#19282)#19282psiddh wants to merge 2 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19282
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ⏳ 122 Pending, 1 Unrelated FailureAs of commit b15b795 with merge base 0a113f8 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@psiddh has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103644035. |
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
This PR is mainly aimed at reducing false CI noise in the Arm backend by changing how VGF tests are handled when the Arm MLSDK model-converter binary is unavailable. It also includes two unrelated test-only changes outside the Arm VGF collection logic.
Changes:
- Add Arm
pytest_collection_modifyitemslogic to deselect VGF tests whenmodel-converteris not installed. - Broaden an EXIR partitioner test's expected
AttributeErrorregex for cross-version message compatibility. - Add a new skip to the Vulkan Hardshrink delegate test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
backends/arm/test/conftest.py |
Adds collection-time deselection of VGF tests based on model_converter_installed(). |
exir/backend/test/test_partitioner.py |
Relaxes a test assertion to accept multiple setter error message variants. |
backends/vulkan/test/test_vulkan_delegate.py |
Unconditionally skips the Vulkan Hardshrink backend test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary: VGF tests require the Arm MLSDK model-converter binary which is not provisioned in CI when `_ENABLE_VGF = False` (the current default in targets.bzl). These tests correctly skip via `SkipIfNoModelConverter`, but TestInfra reports skipped/disabled tests as FAILURE in the OMH dashboard, creating ~1,025 phantom failures for the ai_infra_mobile_platform oncall. This change uses the existing `pytest_collection_modifyitems` hook in conftest.py to deselect (not collect) tests that carry the `SkipIfNoModelConverter` marker (detected via `reason` string on `skipif` markers). This is more precise than name-based filtering because: - It catches parametrized variants like `test_roundtrip[VGF]` that use `marks=SkipIfNoModelConverter` - It does NOT deselect tests like `test_compile_spec_vgf_no_quant` that have "vgf" in the name but do not need model-converter Deselected tests are invisible to TestInfra, eliminating false failure reports. When `_ENABLE_VGF` is later flipped to True and model-converter is provisioned, VGF tests will automatically be collected and run again. Differential Revision: D103644035
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from executorch.backends.arm.test.runner_utils import model_converter_installed | ||
|
|
||
| if not model_converter_installed(): | ||
| deselected = [] | ||
| remaining = [] | ||
| for item in items: | ||
| for marker in item.iter_markers("skipif"): | ||
| if "model-converter" in marker.kwargs.get("reason", ""): |
| vk_icd = os.environ.get("VK_ICD_FILENAMES", "") | ||
| if "swiftshader" in vk_icd.lower(): | ||
| return True | ||
| RTLD_NOLOAD = 4 | ||
| for lib_name in ("libvk_swiftshader.so", "libvk_swiftshader_fbcode.so"): | ||
| try: | ||
| ctypes.CDLL(lib_name, mode=RTLD_NOLOAD) | ||
| return True |
Summary: VGF tests require the Arm MLSDK model-converter binary which is not provisioned in CI when `_ENABLE_VGF = False` (the current default in targets.bzl). These tests correctly skip via `SkipIfNoModelConverter`, but TestInfra reports skipped/disabled tests as FAILURE in the OMH dashboard, creating ~1,025 phantom failures for the ai_infra_mobile_platform oncall. This change uses the existing `pytest_collection_modifyitems` hook in conftest.py to deselect (not collect) tests that carry the `SkipIfNoModelConverter` marker (detected via `reason` string on `skipif` markers). This is more precise than name-based filtering because: - It catches parametrized variants like `test_roundtrip[VGF]` that use `marks=SkipIfNoModelConverter` - It does NOT deselect tests like `test_compile_spec_vgf_no_quant` that have "vgf" in the name but do not need model-converter Deselected tests are invisible to TestInfra, eliminating false failure reports. When `_ENABLE_VGF` is later flipped to True and model-converter is provisioned, VGF tests will automatically be collected and run again. Differential Revision: D103644035
… skip (pytorch#19281) Summary: Fix two test failures for the ai_infra_mobile_platform oncall: 1. test_partitioner_with_spec: Python 3.12 changed the AttributeError message for property setters from "can't set attribute 'spec'" to "property 'spec' of '...' object has no setter". Updated the assertRaisesRegex pattern to match both versions. 2. test_vulkan_backend_hardshrink (and 7 other swiftshader-incompatible tests): Replaced unconditional `unittest.skip` with a conditional `skip_if_swiftshader` decorator that detects swiftshader via env var (`ETVK_USING_SWIFTSHADER`), VK_ICD_FILENAMES, or loaded library check. Tests will now run on real Vulkan drivers (non-swiftshader environments) while still skipping in CI where swiftshader is used. Differential Revision: D103628836
Summary: VGF tests require the Arm MLSDK model-converter binary which is not provisioned in CI when `_ENABLE_VGF = False` (the current default in targets.bzl). These tests correctly skip via `SkipIfNoModelConverter`, but TestInfra reports skipped/disabled tests as FAILURE in the OMH dashboard, creating ~1,025 phantom failures for the ai_infra_mobile_platform oncall. This change uses the existing `pytest_collection_modifyitems` hook in conftest.py to deselect (not collect) tests that carry the `SkipIfNoModelConverter` marker (detected via `reason` string on `skipif` markers). This is more precise than name-based filtering because: - It catches parametrized variants like `test_roundtrip[VGF]` that use `marks=SkipIfNoModelConverter` - It does NOT deselect tests like `test_compile_spec_vgf_no_quant` that have "vgf" in the name but do not need model-converter Deselected tests are invisible to TestInfra, eliminating false failure reports. When `_ENABLE_VGF` is later flipped to True and model-converter is provisioned, VGF tests will automatically be collected and run again. Differential Revision: D103644035
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try: | ||
| if os.environ.get("ETVK_USING_SWIFTSHADER", "0") in ("1", "True"): | ||
| return True | ||
| vk_icd = os.environ.get("VK_ICD_FILENAMES", "") | ||
| if "swiftshader" in vk_icd.lower(): | ||
| return True | ||
| RTLD_NOLOAD = 4 | ||
| for lib_name in ("libvk_swiftshader.so", "libvk_swiftshader_fbcode.so"): | ||
| try: | ||
| ctypes.CDLL(lib_name, mode=RTLD_NOLOAD) | ||
| return True | ||
| except Exception: | ||
| continue | ||
| return False | ||
| except Exception: | ||
| return True |
| def pytest_collection_modifyitems(config, items): | ||
| pass | ||
| from executorch.backends.arm.test import common | ||
| from executorch.backends.arm.test.runner_utils import model_converter_installed |
Summary:
VGF tests require the Arm MLSDK model-converter binary which is not provisioned in CI when
_ENABLE_VGF = False(the current default in targets.bzl). These tests correctly skip viaSkipIfNoModelConverter, but TestInfra reports skipped/disabled tests as FAILURE in the OMH dashboard, creating ~1,025 phantom failures for the ai_infra_mobile_platform oncall.This change uses the existing
pytest_collection_modifyitemshook in conftest.py to deselect (not collect) tests that carry theSkipIfNoModelConvertermarker (detected viareasonstring onskipifmarkers). This is more precise than name-based filtering because:test_roundtrip[VGF]that usemarks=SkipIfNoModelConvertertest_compile_spec_vgf_no_quantthat have "vgf" in the name but do not need model-converterDeselected tests are invisible to TestInfra, eliminating false failure reports. When
_ENABLE_VGFis later flipped to True and model-converter is provisioned, VGF tests will automatically be collected and run again.Differential Revision: D103644035