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

metal lowbit kernels: split scales and zero points #1202

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

manuelcandales
Copy link
Contributor

Differential Revision: D65232787

Copy link

pytorch-bot bot commented Oct 30, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit e4211da with merge base 75f52ae (image):
💚 Looks good so far! There are no failures yet. 💚

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

@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 Oct 30, 2024
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D65232787

manuelcandales added a commit to manuelcandales/ao that referenced this pull request Oct 30, 2024
Summary: Pull Request resolved: pytorch#1202

Differential Revision: D65232787
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D65232787

manuelcandales added a commit to manuelcandales/ao that referenced this pull request Oct 30, 2024
Summary: Pull Request resolved: pytorch#1202

Differential Revision: D65232787
Copy link

@malfet malfet left a comment

Choose a reason for hiding this comment

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

Looks good to me, but can you provide some sort of perf numbers before and after.

@manuelcandales
Copy link
Contributor Author

manuelcandales commented Nov 11, 2024

Looks good to me, but can you provide some sort of perf numbers before and after.

I actually don't see any meaningful difference. The reported numbers below are averages over 100 runs each time, on an M1 Pro. The variability between obtained averages from run to run that I observe, is actually higher than the Before-After difference.

Before:

  • Elapsed time for lowbit quantized linear with type: float, nbit: 3, group size: 32, M x K x N: 1x4096x4096 is 0.000908661 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 4, group size: 32, M x K x N: 1x4096x4096 is 0.00259109 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 5, group size: 32, M x K x N: 1x4096x4096 is 0.000292051 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 3, group size: 64, M x K x N: 41x800x23 is 2.07762e-05 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 4, group size: 64, M x K x N: 41x800x23 is 2.0621e-05 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 5, group size: 64, M x K x N: 41x800x23 is 2.04623e-05 seconds

After:

  • Elapsed time for lowbit quantized linear with type: float, nbit: 3, group size: 32, M x K x N: 1x4096x4096 is 0.00093783 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 4, group size: 32, M x K x N: 1x4096x4096 is 0.002563 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 5, group size: 32, M x K x N: 1x4096x4096 is 0.000258747 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 3, group size: 64, M x K x N: 41x800x23 is 2.19558e-05 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 4, group size: 64, M x K x N: 41x800x23 is 2.1805e-05 seconds
  • Elapsed time for lowbit quantized linear with type: float, nbit: 5, group size: 64, M x K x N: 41x800x23 is 2.19417e-05 seconds

manuelcandales added a commit to manuelcandales/ao that referenced this pull request Nov 11, 2024
Summary: Pull Request resolved: pytorch#1202

Reviewed By: malfet

Differential Revision: D65232787
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D65232787

Summary: Pull Request resolved: pytorch#1202

Reviewed By: malfet

Differential Revision: D65232787
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D65232787

@metascroy metascroy added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Nov 11, 2024
@facebook-github-bot facebook-github-bot merged commit 657ebbb into pytorch:main Nov 11, 2024
20 of 21 checks passed
@jerryzh168 jerryzh168 added topic: not user facing Use this tag if you don't want this PR to show up in release notes and removed topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) labels Nov 11, 2024
sunjiweiswift pushed a commit to sunjiweiswift/ao that referenced this pull request Nov 25, 2024
Differential Revision: D65232787

Pull Request resolved: pytorch#1202
yanbing-j pushed a commit to yanbing-j/ao that referenced this pull request Dec 9, 2024
…tionalEmbeddings (pytorch#1202)

* update rope class

* remove old rope class
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. fb-exported topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants