mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
switch Bazel to the shared generate-code genrule (#75790)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/75790 We were building it before, but now we use it in downstream rules. This enables us to eliminate the handwritten genrule. ghstack-source-id: 155300051 Test Plan: Verified locally and in CI. Reviewed By: dreiss Differential Revision: D35645390 fbshipit-source-id: 478bb37a6ec295c232f66383babf46606e83ed5e (cherry picked from commit 2822d4c5b48c6d9282149b2d43cf72d645237196)
This commit is contained in:
parent
096ff0ecca
commit
ac45fb9b93
2 changed files with 5 additions and 26 deletions
22
BUILD.bazel
22
BUILD.bazel
|
|
@ -148,33 +148,15 @@ libtorch_python_generated_sources = [
|
|||
"torch/csrc/autograd/generated/python_return_types.cpp",
|
||||
]
|
||||
|
||||
genrule(
|
||||
name = "all_generated_code",
|
||||
srcs = [
|
||||
"aten/src/ATen/native/native_functions.yaml",
|
||||
"aten/src/ATen/native/tags.yaml",
|
||||
"aten/src/ATen/native/ts_native_functions.yaml",
|
||||
"torch/csrc/lazy/core/shape_inference.h",
|
||||
"torch/csrc/lazy/ts_backend/ts_native_functions.cpp",
|
||||
"aten/src/ATen/templates/DispatchKeyNativeFunctions.cpp",
|
||||
"aten/src/ATen/templates/DispatchKeyNativeFunctions.h",
|
||||
"aten/src/ATen/templates/RegisterDispatchKey.cpp",
|
||||
"aten/src/ATen/templates/LazyIr.h",
|
||||
],
|
||||
outs = libtorch_cpp_generated_sources + libtorch_python_generated_sources,
|
||||
cmd = "$(location //tools/setup_helpers:generate_code) --install_dir `dirname $(location torch/csrc/autograd/generated/variable_factories.h)`/../.. --native-functions-path $(location aten/src/ATen/native/native_functions.yaml) --tags-path $(location aten/src/ATen/native/tags.yaml) --gen_lazy_ts_backend",
|
||||
tools = ["//tools/setup_helpers:generate_code"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "cpp_generated_code",
|
||||
data = [":all_generated_code"],
|
||||
data = [":generate-code"],
|
||||
srcs = libtorch_cpp_generated_sources,
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "python_generated_code",
|
||||
data = [":all_generated_code"],
|
||||
data = [":generate-code"],
|
||||
srcs = libtorch_python_generated_sources,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -42,12 +42,6 @@ def define_targets(rules):
|
|||
"--native-functions-path $(location :native_functions.yaml) " +
|
||||
"--tags-path=$(location :tags.yaml) " +
|
||||
"--gen_lazy_ts_backend",
|
||||
tags = [
|
||||
# Filter this target out for Bazel until we are ready to
|
||||
# use it. When we refactor this for fbcode it will start
|
||||
# to conflict with the Bazel code generator.
|
||||
"-bazel",
|
||||
],
|
||||
)
|
||||
|
||||
rules.genrule(
|
||||
|
|
@ -117,4 +111,7 @@ _GENERATED_CPP = [
|
|||
"torch/csrc/autograd/generated/python_torch_functions_1.cpp",
|
||||
"torch/csrc/autograd/generated/python_torch_functions_2.cpp",
|
||||
"torch/csrc/autograd/generated/python_variable_methods.cpp",
|
||||
"torch/csrc/lazy/generated/LazyNativeFunctions.cpp",
|
||||
"torch/csrc/lazy/generated/RegisterAutogradLazy.cpp",
|
||||
"torch/csrc/lazy/generated/RegisterLazy.cpp",
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue