Skip to content

Add dynamic shape support for lowbit kernels#1942

Merged
metascroy merged 3 commits into
mainfrom
dynamic-shape
Mar 24, 2025
Merged

Add dynamic shape support for lowbit kernels#1942
metascroy merged 3 commits into
mainfrom
dynamic-shape

Conversation

@metascroy

Copy link
Copy Markdown
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.
@pytorch-bot

pytorch-bot Bot commented Mar 24, 2025

Copy link
Copy Markdown

🔗 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

@jackzhxng jackzhxng left a comment

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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

@jackzhxng jackzhxng left a comment

Copy link
Copy Markdown

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
liangel-02 pushed a commit that referenced this pull request Aug 25, 2025
* Init

Summary:
Adds dynmaic shape support to linear op.

* up

* up
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