Thanks to visit codestin.com
Credit goes to github.com

Skip to content

support select.int for Float8Tensor#3053

Merged
vkuzo merged 1 commit intomainfrom
20250924_float8_tensor_index_select
Sep 25, 2025
Merged

support select.int for Float8Tensor#3053
vkuzo merged 1 commit intomainfrom
20250924_float8_tensor_index_select

Conversation

@vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Sep 24, 2025

Summary:

This is useful for stitching together 2D weights to a 3D weight, specifically this happens in vLLM for HF models where expert weights are 2D.

Test Plan:

pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -x -s -k index

Reviewers:

Subscribers:

Tasks:

Tags:

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 24, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 6bb3ebd with merge base 8e2ca35 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla 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 Sep 24, 2025
@vkuzo vkuzo added the topic: bug fix Use this tag for PRs that fix bugs label Sep 24, 2025
@vkuzo vkuzo requested a review from jerryzh168 September 24, 2025 13:55
def _(func, types, args, kwargs):
old_float8_tensor, dim, index = args
assert dim == 0, f"Float8Tensor aten.select.int with {dim=} is not yet supported"
new_float8_tensor = old_float8_tensor.__class__(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: is it better to use Float8Tensor directly here? or old_float8_tensor.__class__? we have been using Float8Tensor in other functions so far

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used the syntax in the function right above which uses __class__, so I guess there is already a mix? If we want consistency, maybe we can do a codemod in a future PR.

Summary:

This is useful for stitching together 2D weights to a 3D weight,
specifically this happens in vLLM for HF models where expert weights are
2D.

Test Plan:

```bash
pytest test/quantization/quantize_/workflows/float8/test_float8_tensor.py -x -s -k index
```

Reviewers:

Subscribers:

Tasks:

Tags:
@vkuzo vkuzo force-pushed the 20250924_float8_tensor_index_select branch from 95f42d0 to 6bb3ebd Compare September 25, 2025 11:00
@vkuzo vkuzo merged commit 4426838 into main Sep 25, 2025
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. topic: bug fix Use this tag for PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments