Skip to content
Open
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
1 change: 1 addition & 0 deletions backends/arm/quantizer/quantizer_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def check_pattern(cls, pattern):
(torch.ops.aten.zeros_like.default,),
(torch.ops.aten._softmax.default,),
(torch.ops.aten.softmax.int,),
(torch.ops.aten.div.Scalar,),
(torch.ops.aten.div.Tensor,),
(torch.ops.aten.div_.Tensor,),
(torch.ops.aten.div.Tensor_mode,),
Expand Down
33 changes: 15 additions & 18 deletions backends/arm/test/ops/test_div.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from typing import Optional, Tuple, Union

import pytest
import torch
from executorch.backends.arm.test import common

Expand Down Expand Up @@ -181,29 +180,27 @@ def test_div_scalar_vgf_no_quant(test_data: input_t1):
pipeline.run()


aten_ops_quant = [
"torch.ops.aten.reciprocal.default",
"torch.ops.aten.mul.Tensor",
]

exir_ops_quant = [
"executorch_exir_dialects_edge__ops_aten_reciprocal_default",
"executorch_exir_dialects_edge__ops_aten_mul_Tensor",
]


@common.parametrize("test_data", test_data_suite_scalar)
@pytest.mark.xfail(
reason=(
"Quantized div.Scalar is rewritten to div.Tensor after the initial "
"quantizer support match, so it misses DecomposeDivPass and remains "
"outside the VGF delegate. MLETORCH-2366"
),
strict=True,
)
@common.SkipIfNoModelConverter
def test_div_scalar_vgf_quant(test_data: input_t1):
"""Test Tensor / Scalar division (VGF INT).

The quantized scalar path is rewritten before the ATen and should not be
checked as div.Scalar. We keep expected op lists empty, matching the
existing quantized div.Tensor test.

"""
"""Test Tensor / Scalar division (VGF INT)."""
pipeline = VgfPipeline[input_t1](
DivScalar(),
test_data(),
[],
[],
aten_op=aten_ops_quant,
exir_op=exir_ops_quant,
quantize=True,
use_to_edge_transform_and_lower=False,
)
pipeline.run()
Loading