mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[MTIA ATen Backend] Migrate "_unsafe_view" and "view" ops from out-of-tree to pytorch in-tree (#153670)
Summary: # Context The MTIA New Aten Backend work is essentially to move MTIA operators from pytorch out-of-tree to in-tree, with following benefits: 1. Avoid duplicate code copied from pytorch, e.g. view ops implementation, util functions. 2. Utilize TensorIterator and structured kernel codegen, avoid manual implementation of broadcasting, dtype casting, asserting, etc. 3. Eliminate MTIA's own codegen flow, which is unnecessary complexity. 4. Overall make MTIA's aten backend more pytorch native. Differential Revision: D74672464 Pull Request resolved: https://github.com/pytorch/pytorch/pull/153670 Approved by: https://github.com/albanD, https://github.com/nautsimon
This commit is contained in:
committed by
PyTorch MergeBot
parent
dcb3edd30d
commit
a636a92ee9
13
build.bzl
13
build.bzl
@ -79,6 +79,8 @@ def define_targets(rules):
|
||||
aten_ufunc_generated_cuda_sources()
|
||||
)
|
||||
|
||||
gen_aten_outs_mtia = GENERATED_H_MTIA + GENERATED_CPP_MTIA
|
||||
|
||||
gen_aten_outs = (
|
||||
GENERATED_H + GENERATED_H_CORE +
|
||||
GENERATED_CPP + GENERATED_CPP_CORE +
|
||||
@ -86,7 +88,7 @@ def define_targets(rules):
|
||||
aten_ufunc_generated_cpu_sources() +
|
||||
aten_ufunc_generated_cpu_kernel_sources() + [
|
||||
"Declarations.yaml",
|
||||
] + gen_aten_outs_cuda
|
||||
] + gen_aten_outs_cuda + gen_aten_outs_mtia
|
||||
)
|
||||
|
||||
rules.genrule(
|
||||
@ -208,6 +210,15 @@ GENERATED_CPP_CUDA = [
|
||||
"RegisterQuantizedCUDA_0.cpp",
|
||||
]
|
||||
|
||||
GENERATED_H_MTIA = [
|
||||
"MTIAFunctions.h",
|
||||
"MTIAFunctions_inl.h",
|
||||
]
|
||||
|
||||
GENERATED_CPP_MTIA = [
|
||||
"RegisterMTIA_0.cpp",
|
||||
]
|
||||
|
||||
GENERATED_CPP = [
|
||||
"Functions.cpp",
|
||||
"RegisterBackendSelect.cpp",
|
||||
|
Reference in New Issue
Block a user