Skip to content

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Oct 2, 2025

Summary:

This is useful for vLLM 2d -> 3d MoE weight surgery

Test Plan:

unit tests:

pytest test/prototype/mx_formats/ -s

Also, after this PR we can run a Qwen 1.5 MoE model quantized with nvfp4
in vLLM, with vllm-project/vllm#25480

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@vkuzo
Copy link
Contributor Author

vkuzo commented Oct 2, 2025

vkuzo added a commit that referenced this pull request Oct 2, 2025
Summary:

This is useful for vLLM 2d -> 3d MoE weight surgery

Test Plan:

unit tests:
```
pytest test/prototype/mx_formats/ -s
```

Also, after this PR we can run a Qwen 1.5 MoE model quantized with nvfp4
in vLLM, with vllm-project/vllm#25480

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: db79143
ghstack-comment-id: 3361104836
Pull-Request: #3117
Copy link

pytorch-bot bot commented Oct 2, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit b245367 with merge base 8955739 (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 Oct 2, 2025
@vkuzo vkuzo added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Oct 2, 2025
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Oct 2, 2025
Summary:

This is useful for vLLM 2d -> 3d MoE weight surgery

Test Plan:

unit tests:
```
pytest test/prototype/mx_formats/ -s
```

Also, after this PR we can run a Qwen 1.5 MoE model quantized with nvfp4
in vLLM, with vllm-project/vllm#25480

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 6d7d385
ghstack-comment-id: 3361104836
Pull-Request: #3117
new = old.__class__(
old.qdata[index],
old._scale_e4m3[index],
old._block_size,
Copy link
Contributor

Choose a reason for hiding this comment

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

should a dim get knocked off block size after you select?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently block_size is an integer for this tensor, 16 for NVFP4. If we change it to a multidimensional block, we'd have to update this code.

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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants