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
8 changes: 6 additions & 2 deletions backends/arm/test/models/test_nss.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_nss_u85_INT():
reason="[MLETORCH-1430]: Double types are not supported in buffers in MSL"
)
@common.SkipIfNoModelConverter
def test_nss_vgf_no_quant():
def test_nss_vgf_FP():
pipeline = VgfPipeline[input_t](
nss().eval(),
example_inputs(),
Expand All @@ -119,12 +119,14 @@ def test_nss_vgf_no_quant():
use_to_edge_transform_and_lower=True,
run_on_vulkan_runtime=True,
quantize=False,
# Override tosa version to test FP-only path
tosa_version="TOSA-1.0+FP",
)
pipeline.run()


@common.SkipIfNoModelConverter
def test_nss_vgf_quant():
def test_nss_vgf_INT():
pipeline = VgfPipeline[input_t](
nss().eval(),
example_inputs(),
Expand All @@ -134,6 +136,8 @@ def test_nss_vgf_quant():
use_to_edge_transform_and_lower=True,
run_on_vulkan_runtime=True,
quantize=True,
# Override tosa version to test INT-only path
tosa_version="TOSA-1.0+INT",
)
pipeline.run()

Expand Down
12 changes: 8 additions & 4 deletions backends/arm/test/ops/test_hardsigmoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,25 @@ def test_hardsigmoid_u85_INT(test_data: torch.Tensor):

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


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardsigmoid_vgf_INT(test_data: torch.Tensor):
def test_hardsigmoid_vgf_quant(test_data: torch.Tensor):
pipeline = VgfPipeline[input_t1](
Hardsigmoid(),
(test_data(),),
aten_op,
exir_op=[],
tosa_version="TOSA-1.0+INT",
quantize=True,
)
pipeline.run()
12 changes: 8 additions & 4 deletions backends/arm/test/ops/test_hardswish.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,25 @@ def test_hardswish_u85_INT(test_data):

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


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_hardswish_vgf_INT(test_data):
def test_hardswish_vgf_quant(test_data):
pipeline = VgfPipeline[input_t1](
Hardswish(),
(test_data(),),
aten_op,
exir_op,
tosa_version="TOSA-1.0+INT",
quantize=True,
)
pipeline.run()
12 changes: 8 additions & 4 deletions backends/arm/test/ops/test_hardtanh.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,25 @@ def test_hardtanh_u85_INT(test_data: torch.Tensor):

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


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

@pytest.mark.parametrize("test_data", list(test_data.values()))
@common.SkipIfNoModelConverter
def test_index_select_vgf_FP(test_data: input_params):
def test_index_select_vgf_no_quant(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",
quantize=False,
)
pipeline.run()


@pytest.mark.parametrize("test_data", list(test_data.values())[:-1])
@common.SkipIfNoModelConverter
def test_index_select_vgf_INT(test_data: input_params):
def test_index_select_vgf_quant(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",
quantize=True,
)
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):
def test_index_select_vgf_quant_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",
quantize=True,
)
pipeline.run()
8 changes: 4 additions & 4 deletions backends/arm/test/ops/test_layer_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,26 @@ def test_native_layer_norm_u85_INT(test_data):

@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_native_layer_norm_vgf_FP(test_data):
def test_native_layer_norm_vgf_no_quant(test_data):
test_input, model = test_data()
pipeline = VgfPipeline[input_t](
model,
test_input,
"torch.ops.aten.layer_norm.default",
tosa_version="TOSA-1.0+FP",
quantize=False,
)
pipeline.run()


@common.parametrize("test_data", test_data_suite)
@common.SkipIfNoModelConverter
def test_native_layer_norm_vgf_INT(test_data):
def test_native_layer_norm_vgf_quant(test_data):
test_input, model = test_data()
pipeline = VgfPipeline[input_t](
model,
test_input,
"torch.ops.aten.sub.Tensor",
tosa_version="TOSA-1.0+INT",
quantize=True,
)
pipeline.run()

Expand Down
16 changes: 8 additions & 8 deletions backends/arm/test/ops/test_le.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,51 +246,51 @@ def test_le_scalar_16a8w_u85_INT16(test_module):

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


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


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


@common.parametrize("test_module", test_data_scalar)
@common.SkipIfNoModelConverter
def test_le_scalar_vgf_INT(test_module):
def test_le_scalar_vgf_quant(test_module):
pipeline = VgfPipeline[input_t](
test_module(),
test_module().get_inputs(),
LessEqual.aten_op_tensor,
LessEqual.exir_op,
tosa_version="TOSA-1.0+INT",
quantize=True,
)
pipeline.run()
8 changes: 4 additions & 4 deletions backends/arm/test/ops/test_leaky_relu.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ def test_leaky_relu_u85_INT(test_data):

@common.parametrize("test_data", LeakyReLU.test_data)
@common.SkipIfNoModelConverter
def test_leaky_relu_vgf_FP(test_data):
def test_leaky_relu_vgf_no_quant(test_data):
data, slope = test_data()
pipeline = VgfPipeline[input_t1](
LeakyReLU(slope),
data,
[],
use_to_edge_transform_and_lower=True,
tosa_version="TOSA-1.0+FP",
quantize=False,
)
pipeline.add_stage_after(
"to_edge_transform_and_lower", pipeline.tester.check_not, [aten_op]
Expand All @@ -112,14 +112,14 @@ def test_leaky_relu_vgf_FP(test_data):

@common.parametrize("test_data", LeakyReLU.test_data)
@common.SkipIfNoModelConverter
def test_leaky_relu_vgf_INT(test_data):
def test_leaky_relu_vgf_quant(test_data):
data, slope = test_data()
pipeline = VgfPipeline[input_t1](
LeakyReLU(slope),
data,
[],
use_to_edge_transform_and_lower=True,
tosa_version="TOSA-1.0+INT",
quantize=True,
)
pipeline.add_stage_after("quantize", pipeline.tester.check_not, [aten_op])
pipeline.run()
8 changes: 4 additions & 4 deletions backends/arm/test/ops/test_linalg_vector_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_vector_norm_u85_INT_fvp(test_module):

@common.parametrize("test_module", test_modules)
@common.SkipIfNoModelConverter
def test_vector_norm_vgf_FP(test_module):
def test_vector_norm_vgf_no_quant(test_module):
model, input_tensor = test_module
# FP VGF
aten_op = "torch.ops.aten.linalg_vector_norm.default"
Expand All @@ -138,14 +138,14 @@ def test_vector_norm_vgf_FP(test_module):
input_tensor,
aten_op,
exir_op,
tosa_version="TOSA-1.0+FP",
quantize=False,
)
pipeline.run()


@common.parametrize("test_module", test_modules)
@common.SkipIfNoModelConverter
def test_vector_norm_vgf_INT(test_module):
def test_vector_norm_vgf_quant(test_module):
model, input_tensor = test_module
# Should not found this op
exir_op = "executorch_exir_dialects_edge__ops_aten_linalg_vector_norm_default"
Expand All @@ -155,6 +155,6 @@ def test_vector_norm_vgf_INT(test_module):
input_tensor,
aten_op_q_decomposed_q,
exir_op,
tosa_version="TOSA-1.0+INT",
quantize=True,
)
pipeline.run()
20 changes: 6 additions & 14 deletions backends/arm/test/ops/test_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,39 +209,31 @@ def test_linear_u85_INT(test_data: torch.Tensor):

@common.parametrize("test_data", test_data_rank1_FP | test_data_rank4_FP)
@common.SkipIfNoModelConverter
def test_linear_vgf_FP(test_data: torch.Tensor):
def test_linear_vgf_no_quant(test_data: torch.Tensor):
test_data, out_features, has_bias = test_data()
in_features = test_data.shape[-1]
pipeline = VgfPipeline[input_t1](
Linear(
in_features=in_features,
out_features=out_features,
bias=has_bias,
),
Linear(in_features=in_features, out_features=out_features, bias=has_bias),
(test_data,),
aten_op=aten_op,
exir_op=[],
tosa_version="TOSA-1.0+FP",
quantize=False,
)
pipeline.run()


@common.parametrize("test_data", test_data_rank1_INT | test_data_rank4_INT)
@common.SkipIfNoModelConverter
def test_linear_vgf_INT(test_data: torch.Tensor):
def test_linear_vgf_quant(test_data: torch.Tensor):
test_data, out_features, has_bias, per_channel_quantization = test_data()
in_features = test_data.shape[-1]
pipeline = VgfPipeline[input_t1](
Linear(
in_features=in_features,
out_features=out_features,
bias=has_bias,
),
Linear(in_features=in_features, out_features=out_features, bias=has_bias),
(test_data,),
aten_op=aten_op,
exir_op=[],
tosa_version="TOSA-1.0+INT",
per_channel_quantization=per_channel_quantization,
quantize=True,
)
pipeline.run()

Expand Down
Loading
Loading