Skip to content

Conversation

@vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Aug 18, 2025

Summary:

Switches NVFP4Tensor to inherit from TorchAOBaseTensor, and removes the
custom tensor flatten/unflatten to use the base class version.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

vkuzo added 2 commits August 18, 2025 08:15
[ghstack-poisoned]
[ghstack-poisoned]
@vkuzo
Copy link
Contributor Author

vkuzo commented Aug 18, 2025

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 18, 2025

🔗 Helpful Links

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

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

⏳ 5 Pending, 6 Unrelated Failures

As of commit b7d6069 with merge base 4463b79 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

vkuzo added a commit that referenced this pull request Aug 18, 2025
Summary:

Switches NVFP4Tensor to inherit from TorchAOBaseTensor, and removes the
custom tensor flatten/unflatten to use the base class version.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 5ba0e97
ghstack-comment-id: 3197347073
Pull-Request: #2788
@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 Aug 18, 2025
@vkuzo vkuzo added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label Aug 18, 2025
vkuzo added 2 commits August 18, 2025 09:25
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Aug 18, 2025
Summary:

Switches NVFP4Tensor to inherit from TorchAOBaseTensor, and removes the
custom tensor flatten/unflatten to use the base class version.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
ghstack-source-id: 0074ace
ghstack-comment-id: 3197347073
Pull-Request: #2788
_is_swizzled_scales: bool
mm_config: NVFP4MMConfig
use_triton_kernel: bool
tensor_data_names = ["qdata", "_scale_e4m3"]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove underscores?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not related to current PR, we can do this in a future PR

Copy link
Contributor

Choose a reason for hiding this comment

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

from a typehint / ide experience this kinda sucks

is it not possible to have the actual attributes typehinted on the class w/ AOBaseTensor?

Copy link
Contributor

Choose a reason for hiding this comment

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

we can try to do that as an improvement for future maybe, not sure how to do that yet, maybe we can do some inspection

[ghstack-poisoned]
if maybe_tensor is not None:
tensor_data_names.append(tensor_data_name)

# TODO(future PR): also return names of tensor attributes for easier
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if we could change it, that's what we've been using in the past

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 think it's worth changing, right now it's a list of attribute values without the names, which is way harder to debug than a key:value dictionary.

[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/108/head to main August 18, 2025 22:53
@vkuzo vkuzo merged commit c120bb7 into main Aug 18, 2025
35 of 45 checks passed
liangel-02 pushed a commit that referenced this pull request Aug 25, 2025
* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]

* Update

[ghstack-poisoned]
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: not user facing Use this tag if you don't want this PR to show up in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants