Skip to content

Conversation

@alanwaketan
Copy link
Collaborator

Summary:
This is the first part to remove the whole view and aliasing infrastructure in LTC, which is deprecated in favor of functionalization. It mainly removes things that use lazy::View.

Test Plan:
CI

Summary:
This is the first part to remove the whole view and aliasing infrastructure
in LTC, which is deprecated in favor of functionalization. It mainly removes
things that use lazy::View.

Test Plan:
CI
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 26, 2022

🔗 Helpful Links

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

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

✅ No Failures

As of commit 5836e21:
💚 Looks good so far! There are no failures yet. 💚

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

Copy link
Collaborator

@antoniojkim antoniojkim left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me. Just one comment

typedef SSIZE_T ssize_t;
#endif

void LazyGraphExecutor::BuildInputOutputAliases(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this not something that is needed in PyTorch/XLA? Why is it being removed? CC: @JackCaoG

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh yea, I missed this. There has been some changes on our end of BuildInputOutputAliases since we now wrpas input parameter if it is too big. I think we can keep it for now but will need to circle back and update this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm... Yea, I just remember TSBackend never uses this and the XLA one has diverged a lot already. @antoniojkim Does MLIR use this? If not, I don't know what to keep there? Upstream the latest XLA implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We're not currently using this in Torch-MLIR. We found that the functionalization pass broke this function's ability to properly map the inputs to the outputs. So, we are currently using a custom MLIR specific solution. If PyTorch/XLA is not using it, we can remove it.

Can you point me to the latest XLA implemention? Maybe its something we can use in Torch-MLIR as well if its upstreamed

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is interesting, we need to make sure input_output_aliasing works, otherwise we will take a huge hit on memory. new version is in https://github.com/pytorch/xla/pull/3920/files#diff-17ef64dc5ef931bed0cb0d971cf537a610e90a9b4351658d6587ff59448f0f87, I don't think it will be too relevant to you guys. It is mostly updated because we need to wrap entry hlo compuation sometimes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's remove it for now then, we can reimplement it and test it again once we transitioned to functionization.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@wonjoolee95 Just a heads up.

Copy link
Collaborator

@JackCaoG JackCaoG left a comment

Choose a reason for hiding this comment

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

Thanks!

@antoniojkim antoniojkim requested a review from JackCaoG October 26, 2022 23:21
alanwaketan added a commit to pytorch/xla that referenced this pull request Oct 27, 2022
Summary:
This is a companion pull request to pytorch/pytorch#87822 which removes
the view/aliasing infrastructure from LTC.

Test Plan:
CI
@alanwaketan alanwaketan requested a review from a team as a code owner October 27, 2022 00:58
Copy link
Contributor

@wconstab wconstab left a comment

Choose a reason for hiding this comment

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

nice. -1000 LOC :)

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 27, 2022
@alanwaketan
Copy link
Collaborator Author

Thanks Will, Jack and Antonio for reviewing the pull request.

@alanwaketan
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
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

@github-actions
Copy link
Contributor

Hey @alanwaketan.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

alanwaketan added a commit to pytorch/xla that referenced this pull request Oct 27, 2022
Summary:
This is a companion pull request to pytorch/pytorch#87822 which removes
the view/aliasing infrastructure from LTC.

Test Plan:
CI
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Nov 5, 2022
Summary:
This is the first part to remove the whole view and aliasing infrastructure in LTC, which is deprecated in favor of functionalization. It mainly removes things that use lazy::View.

Test Plan:
CI

Pull Request resolved: pytorch#87822
Approved by: https://github.com/JackCaoG, https://github.com/antoniojkim, https://github.com/wconstab
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Dec 10, 2022
Summary:
This is the first part to remove the whole view and aliasing infrastructure in LTC, which is deprecated in favor of functionalization. It mainly removes things that use lazy::View.

Test Plan:
CI

Pull Request resolved: pytorch#87822
Approved by: https://github.com/JackCaoG, https://github.com/antoniojkim, https://github.com/wconstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants