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

Bitpackingv2 #307

Merged
merged 16 commits into from
Jun 10, 2024
Merged

Bitpackingv2 #307

merged 16 commits into from
Jun 10, 2024

Conversation

vayuda
Copy link
Collaborator

@vayuda vayuda commented Jun 3, 2024

Improved code structure of the pack/unpack functions
Now supports trinary for bitnet applications
Now supports packing along any dimension for any size tensors
Now supports packing/unpacking elements such that lower indexed elements can be placed in the highest order bits or lowest order bits in the container

Copy link

pytorch-bot bot commented Jun 3, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit d9a94c8 with merge base 6a380a3 (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 Jun 3, 2024
Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

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

Left some feedback here and in cuda mode, my worry is this code will be slow so will need some benchmarks and it's a big loss to lose torch.compile support

test/prototype/test_bitpacking.py Show resolved Hide resolved
torchao/prototype/common/bitpacking.py Outdated Show resolved Hide resolved
test/prototype/test_bitpacking.py Outdated Show resolved Hide resolved
@msaroufim
Copy link
Member

Per cuda mode chat, let's just fix the merge conflict and ensure the perf isn't regressed on some microbenchmarks relative to code in main

@vayuda vayuda requested a review from msaroufim June 10, 2024 05:11
Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

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

few minor pieces of feedback: comments would be nice too

@vayuda vayuda requested a review from msaroufim June 10, 2024 16:55
@msaroufim msaroufim merged commit c38fc4a into main Jun 10, 2024
13 checks passed
@msaroufim msaroufim deleted the bitpackingv2 branch June 10, 2024 20:58
dbyoung18 pushed a commit to dbyoung18/ao that referenced this pull request Jul 31, 2024
* untested unified pack/unpack

* tests written, issues fixed

* removed conversion

* works with compile + use pytest params

* added hqq int4 fp16 mixed matmul benchmark for pack

* added more repeats for benchmark and removed unused vars

* added 1 more benchmark and now tests pass

* added order to unpack and updated tests

* removed main code and added a text example

* added example

* organized benchmarks
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.

4 participants