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

Remove assert on zero_point dtype of quantize/dequantize op #6475

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

lsy323
Copy link
Collaborator

@lsy323 lsy323 commented Feb 6, 2024

Per the current PT2E implementation, the dtype of zp will always be in torch.int64 ref. From the math calculating the zp, it will always be within the bound ref.

  • Remove assertion on zero_point to have the same dtype as the quantized integer dtype. Assert the dtype has to be integer point.
  • Per StableHLO spec on the quantized tensor ref (C8) storage_min <= zero_points <= storage_max, add the assertion on the range of zero_point.

cc @sdasgup3 @paulinesho

@lsy323 lsy323 requested a review from qihqi February 6, 2024 00:33
@lsy323 lsy323 requested a review from sdasgup3 February 6, 2024 21:04
@lsy323 lsy323 merged commit 8128480 into master Feb 6, 2024
18 checks passed
amithrm pushed a commit to amithrm/xla that referenced this pull request Mar 1, 2024
@lsy323 lsy323 deleted the lsiyuan/remove-dq-dtype-assertion branch March 4, 2024 19:13
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