Skip to content

Conversation

@BruceDai
Copy link
Contributor

@BruceDai BruceDai commented Nov 25, 2025

This is a Spec change PR for #879 where we're discussing about the lack of widespread support for the current negative scale of dequantizeLinear and quantizeLinear across all backend.

@fdwr @reillyeon @huningxin PTAL, thanks!


Preview | Diff

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

👀

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

👍 LGTM after 2 comments.

@BruceDai BruceDai changed the title Restrict scale of dequantizeLinear and quantizeLinear to be positive Restrict scale's values of dequantizeLinear and quantizeLinear to be positive and nonzero Jan 16, 2026
Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

👍
(awaiting Phillis and Reilly before merging?)

**Arguments:**
- <dfn>input</dfn>: an {{MLOperand}}. The input tensor.
- <dfn>scale</dfn>: an {{MLOperand}}. The scale tensor to multiply each input value by after adjusting by the zero point. It must be [=blockwise broadcastable=] with the input.
- <dfn>scale</dfn>: an {{MLOperand}}. The scale tensor to multiply each input value by after adjusting by the zero point. It must be [=blockwise broadcastable=] with the input. Values must be positive and nonzero, or else behaviors are implementation dependent (e.g. correct results, incorrect results, compilation failure).
Copy link
Member

Choose a reason for hiding this comment

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

Use the phrase "implementation-defined".

Suggested change
- <dfn>scale</dfn>: an {{MLOperand}}. The scale tensor to multiply each input value by after adjusting by the zero point. It must be [=blockwise broadcastable=] with the input. Values must be positive and nonzero, or else behaviors are implementation dependent (e.g. correct results, incorrect results, compilation failure).
- <dfn>scale</dfn>: an {{MLOperand}}. The scale tensor to multiply each input value by after adjusting by the zero point. It must be [=blockwise broadcastable=] with the input. Values must be positive and nonzero, or else the behavior is [=implementation-defined=] (e.g. correct results, incorrect results or compilation failure).

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.

5 participants