Skip to content

Commit 501d072

Browse files
Michael Andreas Dagitsespytorchmergebot
Michael Andreas Dagitses
authored andcommitted
move build_variables.bzl and ufunc_defs.bzl from pytorch-root/tools/ to the root
Pull Request resolved: pytorch#78542 This makes importing easier in different build systems that have different absolute names for the pytorch-root. Differential Revision: [D36782582](https://our.internmc.facebook.com/intern/diff/D36782582/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D36782582/)! Approved by: https://github.com/malfet
1 parent 5ef378a commit 501d072

8 files changed

+12
-13
lines changed

BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
44
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "cc_test")
55
load("//third_party:substitution.bzl", "header_template_rule")
66
load("//:tools/bazel.bzl", "rules")
7-
load("//:tools/build_variables.bzl", "jit_core_sources", "libtorch_core_sources", "libtorch_cuda_sources", "libtorch_distributed_sources", "libtorch_extra_sources", "libtorch_nvfuser_generated_headers", "libtorch_nvfuser_runtime_sources", "libtorch_python_core_sources", "torch_cpp_srcs", "lazy_tensor_ts_sources")
87
load("//tools/rules:cu.bzl", "cu_library")
98
load("//tools/config:defs.bzl", "if_cuda")
109
load("//:aten.bzl", "intern_build_aten_ops", "generate_aten", "aten_ufunc_generated_cpu_sources", "aten_ufunc_generated_cpu_kernel_sources", "aten_ufunc_generated_cuda_sources")
1110
load(":build.bzl", "define_targets", "GENERATED_AUTOGRAD_CPP", "GENERATED_AUTOGRAD_PYTHON")
11+
load(":build_variables.bzl", "jit_core_sources", "libtorch_core_sources", "libtorch_cuda_sources", "libtorch_distributed_sources", "libtorch_extra_sources", "libtorch_nvfuser_generated_headers", "libtorch_nvfuser_runtime_sources", "libtorch_python_core_sources", "torch_cpp_srcs", "lazy_tensor_ts_sources")
1212

1313
define_targets(rules = rules)
1414

BUILD.buck

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
load("//tools/build_defs:glob_defs.bzl", "subdir_glob")
22
load("//tools/build_defs:fb_xplat_genrule.bzl", "fb_xplat_genrule")
33
load(
4-
"//tools:build_variables.bzl",
4+
":build_variables.bzl",
55
"aten_cpu_source_list",
66
"aten_native_source_list",
77
"core_sources_common",
@@ -10,7 +10,7 @@ load(
1010
"libtorch_profiler_sources",
1111
)
1212
load(
13-
"//:pt_defs.oss.bzl",
13+
":pt_defs.oss.bzl",
1414
"USED_PT_BACKENDS",
1515
"build_aten_cpu",
1616
"gen_aten_files",

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ include CITATION
44
include LICENSE
55
include NOTICE
66
include .gitmodules
7+
include build_variables.bzl
78
include mypy.ini
89
include requirements.txt
10+
include ufunc_defs.bzl
911
include version.txt
1012
recursive-include android *.*
1113
recursive-include aten *.*

aten.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@bazel_skylib//lib:paths.bzl", "paths")
22
load("@rules_cc//cc:defs.bzl", "cc_library")
3-
load("//:tools/build_variables.bzl", "aten_ufunc_headers")
3+
load(":build_variables.bzl", "aten_ufunc_headers")
44

55
CPU_CAPABILITY_NAMES = ["DEFAULT", "AVX2"]
66
CAPABILITY_COMPILER_FLAGS = {
File renamed without changes.

cmake/Codegen.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ function(append_filelist name outputvar)
349349
set(_rootdir "${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/")
350350
# configure_file adds its input to the list of CMAKE_RERUN dependencies
351351
configure_file(
352-
${PROJECT_SOURCE_DIR}/tools/build_variables.bzl
352+
${PROJECT_SOURCE_DIR}/build_variables.bzl
353353
${PROJECT_BINARY_DIR}/caffe2/build_variables.bzl)
354354
execute_process(
355355
COMMAND "${PYTHON_EXECUTABLE}" -c
356-
"exec(open('${PROJECT_SOURCE_DIR}/tools/build_variables.bzl').read());print(';'.join(['${_rootdir}' + x for x in ${name}]))"
356+
"exec(open('${PROJECT_SOURCE_DIR}/build_variables.bzl').read());print(';'.join(['${_rootdir}' + x for x in ${name}]))"
357357
WORKING_DIRECTORY "${_rootdir}"
358358
RESULT_VARIABLE _retval
359359
OUTPUT_VARIABLE _tempvar)

pt_defs.oss.bzl

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
load("@bazel_skylib//lib:paths.bzl", "paths")
2+
load("//tools/build_defs:fb_xplat_genrule.bzl", "fb_xplat_genrule")
3+
load("//tools/build_defs:type_defs.bzl", "is_list", "is_string")
4+
load(":build_variables.bzl", "aten_native_source_list")
25
load(
3-
"//tools:build_variables.bzl",
4-
"aten_native_source_list",
5-
)
6-
load(
7-
"//tools:ufunc_defs.bzl",
6+
":ufunc_defs.bzl",
87
"aten_ufunc_generated_cpu_kernel_sources",
98
"aten_ufunc_generated_cpu_sources",
109
"aten_ufunc_generated_cuda_sources",
1110
)
12-
load("//tools/build_defs:fb_xplat_genrule.bzl", "fb_xplat_genrule")
13-
load("//tools/build_defs:type_defs.bzl", "is_list", "is_string")
1411

1512
USED_PT_BACKENDS = [
1613
"CPU",
File renamed without changes.

0 commit comments

Comments
 (0)