Skip to content

Commit 176800e

Browse files
martinlsmMartin Lindström
andauthored
Arm backend: Change W2L "input type" for Ethos-U55 test (#13839)
The W2L model includes a conv1d layer with an unsupported stride length (160) when the input_type argument to the model's constructor is set to the default value ("waveform"). Change the input_type parameter to "power_spectrum" as a workaround to not include this unsupported layer. Still the test case will not pass because there is lack of memory (SRAM). Change the pytest.mark.skip decorator to the U55 test to reflect the new expected reason for failure. Co-authored-by: Martin Lindström <[email protected]>
1 parent a19c42b commit 176800e

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

backends/arm/test/models/test_w2l_arm.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class TestW2L(unittest.TestCase):
3636
input_frames = 400
3737
num_features = 1
3838

39-
w2l = models.Wav2Letter(num_features=num_features).eval()
4039
model_example_inputs = get_test_inputs(batch_size, num_features, input_frames)
4140

4241
all_operators = [
@@ -45,11 +44,17 @@ class TestW2L(unittest.TestCase):
4544
"executorch_exir_dialects_edge__ops_aten_relu_default",
4645
]
4746

47+
@staticmethod
48+
def create_model(input_type: str = "waveform"):
49+
return models.Wav2Letter(
50+
num_features=TestW2L.num_features, input_type=input_type
51+
).eval()
52+
4853

4954
@pytest.mark.slow # about 3min on std laptop
5055
def test_w2l_tosa_FP():
5156
pipeline = TosaPipelineFP[input_t](
52-
TestW2L.w2l,
57+
TestW2L.create_model(),
5358
TestW2L.model_example_inputs,
5459
aten_op=[],
5560
exir_op=TestW2L.all_operators,
@@ -62,7 +67,7 @@ def test_w2l_tosa_FP():
6267
@pytest.mark.flaky
6368
def test_w2l_tosa_INT():
6469
pipeline = TosaPipelineINT[input_t](
65-
TestW2L.w2l,
70+
TestW2L.create_model(),
6671
TestW2L.model_example_inputs,
6772
aten_op=[],
6873
exir_op=TestW2L.all_operators,
@@ -74,12 +79,14 @@ def test_w2l_tosa_INT():
7479
@pytest.mark.slow
7580
@common.XfailIfNoCorstone300
7681
@pytest.mark.xfail(
77-
reason="MLETORCH-1009: Wav2Letter fails on U55 due to unsupported conditions",
78-
strict=False,
82+
reason="Wav2Letter fails on U55 due to insufficient memory",
83+
strict=True,
7984
)
8085
def test_w2l_u55_INT():
8186
pipeline = EthosU55PipelineINT[input_t](
82-
TestW2L.w2l,
87+
# Use "power_spectrum" variant because the default ("waveform") has a
88+
# conv1d layer with an unsupported stride size.
89+
TestW2L.create_model("power_spectrum"),
8390
TestW2L.model_example_inputs,
8491
aten_ops=[],
8592
exir_ops=[],
@@ -94,7 +101,7 @@ def test_w2l_u55_INT():
94101
@pytest.mark.skip(reason="Intermittent timeout issue: MLETORCH-856")
95102
def test_w2l_u85_INT():
96103
pipeline = EthosU85PipelineINT[input_t](
97-
TestW2L.w2l,
104+
TestW2L.create_model(),
98105
TestW2L.model_example_inputs,
99106
aten_ops=[],
100107
exir_ops=[],
@@ -108,7 +115,7 @@ def test_w2l_u85_INT():
108115
@pytest.mark.slow
109116
def test_w2l_vgf_INT():
110117
pipeline = VgfPipeline[input_t](
111-
TestW2L.w2l,
118+
TestW2L.create_model(),
112119
TestW2L.model_example_inputs,
113120
aten_op=[],
114121
exir_op=TestW2L.all_operators,
@@ -121,7 +128,7 @@ def test_w2l_vgf_INT():
121128
@common.SkipIfNoModelConverter
122129
def test_w2l_vgf_FP():
123130
pipeline = VgfPipeline[input_t](
124-
TestW2L.w2l,
131+
TestW2L.create_model(),
125132
TestW2L.model_example_inputs,
126133
aten_op=[],
127134
exir_op=TestW2L.all_operators,

0 commit comments

Comments
 (0)