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

Add support for lift_fresh op #1101

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build_tools/autogen_ltc_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ supported:

# ops required for functionalization
- lift
- lift_fresh
# Below are all operators that are "composite" in core,
# but require us to explicitly re-enable functionalization in order to use them.
# Why? These operators are all CompositeExplicitAutograd, which mean that they run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ at::Tensor LazyNativeFunctions::lift(const at::Tensor& tensor) {
return at::functionalization::impl::to_functional_tensor(tensor);
}

at::Tensor LazyNativeFunctions::lift_fresh(const at::Tensor& tensor) {
TORCH_INTERNAL_ASSERT(
!at::functionalization::impl::isFunctionalTensor(tensor));
return at::functionalization::impl::to_functional_tensor(tensor);
}

// All of the below ops correspond to CompositeExplicitAutograd kernels from core
// that call into view operators internally.
// These are all composite ops that LTC can technically re-use / get for free,
Expand Down