Skip to content

Commit 02ff60d

Browse files
authored
Remove extra defensive checks on aten ops in annotator (pytorch#21058) (pytorch#21058)
Summary: When dim name was removed from PyTorch, a defensive check was added because there could be a window where an older PyTorch hash is used. This was intended to be removed after some time. The AIs then pattern match on this extra check and more have been added. Moving all back to the simple list of them; if an aten op is missing from PyTorch, it should be addressed directly instead. Differential Revision: D113019278
1 parent 4cf0207 commit 02ff60d

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

‎backends/arm/quantizer/quantization_annotator.py‎

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,10 @@ def _get_fixed_qparams_qspec(
604604
torch.ops.aten.split_copy.Tensor,
605605
torch.ops.aten.transpose.int,
606606
torch.ops.aten.transpose_copy.int,
607+
torch.ops.aten.moveaxis.int,
608+
torch.ops.aten.moveaxis.intlist,
609+
torch.ops.aten.movedim.int,
610+
torch.ops.aten.movedim.intlist,
607611
torch.ops.aten.t_copy.default,
608612
torch.ops.aten.tile.default,
609613
torch.ops.aten.flip.default,
@@ -629,25 +633,6 @@ def _get_fixed_qparams_qspec(
629633
torch.ops.aten.detach_copy.default,
630634
}
631635

632-
# Dimname has been removed from upstream PyTorch, but there may be a window
633-
# where developers in this backend are using a mainline build of this backend
634-
# with an older version of PyTorch.
635-
# TODO: remove this once the build has time to be propagated and majority of
636-
# dev expected to be unimpacted
637-
_transpose_dimname = getattr(torch.ops.aten.transpose, "Dimname", None)
638-
if _transpose_dimname is not None:
639-
_one_to_one_shared_input_qspec.add(_transpose_dimname)
640-
641-
for _op in (
642-
getattr(torch.ops.aten.moveaxis, "int", None),
643-
getattr(torch.ops.aten.moveaxis, "intlist", None),
644-
getattr(torch.ops.aten.movedim, "int", None),
645-
getattr(torch.ops.aten.movedim, "intlist", None),
646-
):
647-
if _op is not None:
648-
_one_to_one_shared_input_qspec.add(_op)
649-
650-
651636
_one_to_one_shared_input_or_input_act_qspec: set[OpOverload] = {
652637
torch.ops.aten.alias.default,
653638
torch.ops.aten.clone.default,

0 commit comments

Comments
 (0)