Skip to content

Conversation

@JackCaoG
Copy link
Collaborator

@JackCaoG JackCaoG commented Jul 8, 2022

No description provided.

@JackCaoG JackCaoG added the tracing Lazy Tensor tracing label Jul 8, 2022
@JackCaoG JackCaoG requested a review from wonjoo-wj July 8, 2022 23:03
@JackCaoG
Copy link
Collaborator Author

@wonjoolee95 I think this one is ready for review. GPU failure is something else.

@JackCaoG JackCaoG force-pushed the ir_builder_in_backend_intf branch from c159234 to 3c92100 Compare July 13, 2022 03:13
Copy link
Collaborator

@wonjoo-wj wonjoo-wj left a comment

Choose a reason for hiding this comment

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

Thanks!

const torch::lazy::Value& input0,
const std::vector<int64_t>& output_size) const override {
return torch::lazy::MakeNode<ViewOp>(input0, output_size);
// TODO(JackCAoG): use functionization pass instead
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: why are we changing this to functionization pass?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so after functionization pass, we no longer see the view operator, all of the view op becomes a new view_copy op. The complicated part of view is that they should share the same memory space. This is not possible for pytorch/xla right now because XLA does not expose its memory space to user. What we did is we create two node and whenever an in place operaton being done on one of the op, we replay that operation to the other node(after reshape).

after functionization pass, we no longer need to maintain this relationship in pytorch/xla layer. We can treat view op like any other op. PyTorch core will handle to apply the same in_place operation to the Node that are views of each other.

@JackCaoG JackCaoG merged commit fd4151b into master Jul 15, 2022
@JackCaoG JackCaoG deleted the ir_builder_in_backend_intf branch July 15, 2022 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tracing Lazy Tensor tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants