Skip to content

Remove unwrap_tensor_subclass - #462

Closed
jerryzh168 wants to merge 1 commit into
pytorch:mainfrom
jerryzh168:remove-unwrap
Closed

jerryzh168 wants to merge 1 commit into
pytorch:mainfrom
jerryzh168:remove-unwrap

Conversation

@jerryzh168

Copy link
Copy Markdown
Contributor

Summary:
unwrap_tensor_subclass is incorporated in export stack natively after pytorch/pytorch#127431 so we can remove this workaround now

Test Plan:
python test/quantization/test_quant_api.py
python test/integration/test_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:

@pytorch-bot

pytorch-bot Bot commented Jul 1, 2024 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 1 Unrelated Failure

As of commit 5e79ca8 with merge base 39b02de (image):

NEW FAILURE - The following job has failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 Jul 1, 2024
msaroufim
msaroufim previously approved these changes Jul 1, 2024
@huydhn

huydhn commented Jul 1, 2024

Copy link
Copy Markdown
Contributor

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: PR #462 has not been reviewed yet

Details for Dev Infra team Raised by workflow job

Failing merge rule: superuser

Summary:
`unwrap_tensor_subclass` is incorporated in export stack natively after pytorch/pytorch#127431
so we can remove this workaround now

Test Plan:
python test/quantization/test_quant_api.py
python test/integration/test_integration.py

Reviewers:

Subscribers:

Tasks:

Tags:
Comment thread torchao/utils.py
"""Unwraps (nested) tensor subclass in the model to plain tensors
This is a workaround to make a model with tensor subclass to work with `torch.export.export`
and `torch.aot_compile`, we hope this can be integrated into compile stack soon
tracking issue: https://github.com/pytorch/ao/issues/345

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh @jerryzh168 I think you still need this logic.

To clarify, there are two separate PRs/issues:

(1) nested subclass support here: pytorch/pytorch#127431. This PR allows for "nested wrapper subclasses at the graph boundaries", so e.g. we now support DTensor(Float8Tensor) as a graph input to torch.compile).

(2) what I think is relevant to this PR, is that we eventually want to take the parametrization logic you have here and upstream it directly into export so it can happen automatically and you don't need to do it manually before exporting / running AOTI. This is not currently fixed, but I recently filed a tracker issue for it (with a float8 repro) here: pytorch/pytorch#129682. @tugsbayasgalan is going to be picking it up soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah I see, OK I can wait until pytorch/pytorch#129682 is resolved as well

@bhack

bhack commented Dec 6, 2024

Copy link
Copy Markdown

Is this still in the roadmap?

yanbing-j pushed a commit to yanbing-j/ao that referenced this pull request Dec 9, 2024
@jerryzh168

Copy link
Copy Markdown
Contributor Author

yeah, this is going to be unblocked/fixed by pytorch/pytorch#141941

@bhack

bhack commented Jan 9, 2025

Copy link
Copy Markdown

yeah, this is going to be unblocked/fixed by pytorch/pytorch#141941

I think that it is merged right?

@jerryzh168

jerryzh168 commented Jan 9, 2025 •

Copy link
Copy Markdown
Contributor Author

yes, I'm skipping this in tests for torch 2.7 dev version and later: #1531

Edit: landed now, please try again to see if the issue is fixed in 2.7 @bhack

@jerryzh168 jerryzh168 closed this Jan 9, 2025
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants