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

[WIP] speed up CodebookQuantizedTensor inference #1607

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DerekLiu35
Copy link
Contributor

This PR tries to speedup inference for #1195

Currently I've ported code1x16 matrix multiplication kernels from AQLM to torchao

Usage

Demo notebook with preliminary tests

  • Preliminary tests show a ~2x speedup for linear layer compared to the fallback implementation.
  • Matches AQLM's performance for (1, 8) block sizes
  • quantization error of kernel seems much higher than fallback implementation, need to investigate more

ToDo

  • Improve performance for block sizes of (1, 1).
  • Add triton fall back for other block sizes
  • Add tests.
  • Update benchmarks

Would appreciate feedback on approach and preliminary results
@jerryzh168 @pawarmanasi07

Copy link

pytorch-bot bot commented Jan 23, 2025

🔗 Helpful Links

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

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

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 Jan 23, 2025
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.

2 participants