Skip to content
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

[torch][quant] Support quantize and dequantize for torch #2731

Merged
merged 10 commits into from
Jan 13, 2024

Conversation

rsuderman
Copy link
Contributor

Handle both torch.dequantize and torch.quantize_per_tensor including
the op based quantization parameter tracking. This includes adding
qint32 to torch types as it was missing during the initial type
inclusion.

For testing we only have torch.int8 and torch.float types on
function boundaries as the qint8 types require passing the scale
and zero point quantization information which is not supported yet.

Handle both `torch.dequantize` and `torch.quantize_per_tensor` including
the op based quantization parameter tracking. This includes adding
`qint32` to torch types as it was missing during the initial type
inclusion.

For testing we only have `torch.int8` and `torch.float` types on
function boundaries as the `qint8` types require passing the scale
and zero point quantization information which is not supported yet.
Copy link
Collaborator

@qedawkins qedawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few nits.

lib/Conversion/TorchToLinalg/Uncategorized.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Uncategorized.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Uncategorized.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Uncategorized.cpp Outdated Show resolved Hide resolved
lib/Conversion/TorchToLinalg/Utils.cpp Outdated Show resolved Hide resolved
@rsuderman rsuderman merged commit dc37616 into llvm:main Jan 13, 2024
5 checks passed
@rsuderman rsuderman deleted the quant_dequant branch February 28, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants