Skip to content

Add slicing support for fbgemm fp8 and int4 #2308

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 1 commit into from
Jun 6, 2025

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Jun 5, 2025

Summary:
att, this is needed in vllm
Note that irregular shapes will require padding, which is not implemented right now, we can add that if it's required by the model

Test Plan:

python test/dtypes/test_fbgemm_fp8.py -k test_slice 
python test/dtypes/test_fbgemm_int4.py -k test_slice

Reviewers:

Subscribers:

Tasks:

Tags:

Copy link

pytorch-bot bot commented Jun 5, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit f9c6195 with merge base 35ffb26 (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 5, 2025
@jerryzh168 jerryzh168 added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Jun 5, 2025


@implements(aten.slice.Tensor)
def _(func, types, args, kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a doc block here on what is supported and the semantics this code is not that easy to grok

Summary:
att, this is needed in vllm
Note that irregular shapes will require padding, which is not implemented right now, we can add that
if it's required by the model

Test Plan:
python test/dtypes/test_fbgemm_fp8.py -k test_slice
python test/dtypes/test_fbgemm_int4.py -k test_slice

Reviewers:

Subscribers:

Tasks:

Tags:
@jerryzh168 jerryzh168 merged commit 4235837 into pytorch:main Jun 6, 2025
19 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. topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories)
3 participants