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

quant primitives: always set min val for scale #201

Merged
merged 3 commits into from
May 3, 2024

Conversation

jerryzh168
Copy link
Contributor

Summary:
This is to avoid div by 0 in quantize

Test Plan:
python test/quantization/test_quant_primitives.py -k test_choose_qparams_tensor_asym_eps

Reviewers:

Subscribers:

Tasks:

Tags:

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 1, 2024
@jerryzh168 jerryzh168 requested review from vkuzo and cpuhrsch May 1, 2024 22:07
Summary:
This is to avoid div by 0 in quantize

Test Plan:
python test/quantization/test_quant_primitives.py -k test_choose_qparams_tensor_asym_eps

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link
Contributor

@cpuhrsch cpuhrsch left a comment

Choose a reason for hiding this comment

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

Just see what happens if eps is less than machine epsilon and if clamp throws a warning etc.

Otherwise we might want to add a warning/exception if user passes an eps below scalar machine epsilon (else we divide by zero later).

@msaroufim msaroufim merged commit ec9d9d8 into pytorch:main May 3, 2024
6 of 11 checks passed
dbyoung18 pushed a commit to dbyoung18/ao that referenced this pull request Jul 31, 2024
Summary:
This is to avoid div by 0 in quantize

Test Plan:
python test/quantization/test_quant_primitives.py -k test_choose_qparams_tensor_asym_eps

Reviewers:

Subscribers:

Tasks:

Tags:
yanbing-j pushed a commit to yanbing-j/ao that referenced this pull request Dec 9, 2024
* add init file, as per Jez

* split fused weights
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants