Skip to content

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Sep 25, 2025

Summary:

Fix printing of linear weight wrapped with MXTensor.

Test Plan:

quantize a Qwen MoE model with mxfp4 and print it

old version would print the data for each weight

new version prints this:

        (self_attn): Qwen2MoeSdpaAttention(
          (q_proj): Linear(in_features=2048, out_features=2048, weight=MXTensor(self._elem_dtype=torch.float4_e2m1fn_x2, self._block_size=32, torch.bfloat16, MXGemmKernelChoice.EMULATED,
self.act_quant_kwargs=QuantizeTensorToMXKwargs(elem_dtype=torch.float4_e2m1fn_x2, block_size=32, scaling_mode=<ScaleCalculationMode.FLOOR: 'floor'>, gemm_kernel_choice=<MXGemmKernelChoice.EMULATED: 'emulated'>,
pack_fp6=False)))

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
Copy link

pytorch-bot bot commented Sep 25, 2025

🔗 Helpful Links

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

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

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 25, 2025
vkuzo added a commit that referenced this pull request Sep 25, 2025
Summary:

Fix printing of linear weight wrapped with MXTensor.

Test Plan:

quantize a Qwen MoE model with mxfp4 and print it

old version would print the data for each weight

new version prints this:

```python
        (self_attn): Qwen2MoeSdpaAttention(
          (q_proj): Linear(in_features=2048, out_features=2048, weight=MXTensor(self._elem_dtype=torch.float4_e2m1fn_x2, self._block_size=32, torch.bfloat16, MXGemmKernelChoice.EMULATED,
self.act_quant_kwargs=QuantizeTensorToMXKwargs(elem_dtype=torch.float4_e2m1fn_x2, block_size=32, scaling_mode=<ScaleCalculationMode.FLOOR: 'floor'>, gemm_kernel_choice=<MXGemmKernelChoice.EMULATED: 'emulated'>,
pack_fp6=False)))
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: fc9e992
ghstack-comment-id: 3336009172
Pull Request resolved: #3068
@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 Sep 25, 2025
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/121/head to main September 26, 2025 19:31
@vkuzo vkuzo merged commit 752502b into main Sep 26, 2025
35 of 45 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants