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

Add floating point options for autoquant and add accuracy measurement #1355

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

jerryzh168
Copy link
Contributor

Summary:

  • This PR adds float32/float16/bfloat16 as a list of options for autoquant, it converts input/weight/bias/output to the specified dtype
  • Also adds min_sqnr (https://en.wikipedia.org/wiki/Signal-to-quantization-noise_ratio) to allow users to filter out the quantization methods that has large numerical impact compared to original output

Note that we use random generated input activation right now, we can improve this by adding the support for using real inputs

Test Plan:
python generate.py --checkpoint_path $CHECKPOINT_PATH/$MODEL_REPO/model.pth --compile --compile_prefill --quantization autoquant-fp

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:
* This PR adds float32/float16/bfloat16 as a list of options for autoquant, it converts input/weight/bias/output to the specified dtype
* Also adds min_sqnr (https://en.wikipedia.org/wiki/Signal-to-quantization-noise_ratio) to allow users to
filter out the quantization methods that has large numerical impact compared to original output

Note that we use random generated input activation right now, we can improve this by adding the support
for using real inputs

Test Plan:
python generate.py --checkpoint_path $CHECKPOINT_PATH/$MODEL_REPO/model.pth --compile --compile_prefill --quantization autoquant-fp

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link

pytorch-bot bot commented Nov 27, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1355

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit b1ced92 with merge base 478d15b (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@jerryzh168 jerryzh168 requested a review from cpuhrsch November 27, 2024 02:13
@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 Nov 27, 2024
@jerryzh168 jerryzh168 requested a review from HDCharles November 27, 2024 02:13
@jerryzh168 jerryzh168 added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Nov 27, 2024
@jerryzh168 jerryzh168 merged commit 543209b into pytorch:main Nov 27, 2024
18 checks passed
@jerryzh168 jerryzh168 deleted the add-fp-list branch November 27, 2024 03:54
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. topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants