Skip to content
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
21 changes: 16 additions & 5 deletions backends/arm/test/models/test_conformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class TestConformer:
# .to_executorch step, i.e. after Arm partitioner.
aten_ops = ["torch.ops.aten._assert_scalar.default"]

# TODO(MLETORCH-635): reduce tolerance
atol = 0.4
rtol = 0.4

dim = 16
num_examples = 10
lengths = torch.randint(1, 100, (num_examples,), dtype=torch.int32)
Expand Down Expand Up @@ -65,7 +69,7 @@ def test_conformer_tosa_INT():
pipeline = TosaPipelineINT[input_t](
TestConformer.conformer,
TestConformer.model_example_inputs,
aten_op=[], # RemoveGraphAssertsPass is added in transform_for_annotation_pipeline to remove the assert ops
aten_op=[],
exir_op=[],
use_to_edge_transform_and_lower=True,
)
Expand All @@ -75,8 +79,8 @@ def test_conformer_tosa_INT():
get_test_inputs(
TestConformer.dim, TestConformer.lengths, TestConformer.num_examples
),
rtol=1.0,
atol=3.0,
rtol=TestConformer.rtol,
atol=TestConformer.atol,
)
pipeline.run()

Expand Down Expand Up @@ -130,13 +134,20 @@ def test_conformer_vgf_INT():
pipeline = VgfPipeline[input_t](
TestConformer.conformer,
TestConformer.model_example_inputs,
aten_op=[], # RemoveGraphAssertsPass is added in transform_for_annotation_pipeline to remove the assert ops
aten_op=[],
exir_op=[],
tosa_version="TOSA-1.0+INT",
use_to_edge_transform_and_lower=True,
run_on_vulkan_runtime=False, # TODO: run on vulkan runtime
)
pipeline.pop_stage("check_count.exir")
pipeline.change_args(
"run_method_and_compare_outputs",
get_test_inputs(
TestConformer.dim, TestConformer.lengths, TestConformer.num_examples
),
rtol=TestConformer.rtol,
atol=TestConformer.atol,
)
pipeline.run()


Expand Down
5 changes: 4 additions & 1 deletion backends/arm/test/models/test_dl3_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ def test_dl3_vgf_INT():
exir_op=[],
tosa_version="TOSA-1.0+INT",
use_to_edge_transform_and_lower=True,
run_on_vulkan_runtime=False, # TODO: run on vulkan runtime
run_on_vulkan_runtime=True, # TODO: run on vulkan runtime
)
pipeline.change_args(
"run_method_and_compare_outputs", rtol=0.1, atol=0.1
) # TODO: MLETORCH-1036 decrease tolerance
pipeline.run()


Expand Down
2 changes: 0 additions & 2 deletions backends/arm/test/models/test_mobilenet_v2_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def test_mv2_vgf_INT(per_channel_quantization):
per_channel_quantization=per_channel_quantization,
atol=0.25,
qtol=1,
run_on_vulkan_runtime=False,
)
pipeline.run()

Expand All @@ -139,6 +138,5 @@ def test_mv2_vgf_FP():
exir_op=[],
tosa_version="TOSA-1.0+FP",
use_to_edge_transform_and_lower=True,
run_on_vulkan_runtime=False,
)
pipeline.run()
Loading