Skip to content

Commit d5ba603

Browse files
authored
Restore VGF skip guards and preload_deps shape (#19375)
Summary: Restores two pieces of test plumbing in backends/arm/test/ that were inadvertently removed from pytorch/executorch on GitHub and are still required for stable CI: 1. _VGF_ENABLED skip-guards in test_rewrite_conv_pass.py — without them, three VGF tests crash (rather than skip) on environments where LAVAPIPE_LIB_PATH is unset. 2. preload_deps shape in targets.bzl — the prior refactor silently dropped //executorch/kernels/quantized:custom_ops_generated_lib from every non-VGF arm test whenever runtime.is_oss or not _ENABLE_VGF. The guards are no-ops on environments that have lavapipe configured, so this is a strict safety improvement for OSS CI and a divergence fix for fbsource. This supersedes the long-stuck fix-up diff D100742931 (which will be abandoned). Differential Revision: D104267179 cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell
1 parent bf8abb6 commit d5ba603

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

backends/arm/test/passes/test_rewrite_conv_pass.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
55

6+
import os
7+
68
import pytest
79
import torch
810
import torch.nn as nn
@@ -34,6 +36,8 @@
3436
from torch.export import Dim, export
3537
from torch.export.exported_program import _get_shape_env
3638

39+
_VGF_ENABLED = "LAVAPIPE_LIB_PATH" in os.environ
40+
3741

3842
class TinyConvReluCat(nn.Module):
3943
def __init__(self, conv1_bias: bool = True) -> None:
@@ -214,6 +218,7 @@ def test_rewrite_conv_tosa_FP():
214218
pipeline.run()
215219

216220

221+
@pytest.mark.skipif(not _VGF_ENABLED, reason="VGF not enabled")
217222
def test_fold_and_annotate_q_params_vgf_quant_preserves_output_qparams_on_non_fuseable_clamp() -> (
218223
None
219224
):
@@ -228,6 +233,7 @@ def test_fold_and_annotate_q_params_vgf_quant_preserves_output_qparams_on_non_fu
228233
assert clamp.meta["output_qparams"]
229234

230235

236+
@pytest.mark.skipif(not _VGF_ENABLED, reason="VGF not enabled")
231237
def test_rewrite_conv_vgf_quant_handles_non_fuseable_conv_clamp_cat_branch() -> None:
232238
exported_program = _export_quantized(TinyConvReluCat())
233239
compile_spec = _compile_spec()
@@ -239,6 +245,7 @@ def test_rewrite_conv_vgf_quant_handles_non_fuseable_conv_clamp_cat_branch() ->
239245
)
240246

241247

248+
@pytest.mark.skipif(not _VGF_ENABLED, reason="VGF not enabled")
242249
def test_rewrite_conv_vgf_quant_infers_quantized_bias_dtype_from_inputs() -> None:
243250
exported_program = _export_quantized(TinyConvReluCat(conv1_bias=False))
244251
edge_program = to_edge(

backends/arm/test/targets.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ def define_arm_tests():
8484
"EMULATION_LAYER_TENSOR_JSON": "$(location fbsource//third-party/arm-ml-emulation-layer/v0.9.0/src:VkLayer_Tensor_json)",
8585
"EMULATION_LAYER_GRAPH_JSON": "$(location fbsource//third-party/arm-ml-emulation-layer/v0.9.0/src:VkLayer_Graph_json)",
8686
} if _ENABLE_VGF else {}),
87-
preload_deps = [] if runtime.is_oss or not _ENABLE_VGF else [
87+
preload_deps = [
8888
"//executorch/kernels/quantized:custom_ops_generated_lib",
89+
] + ([] if runtime.is_oss or not _ENABLE_VGF else [
8990
"fbsource//third-party/khronos:vulkan",
9091
"//executorch/backends/arm/runtime:vgf_backend",
91-
],
92+
]),
9293
deps = [
9394
"//executorch/backends/arm/test:arm_tester" if runtime.is_oss else "//executorch/backends/arm/test/tester/fb:arm_tester_fb",
9495
"//executorch/backends/arm/test:conftest",

0 commit comments

Comments
 (0)