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
8 changes: 8 additions & 0 deletions backends/cadence/aot/compiler_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,13 @@ def extract_output_dequant_params(
dtype = args[4]
assert isinstance(dtype, torch.dtype)
return (
# pyrefly: ignore [bad-argument-type]
float(args[0]), # scale
# pyrefly: ignore [bad-argument-type]
int(args[1]), # zero_point
# pyrefly: ignore [bad-argument-type]
int(args[2]), # qmin
# pyrefly: ignore [bad-argument-type]
int(args[3]), # qmax
dtype,
)
Expand Down Expand Up @@ -249,9 +253,13 @@ def extract_output_dequant_params_through_permute(
dtype = args[4]
assert isinstance(dtype, torch.dtype)
return (
# pyrefly: ignore [bad-argument-type]
float(args[0]), # scale
# pyrefly: ignore [bad-argument-type]
int(args[1]), # zero_point
# pyrefly: ignore [bad-argument-type]
int(args[2]), # qmin
# pyrefly: ignore [bad-argument-type]
int(args[3]), # qmax
dtype,
)
Expand Down
2 changes: 2 additions & 0 deletions backends/cadence/aot/compiler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def get_shape(
return fake_tensor.shape
# Case 3. node holds a param
if node.op == "get_attr":
# pyrefly: ignore [bad-argument-type]
attr_node = getattr(graph_module, node.target)
return attr_node.shape
# Default: return None
Expand Down Expand Up @@ -134,6 +135,7 @@ def get_tensor_from_attr(
if node is None:
return None
assert node.op == "get_attr"
# pyrefly: ignore [bad-argument-type]
return getattr(graph_module, node.target)


Expand Down
2 changes: 2 additions & 0 deletions backends/cadence/aot/fuse_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def __init__(self) -> None:

@property
def targets(self) -> list[EdgeOpOverload]:
# pyrefly: ignore [bad-return]
return self._CONV_TARGETS

def _get_batchnorm_user(self, conv_node: torch.fx.Node) -> Optional[torch.fx.Node]:
Expand Down Expand Up @@ -421,6 +422,7 @@ def _unpack_conv_weights(
"""
conv_packed_arg_node = get_arg(conv_node, "packed_weight", torch.fx.Node)
assert conv_packed_arg_node.op == "get_attr"
# pyrefly: ignore [bad-argument-type]
packed_args = getattr(graph_module, conv_packed_arg_node.target)
weight_tensor, bias_tensor = packed_args.unpack()

Expand Down
Loading
Loading