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
53 changes: 53 additions & 0 deletions backends/arm/test/ops/test_ge.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
OpNotSupportedPipeline,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)

input_t = Tuple[torch.Tensor]
Expand Down Expand Up @@ -181,3 +182,55 @@ def test_ge_scalar_u85_INT(test_module):
run_on_fvp=True,
)
pipeline.run()


@common.parametrize("test_module", test_data_tensor)
@common.SkipIfNoModelConverter
def test_ge_tensor_vgf_FP(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
GreaterEqual.aten_op_tensor,
GreaterEqual.exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_module", test_data_tensor)
@common.SkipIfNoModelConverter
def test_ge_tensor_vgf_INT(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
GreaterEqual.aten_op_tensor,
GreaterEqual.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()


@common.parametrize("test_module", test_data_scalar)
@common.SkipIfNoModelConverter
def test_ge_scalar_vgf_FP(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
GreaterEqual.aten_op_scalar,
GreaterEqual.exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_module", test_data_scalar)
@common.SkipIfNoModelConverter
def test_ge_scalar_vgf_INT(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
GreaterEqual.aten_op_tensor,
GreaterEqual.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
29 changes: 29 additions & 0 deletions backends/arm/test/ops/test_gelu.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
EthosU85PipelineINT,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)

input_t1 = Tuple[torch.Tensor]
Expand Down Expand Up @@ -125,3 +126,31 @@ def test_gelu_u85_INT(test_data: input_t1):
Gelu.aten_op,
Gelu.exir_op,
).run()


@common.parametrize("test_data", Gelu.test_data)
@common.SkipIfNoModelConverter
def test_gelu_vgf_FP(test_data: input_t1):
approximate, data = test_data()
pipeline = VgfPipeline[input_t1](
Gelu(approximate),
(data,),
Gelu.aten_op,
Gelu.exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_data", Gelu.test_data)
@common.SkipIfNoModelConverter
def test_gelu_vgf_INT(test_data: input_t1):
approximate, data = test_data()
pipeline = VgfPipeline[input_t1](
Gelu(approximate),
(data,),
Gelu.aten_op,
Gelu.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
54 changes: 54 additions & 0 deletions backends/arm/test/ops/test_group_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
EthosU85PipelineINT,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)


Expand Down Expand Up @@ -143,3 +144,56 @@ def test_native_group_norm_u85_INT(test_data):
)
pipeline.change_args("run_method_and_compare_outputs", atol=1, qtol=1)
pipeline.run()


@common.parametrize(
"test_data",
test_data_suite,
xfails={
"randn_1_12_8_6_groups_12": "MLETORCH-925: Fix numerical issue",
"rand_6_8_10_12_groups_1": "MLETORCH-925: Fix numerical issue",
"rand_6_8_10_12_groups_4_no_affine": "MLETORCH-925: Fix numerical issue",
"rand_6_8_10_12_groups_8": "MLETORCH-925: Fix numerical issue",
},
strict=False,
)
@common.SkipIfNoModelConverter
def test_native_group_norm_vgf_FP(test_data):
aten_op = "torch.ops.aten.group_norm.default"
exir_op = "executorch_exir_dialects_edge__ops_aten_native_group_norm_default"
model, inp = test_data
pipeline = VgfPipeline[input_t](
inp,
model,
aten_op=aten_op,
exir_op=exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize(
"test_data",
test_data_suite,
xfails={
"randn_1_12_8_6_groups_12": "MLETORCH-925: Fix numerical issue",
"rand_6_8_10_12_groups_1": "MLETORCH-925: Fix numerical issue",
"rand_6_8_10_12_groups_4_no_affine": "MLETORCH-925: Fix numerical issue",
"rand_6_8_10_12_groups_8": "MLETORCH-925: Fix numerical issue",
},
strict=False,
)
@common.SkipIfNoModelConverter
def test_native_group_norm_vgf_INT(test_data):
aten_op = "torch.ops.aten.sub.Tensor"
exir_op = "executorch_exir_dialects_edge__ops_aten_native_group_norm_default"
model, inp = test_data
pipeline = VgfPipeline[input_t](
inp,
model,
aten_op=aten_op,
exir_op=exir_op,
tosa_version="TOSA-1.0+INT",
atol=0.1, # TODO: "MLETORCH-925: Fix numerical issue for aten.native_group_norm"
)
pipeline.run()
53 changes: 53 additions & 0 deletions backends/arm/test/ops/test_gt.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
OpNotSupportedPipeline,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)


Expand Down Expand Up @@ -186,3 +187,55 @@ def test_gt_scalar_u85_INT(test_module):
run_on_fvp=True,
)
pipeline.run()


@common.parametrize("test_module", test_data_tensor)
@common.SkipIfNoModelConverter
def test_gt_tensor_vgf_FP(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
Greater.aten_op_tensor,
Greater.exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_module", test_data_scalar)
@common.SkipIfNoModelConverter
def test_gt_scalar_vgf_FP(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
Greater.aten_op_scalar,
Greater.exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_module", test_data_tensor)
@common.SkipIfNoModelConverter
def test_gt_tensor_vgf_INT(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
Greater.aten_op_tensor,
Greater.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()


@common.parametrize("test_module", test_data_scalar)
@common.SkipIfNoModelConverter
def test_gt_scalar_vgf_INT(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
Greater.aten_op_tensor,
Greater.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
23 changes: 23 additions & 0 deletions backends/arm/test/ops/test_hardsigmoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
EthosU85PipelineINT,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)

aten_op = "torch.ops.aten.hardsigmoid.default"
Expand Down Expand Up @@ -87,3 +88,25 @@ def test_hardsigmoid_u85_INT(test_data: torch.Tensor):
use_to_edge_transform_and_lower=True,
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardsigmoid_vgf_FP(test_data: torch.Tensor):
pipeline = VgfPipeline[input_t1](
Hardsigmoid(), (test_data(),), aten_op, exir_op=[], tosa_version="TOSA-1.0+FP"
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardsigmoid_vgf_INT(test_data: torch.Tensor):
pipeline = VgfPipeline[input_t1](
Hardsigmoid(),
(test_data(),),
aten_op,
exir_op=[],
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
23 changes: 23 additions & 0 deletions backends/arm/test/ops/test_hardswish.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
EthosU85PipelineINT,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)

aten_op = "torch.ops.aten.hardswish.default"
Expand Down Expand Up @@ -77,3 +78,25 @@ def test_hardswish_u85_INT(test_data):
run_on_fvp=True,
use_to_edge_transform_and_lower=True,
).run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardswish_vgf_FP(test_data):
pipeline = VgfPipeline[input_t1](
Hardswish(), (test_data(),), aten_op, exir_op, tosa_version="TOSA-1.0+FP"
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardswish_vgf_INT(test_data):
pipeline = VgfPipeline[input_t1](
Hardswish(),
(test_data(),),
aten_op,
exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
23 changes: 23 additions & 0 deletions backends/arm/test/ops/test_hardtanh.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
EthosU85PipelineINT,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)

test_data_suite = {
Expand Down Expand Up @@ -86,3 +87,25 @@ def test_hardtanh_u85_INT(test_data: torch.Tensor):
run_on_fvp=True,
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardtanh_vgf_FP(test_data: torch.Tensor):
pipeline = VgfPipeline[input_t](
HardTanh(), (test_data(),), aten_op, exir_op, tosa_version="TOSA-1.0+FP"
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardtanh_vgf_INT(test_data: torch.Tensor):
pipeline = VgfPipeline[input_t](
HardTanh(),
(test_data(),),
aten_op,
exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
49 changes: 49 additions & 0 deletions backends/arm/test/ops/test_index_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
import pytest

import torch

from executorch.backends.arm.test import common
from executorch.backends.arm.test.tester.test_pipeline import (
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)


Expand Down Expand Up @@ -115,3 +118,49 @@ def test_index_select_tosa_INT_rand(test_data: input_params):
"run_method_and_compare_outputs", inputs=test_input, atol=0.9, rtol=0.2, qtol=1
)
pipeline.run()


@pytest.mark.parametrize("test_data", list(test_data.values()))
@common.SkipIfNoModelConverter
def test_index_select_vgf_FP(test_data: input_params):
op, inp = test_data
pipeline = VgfPipeline[input_params](
op,
inp,
op.aten_op,
op.exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@pytest.mark.parametrize("test_data", list(test_data.values())[:-1])
@common.SkipIfNoModelConverter
def test_index_select_vgf_INT(test_data: input_params):
op, inp = test_data
pipeline = VgfPipeline[input_params](
op,
inp,
op.aten_op,
op.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()


@pytest.mark.parametrize("test_data", list(test_data.values())[-1:])
@common.SkipIfNoModelConverter
def test_index_select_vgf_INT_rand(test_data: input_params):
op, inp = test_data
pipeline = VgfPipeline[input_params](
op,
inp,
op.aten_op,
op.exir_op,
tosa_version="TOSA-1.0+INT",
)
# TODO: MLETORCH-1136 Change args of run_method_and_compare_outputs of the vgf tests
# pipeline.change_args(
# "run_method_and_compare_outputs", inputs=test_input, atol=0.9, rtol=0.2, qtol=1
# )
pipeline.run()
Loading
Loading