Skip to content

Add dynamic shape support for lowbit kernels #1942

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

Merged
merged 3 commits into from
Mar 24, 2025
Merged

Add dynamic shape support for lowbit kernels #1942

merged 3 commits into from
Mar 24, 2025

Conversation

metascroy
Copy link
Contributor

To support dynamic shapes, the linear/embedding meta kernels must be written in python.

The packing meta kernels are still in C++ because 1) packing shapes are not dynamic, and 2) the packed size is not readily available in python. For these, I move to create meta tensors directly per #1936.

Summary:
Adds dynmaic shape support to linear op.
Copy link

pytorch-bot bot commented Mar 24, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 11 Pending

As of commit 6ca7454 with merge base 3fb1665 (image):

NEW FAILURE - The following job has failed:

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 Mar 24, 2025
Copy link

@jackzhxng jackzhxng left a comment

Choose a reason for hiding this comment

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

This makes sense to me from a high level, pending approval from someone from ao

k1 = 256
k2 = 128
k3 = 1024
weight_dtype = torch.int4

Choose a reason for hiding this comment

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

Maybe would be good to loop through and test all of the possible granularities from 2-7

Copy link

@jackzhxng jackzhxng left a comment

Choose a reason for hiding this comment

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

Synced offline, feel free to merge

@metascroy metascroy merged commit f3ff2e5 into main Mar 24, 2025
17 of 18 checks passed
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.

3 participants