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

aten_op = "torch.ops.aten.abs.default"
Expand Down Expand Up @@ -66,3 +67,25 @@ def test_abs_u85_INT(test_data: torch.Tensor):
Abs(), test_data(), aten_op, exir_op, run_on_fvp=True
)
pipeline.run()


@common.parametrize("test_data", Abs.test_parameters)
@common.SkipIfNoModelConverter
def test_abs_vgf_FP(test_data: input_t1):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it how we are sharing tests across TOSA, Ethos, and now VGF backends. 👍

pipeline = VgfPipeline[input_t1](
Abs(), test_data(), aten_op, exir_op, tosa_version="TOSA-1.0+FP"
)
pipeline.run()


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

input_t = Tuple[torch.Tensor] # Input x
Expand Down Expand Up @@ -112,3 +113,27 @@ def test_acosh_u85_INT_xfail(test_data: Tuple):
run_on_fvp=False,
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_acosh_vgf_FP(test_data: Tuple):
pipeline = VgfPipeline[input_t](
Acosh(),
(test_data(),),
aten_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_acosh_vgf_INT(test_data: Tuple):
pipeline = VgfPipeline[input_t](
Acosh(),
(test_data(),),
aten_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
29 changes: 29 additions & 0 deletions backends/arm/test/ops/test_adaptive_avg_pool2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
EthosU85PipelineINT,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)

exir_op = "executorch_exir_dialects_edge__ops_aten_avg_pool2d_default"
Expand Down Expand Up @@ -161,3 +162,31 @@ def test_adaptive_avg_pool2d_u85_INT(test_module):
exir_ops=exir_op,
)
pipeline.run()


@common.parametrize("test_module", test_modules)
@common.SkipIfNoModelConverter
def test_adaptive_avg_pool2d_vgf_FP(test_module):
model, input_tensor = test_module()
pipeline = VgfPipeline[input_t](
model,
input_tensor,
[],
exir_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_module", test_modules)
@common.SkipIfNoModelConverter
def test_adaptive_avg_pool2d_vgf_INT(test_module):
model, input_tensor = test_module()
pipeline = VgfPipeline[input_t](
model,
input_tensor,
[],
exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
27 changes: 27 additions & 0 deletions backends/arm/test/ops/test_addmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
EthosU85PipelineINT,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)

aten_op = "torch.ops.aten.addmm.default"
Expand Down Expand Up @@ -155,3 +156,29 @@ def test_addmm_u85_INT(test_data: Tuple):
exir_ops=exir_op,
)
pipeline.run()


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


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_addmm_vgf_INT(test_data: input_t1):
pipeline = VgfPipeline[input_t1](
Addmm(),
(*test_data,),
aten_op=[],
exir_op=exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
27 changes: 27 additions & 0 deletions backends/arm/test/ops/test_alias_copy.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 @@ -83,3 +84,29 @@ def test_alias_u85_INT(test_data: input_t1):
AliasCopy.aten_op,
AliasCopy.exir_op,
).run()


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


@common.parametrize("test_data", AliasCopy.test_data)
@common.SkipIfNoModelConverter
def test_alias_vgf_INT(test_data: input_t1):
pipeline = VgfPipeline[input_t1](
AliasCopy(),
test_data(),
AliasCopy.aten_op,
AliasCopy.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
55 changes: 55 additions & 0 deletions backends/arm/test/ops/test_amax.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
OpNotSupportedPipeline,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)


Expand Down Expand Up @@ -138,3 +139,57 @@ def test_max_dim_tosa_FP_not_delegated():
data, dim = Max.test_data["rank_4_dim_3"]()
pipeline = OpNotSupportedPipeline[Max.input_t](MaxWithIndex(dim), data, {})
pipeline.run()


@common.parametrize("test_data", Amax.test_data)
@common.SkipIfNoModelConverter
def test_amax_vgf_FP(test_data: Amax.input_t):
data, dim, keep_dims = test_data()
module = Amax(dim, keep_dims)
pipeline = VgfPipeline[Amax.input_t](
module,
data,
Amax.aten_op,
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_data", Amax.test_data)
@common.SkipIfNoModelConverter
def test_amax_vgf_INT(test_data: Amax.input_t):
data, dim, keep_dims = test_data()
module = Amax(dim, keep_dims)
pipeline = VgfPipeline[Amax.input_t](
module,
data,
Amax.aten_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()


@common.parametrize("test_data", Max.test_data)
@common.SkipIfNoModelConverter
def test_max_dim_vgf_FP_to_amax(test_data: Max.input_t):
data, dim = test_data()
pipeline = VgfPipeline[Max.input_t](
Max(dim),
data,
"torch.ops.aten.max",
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_data", Max.test_data)
@common.SkipIfNoModelConverter
def test_max_dim_vgf_INT_to_amax(test_data: Max.input_t):
data, dim = test_data()
pipeline = VgfPipeline[Max.input_t](
Max(dim),
data,
"torch.ops.aten.amax",
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
50 changes: 50 additions & 0 deletions backends/arm/test/ops/test_amin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
OpNotSupportedPipeline,
TosaPipelineFP,
TosaPipelineINT,
VgfPipeline,
)


Expand Down Expand Up @@ -150,3 +151,52 @@ def test_min_dim_tosa_FP_not_delegated():
data, dim = Min.test_data["rank_4_dim_3"]()
pipeline = OpNotSupportedPipeline[Min.input_t](MinWithIndex(dim), data, {})
pipeline.run()


@common.parametrize("test_data", Amin.test_data)
@common.SkipIfNoModelConverter
def test_amin_vgf_FP(test_data: Amin.input_t):
data, dim, keep_dims = test_data()
pipeline = VgfPipeline[Amin.input_t](
Amin(dim, keep_dims), data, Amin.aten_op, tosa_version="TOSA-1.0+FP"
)
pipeline.run()


@common.parametrize("test_data", Amin.test_data)
@common.SkipIfNoModelConverter
def test_amin_vgf_INT(test_data: Amin.input_t):
data, dim, keep_dims = test_data()
pipeline = VgfPipeline[Amin.input_t](
Amin(dim, keep_dims),
data,
Amin.aten_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.run()


@common.parametrize("test_data", Min.test_data)
@common.SkipIfNoModelConverter
def test_min_dim_vgf_FP_to_amin(test_data: Min.input_t):
data, dim = test_data()
pipeline = VgfPipeline[Min.input_t](
Min(dim),
data,
"torch.ops.aten.min",
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.parametrize("test_data", Min.test_data)
@common.SkipIfNoModelConverter
def test_min_dim_vgf_INT_to_amin(test_data: Min.input_t):
data, dim = test_data()
pipeline = VgfPipeline[Min.input_t](
Min(dim),
data,
"torch.ops.aten.amin",
tosa_version="TOSA-1.0+INT",
)
pipeline.run()
31 changes: 31 additions & 0 deletions backends/arm/test/ops/test_any.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 @@ -184,3 +185,33 @@ def test_any_u85_INT(test_data: input_t1):
pipeline.pop_stage("quantize")
pipeline.pop_stage("check.quant_nodes")
pipeline.run()


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


@common.parametrize("test_data", test_data)
@common.SkipIfNoModelConverter
def test_any_vgf_INT(test_data: input_t1):
op, data_fn = test_data()
pipeline = VgfPipeline[input_t1](
op,
data_fn(),
op.aten_op,
op.exir_op,
tosa_version="TOSA-1.0+INT",
)
pipeline.pop_stage("quantize")
pipeline.pop_stage("check.quant_nodes")
pipeline.run()
Loading
Loading