Skip to content

Arm backend: Set qtol=1 for flaky tests. #9641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions backends/arm/test/ops/test_layer_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,47 +77,31 @@ def test_native_layer_norm_tosa_BI(test_data):
test_data[0],
"torch.ops.aten.sub.Tensor", # Just check for sub op included in the layernorm decomposition
)
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.XfailIfNoCorstone300
def test_native_layer_norm_u55_BI(test_data):
pipeline = EthosU55PipelineBI[input_t](
test_data[1],
test_data[0],
"torch.ops.aten.sub.Tensor", # Just check for sub op included in the layernorm decomposition
run_on_fvp=True,
)
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.XfailIfNoCorstone320
def test_native_layer_norm_u85_BI(test_data):
pipeline = EthosU85PipelineBI[input_t](
test_data[1],
test_data[0],
"torch.ops.aten.sub.Tensor", # Just check for sub op included in the layernorm decomposition
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoCorstone300
def test_native_layer_norm_u55_BI_on_fvp(test_data):
pipeline = EthosU55PipelineBI[input_t](
test_data[1],
test_data[0],
"torch.ops.aten.sub.Tensor", # Just check for sub op included in the layernorm decomposition
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoCorstone320
def test_native_layer_norm_u85_BI_on_fvp(test_data):
pipeline = EthosU85PipelineBI[input_t](
test_data[1],
test_data[0],
"torch.ops.aten.sub.Tensor", # Just check for sub op included in the layernorm decomposition
run_on_fvp=True,
)
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()
28 changes: 8 additions & 20 deletions backends/arm/test/ops/test_logsoftmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_log_softmax_tosa_MI(test_data):
pipeline.add_stage_after(
"to_edge_transform_and_lower", pipeline.tester.check_not, [exir_op]
)

pipeline.run()


Expand All @@ -55,22 +56,7 @@ def test_log_softmax_tosa_BI(test_data):
data, dim = test_data
pipeline = TosaPipelineBI[input_t1](LogSoftmax(dim), data, [])
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.run()


@common.parametrize("test_data", LogSoftmax.test_data)
def test_log_softmax_u55_BI(test_data):
data, dim = test_data
pipeline = EthosU55PipelineBI[input_t1](LogSoftmax(dim), data, [], run_on_fvp=False)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.run()


@common.parametrize("test_data", LogSoftmax.test_data)
def test_log_softmax_u85_BI(test_data):
data, dim = test_data
pipeline = EthosU85PipelineBI[input_t1](LogSoftmax(dim), data, [], run_on_fvp=False)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


Expand All @@ -81,11 +67,12 @@ def test_log_softmax_u85_BI(test_data):
"randn_mult_batches": "MLETORCH-433: Multiple batches not supported on FVP"
},
)
@common.SkipIfNoCorstone300()
def test_log_softmax_u55_BI_on_fvp(test_data):
@common.XfailIfNoCorstone300()
def test_log_softmax_u55_BI(test_data):
data, dim = test_data
pipeline = EthosU55PipelineBI[input_t1](LogSoftmax(dim), data, [], run_on_fvp=True)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


Expand All @@ -96,9 +83,10 @@ def test_log_softmax_u55_BI_on_fvp(test_data):
"randn_mult_batches": "MLETORCH-433: Multiple batches not supported on FVP"
},
)
@common.SkipIfNoCorstone320
def test_log_softmax_u85_BI_on_fvp(test_data):
@common.XfailIfNoCorstone320
def test_log_softmax_u85_BI(test_data):
data, dim = test_data
pipeline = EthosU85PipelineBI[input_t1](LogSoftmax(dim), data, [], run_on_fvp=True)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()
44 changes: 16 additions & 28 deletions backends/arm/test/ops/test_mean_dim.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,48 +139,36 @@ def test_mean_tosa_MI(test_data):

@common.parametrize("test_data", MeanDim.test_data_suite)
def test_mean_tosa_BI(test_data):
TosaPipelineBI[input_t](
MeanDim(test_data[1], test_data[2]),
(test_data[0],),
"torch.ops.aten.sum.dim_IntList", # Just check for sum op included in the mean decomposition
).run()


@common.parametrize("test_data", MeanDim.test_data_suite)
def test_mean_u55(test_data):
EthosU55PipelineBI[input_t](
MeanDim(test_data[1], test_data[2]),
(test_data[0],),
"torch.ops.aten.sum.dim_IntList", # Just check for sum op included in the mean decomposition
).run()


@common.parametrize("test_data", MeanDim.test_data_suite)
def test_mean_u85(test_data):
EthosU85PipelineBI[input_t](
pipeline = TosaPipelineBI[input_t](
MeanDim(test_data[1], test_data[2]),
(test_data[0],),
"torch.ops.aten.sum.dim_IntList", # Just check for sum op included in the mean decomposition
).run()
)
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


@common.parametrize("test_data", MeanDim.test_data_suite)
@common.SkipIfNoCorstone300
def test_mean_u55_on_fvp(test_data):
EthosU55PipelineBI[input_t](
@common.XfailIfNoCorstone300
def test_mean_u55_BI(test_data):
pipeline = EthosU55PipelineBI[input_t](
MeanDim(test_data[1], test_data[2]),
(test_data[0],),
"torch.ops.aten.sum.dim_IntList", # Just check for sum op included in the mean decomposition
run_on_fvp=True,
).run()
)
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


@common.parametrize("test_data", MeanDim.test_data_suite)
@common.SkipIfNoCorstone320
def test_mean_u85_on_fvp(test_data):
EthosU85PipelineBI[input_t](
@common.XfailIfNoCorstone320
def test_mean_u85_BI(test_data):
pipeline = EthosU85PipelineBI[input_t](
MeanDim(test_data[1], test_data[2]),
(test_data[0],),
"torch.ops.aten.sum.dim_IntList", # Just check for sum op included in the mean decomposition
run_on_fvp=True,
).run()
)
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()
27 changes: 7 additions & 20 deletions backends/arm/test/ops/test_softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,7 @@ def test_softmax_tosa_BI(test_data):
data, dim = test_data
pipeline = TosaPipelineBI[input_t1](Softmax(dim), data, [])
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.run()


@common.parametrize("test_data", Softmax.test_data)
def test_softmax_u55_BI(test_data):
data, dim = test_data
pipeline = EthosU55PipelineBI[input_t1](Softmax(dim), data, [], run_on_fvp=False)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.run()


@common.parametrize("test_data", Softmax.test_data)
def test_softmax_u85_BI(test_data):
data, dim = test_data
pipeline = EthosU85PipelineBI[input_t1](Softmax(dim), data, [], run_on_fvp=False)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


Expand All @@ -83,11 +68,12 @@ def test_softmax_u85_BI(test_data):
"randn_mult_batches": "MLETORCH-433: Multiple batches not supported on FVP"
},
)
@common.SkipIfNoCorstone300
def test_softmax_u55_BI_on_fvp(test_data):
@common.XfailIfNoCorstone300
def test_softmax_u55_BI(test_data):
data, dim = test_data
pipeline = EthosU55PipelineBI[input_t1](Softmax(dim), data, [], run_on_fvp=True)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()


Expand All @@ -98,9 +84,10 @@ def test_softmax_u55_BI_on_fvp(test_data):
"randn_mult_batches": "MLETORCH-433: Multiple batches not supported on FVP"
},
)
@common.SkipIfNoCorstone320
def test_softmax_u85_BI_on_fvp(test_data):
@common.XfailIfNoCorstone320
def test_softmax_u85_BI(test_data):
data, dim = test_data
pipeline = EthosU85PipelineBI[input_t1](Softmax(dim), data, [], run_on_fvp=True)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.change_args("run_method_and_compare_outputs", qtol=1)
pipeline.run()
Loading