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

Enable AOTI shim v2 build and add into libtorch #125211

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions buckbuild.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def get_aten_generated_files(enabled_backends):
"core/TensorMethods.cpp",
"core/aten_interned_strings.h",
"core/enum_tag.h",
"torch/csrc/inductor/aoti_torch/generated/c_shim_cpu.cpp",
] + get_aten_derived_type_srcs(enabled_backends)

# This is tiresome. A better strategy would be to unconditionally
Expand Down Expand Up @@ -467,6 +468,7 @@ def gen_aten_files(
cmd = "$(exe {}torchgen:gen) ".format(ROOT_PATH) + " ".join([
"--source-path $(location {}:aten_src_path)/aten/src/ATen".format(ROOT),
"--install_dir $OUT",
"--aoti_install_dir $OUT/torch/csrc/inductor/aoti_torch/generated"
] + extra_params),
visibility = visibility,
compatible_with = compatible_with,
Expand Down
7 changes: 7 additions & 0 deletions build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def define_targets(rules):
"$(execpath //torchgen:gen)",
"--install_dir=$(RULEDIR)",
"--source-path aten/src/ATen",
"--aoti_install_dir=$(RULEDIR)/torch/csrc/inductor/aoti_torch/generated"
] + (["--static_dispatch_backend CPU"] if rules.is_cpu_static_dispatch_build() else []))

gen_aten_outs_cuda = (
Expand All @@ -83,6 +84,7 @@ def define_targets(rules):
gen_aten_outs = (
GENERATED_H + GENERATED_H_CORE +
GENERATED_CPP + GENERATED_CPP_CORE +
GENERATED_AOTI_CPP +
aten_ufunc_generated_cpu_sources() +
aten_ufunc_generated_cpu_kernel_sources() + [
"Declarations.yaml",
Expand Down Expand Up @@ -316,3 +318,8 @@ GENERATED_AUTOGRAD_CPP = [
"torch/csrc/lazy/generated/RegisterAutogradLazy.cpp",
"torch/csrc/lazy/generated/RegisterLazy.cpp",
] + _GENERATED_AUTOGRAD_CPP_HEADERS + GENERATED_LAZY_H

GENERATED_AOTI_CPP = [
"torch/csrc/inductor/aoti_torch/generated/c_shim_cpu.cpp",
"torch/csrc/inductor/aoti_torch/generated/c_shim_cuda.cpp",
]