Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the appropriate backend DimensionNode visible to LTC core #77880

Open
Tracked by #77830
miladm opened this issue May 19, 2022 · 1 comment
Open
Tracked by #77830

Make the appropriate backend DimensionNode visible to LTC core #77880

miladm opened this issue May 19, 2022 · 1 comment
Assignees
Labels
lazy Lazy Tensor work items triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@miladm
Copy link
Collaborator

miladm commented May 19, 2022

🚀 The feature, motivation and pitch

With the current implementation of DimensionNode in LTC, each backend has its own implementation (PyTorch/XLA, TorchScript).

At the same time, shape inference builds off of LTC core classes leading to this PR failing to build shape inference implementation for expand.SymInt. Please make the appropriate backend DimensionNode visible to LTC core.

Solution alternatives based on offline chat with @Krovatkin.

  • IR core to access the correct backend implementation
  • Use multiple inheritance

CC @wconstab @JackCaoG

Alternatives

No response

Additional context

No response

@wconstab
Copy link
Contributor

Can we leverage the non-native IR codegen (#76535) to solve this, by making DimensionNode one of the generated IRs that backends own?

I guess that is orthogonal. That would be equivalent to the status quo, but save some code-duplication.

We could expand on the IR Builder interface to let backends build their own DimensionNode through a core/backend API.

@anjali411 anjali411 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label May 23, 2022
pytorchmergebot pushed a commit that referenced this issue Jun 29, 2022
Added support for `expand` in LazyTensor shape inference
Fixes #77831

---

**Blockers:**

- [x] #77880
- [x] #77882
Pull Request resolved: #77830
Approved by: https://github.com/Krovatkin
facebook-github-bot pushed a commit that referenced this issue Jun 30, 2022
…7830)

Summary:
Added support for `expand` in LazyTensor shape inference
Fixes #77831

 ---

**Blockers:**

- [x] #77880
- [x] #77882

Pull Request resolved: #77830
Approved by: https://github.com/Krovatkin

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/0922cc024eeafa2158c0d00396494a0ae983f8cb

Reviewed By: b0noI

Differential Revision: D37523035

fbshipit-source-id: 2e88e9a8a85c0a9e504fec92925cec0a05588892
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lazy Lazy Tensor work items triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: In Progress
Development

No branches or pull requests

4 participants