Skip to content

Only support int8 dtype for quant operators #11685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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/xnnpack/partition/config/xnnpack_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
from typing import List, Optional

import torch
from torch.export import ExportedProgram
from executorch.backends.xnnpack.utils.quant_utils import is_dynamic_qdq
from executorch.exir.backend.canonical_partitioners.config_partitioner import (
format_target_name,
PartitionerConfig,
)
from executorch.exir.backend.utils import WhyNoPartition
from torch.export import ExportedProgram

logger = logging.getLogger(__name__)
why = WhyNoPartition(logger=logger)
Expand Down Expand Up @@ -220,9 +221,12 @@ def _check_node_has_valid_dtype(self, node):
valid_dtypes = {
torch.float32,
torch.float16,
torch.int8,
torch.qint8,
}
# Only allow int8 for quantization operations
if is_dynamic_qdq(node):
valid_dtypes.add(torch.int8)

if (
node.op != "placeholder"
and node.op != "call_function"
Expand Down
Loading