Skip to content

Commit 4fdbaa7

Browse files
cyyeverpytorchmergebot
authored andcommitted
[Submodule] Remove deprecated USE_TBB option and TBB submodule (pytorch#127051)
Pull Request resolved: pytorch#127051 Approved by: https://github.com/cpuhrsch, https://github.com/malfet
1 parent 6aa5bb1 commit 4fdbaa7

34 files changed

+19
-863
lines changed

.ci/pytorch/build.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ if [[ "$BUILD_ENVIRONMENT" == *cuda11* ]]; then
4444
fi
4545
fi
4646

47-
if [[ ${BUILD_ENVIRONMENT} == *"paralleltbb"* ]]; then
48-
export ATEN_THREADING=TBB
49-
export USE_TBB=1
50-
elif [[ ${BUILD_ENVIRONMENT} == *"parallelnative"* ]]; then
47+
if [[ ${BUILD_ENVIRONMENT} == *"parallelnative"* ]]; then
5148
export ATEN_THREADING=NATIVE
5249
fi
5350

.ci/pytorch/test.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ test_aten() {
693693
${SUDO} ln -sf "$TORCH_LIB_DIR"/libmkldnn* "$TEST_BASE_DIR"
694694
${SUDO} ln -sf "$TORCH_LIB_DIR"/libnccl* "$TEST_BASE_DIR"
695695
${SUDO} ln -sf "$TORCH_LIB_DIR"/libtorch* "$TEST_BASE_DIR"
696-
${SUDO} ln -sf "$TORCH_LIB_DIR"/libtbb* "$TEST_BASE_DIR"
697696

698697
ls "$TEST_BASE_DIR"
699698
aten/tools/run_tests.sh "$TEST_BASE_DIR"
@@ -718,21 +717,6 @@ test_without_numpy() {
718717
popd
719718
}
720719

721-
# pytorch extensions require including torch/extension.h which includes all.h
722-
# which includes utils.h which includes Parallel.h.
723-
# So you can call for instance parallel_for() from your extension,
724-
# but the compilation will fail because of Parallel.h has only declarations
725-
# and definitions are conditionally included Parallel.h(see last lines of Parallel.h).
726-
# I tried to solve it #39612 and #39881 by including Config.h into Parallel.h
727-
# But if Pytorch is built with TBB it provides Config.h
728-
# that has AT_PARALLEL_NATIVE_TBB=1(see #3961 or #39881) and it means that if you include
729-
# torch/extension.h which transitively includes Parallel.h
730-
# which transitively includes tbb.h which is not available!
731-
if [[ "${BUILD_ENVIRONMENT}" == *tbb* ]]; then
732-
sudo mkdir -p /usr/include/tbb
733-
sudo cp -r "$PWD"/third_party/tbb/include/tbb/* /usr/include/tbb
734-
fi
735-
736720
test_libtorch() {
737721
local SHARD="$1"
738722

@@ -746,7 +730,6 @@ test_libtorch() {
746730
ln -sf "$TORCH_LIB_DIR"/libc10* "$TORCH_BIN_DIR"
747731
ln -sf "$TORCH_LIB_DIR"/libshm* "$TORCH_BIN_DIR"
748732
ln -sf "$TORCH_LIB_DIR"/libtorch* "$TORCH_BIN_DIR"
749-
ln -sf "$TORCH_LIB_DIR"/libtbb* "$TORCH_BIN_DIR"
750733
ln -sf "$TORCH_LIB_DIR"/libnvfuser* "$TORCH_BIN_DIR"
751734

752735
export CPP_TESTS_DIR="${TORCH_BIN_DIR}"
@@ -883,7 +866,6 @@ test_rpc() {
883866
# test reporting process to function as expected.
884867
ln -sf "$TORCH_LIB_DIR"/libtorch* "$TORCH_BIN_DIR"
885868
ln -sf "$TORCH_LIB_DIR"/libc10* "$TORCH_BIN_DIR"
886-
ln -sf "$TORCH_LIB_DIR"/libtbb* "$TORCH_BIN_DIR"
887869

888870
CPP_TESTS_DIR="${TORCH_BIN_DIR}" python test/run_test.py --cpp --verbose -i cpp/test_cpp_rpc
889871
}

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@
8282
ignore = dirty
8383
path = third_party/foxi
8484
url = https://github.com/houseroad/foxi.git
85-
[submodule "third_party/tbb"]
86-
path = third_party/tbb
87-
url = https://github.com/01org/tbb
88-
branch = tbb_2018
8985
[submodule "android/libs/fbjni"]
9086
ignore = dirty
9187
path = android/libs/fbjni

BUILD.bazel

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ filegroup(
125125
data = [":generate-code"],
126126
)
127127

128-
exports_files(
129-
srcs = ["aten/src/ATen/cpu/tbb/extra/version_string.ver.in"],
130-
)
131-
132128
# ATen
133129
filegroup(
134130
name = "aten_base_cpp",
@@ -275,7 +271,6 @@ header_template_rule(
275271
"@AT_BUILD_WITH_LAPACK@": "1",
276272
"@AT_PARALLEL_OPENMP@": "0",
277273
"@AT_PARALLEL_NATIVE@": "1",
278-
"@AT_PARALLEL_NATIVE_TBB@": "0",
279274
"@AT_BLAS_F2C@": "0",
280275
"@AT_BLAS_USE_CBLAS_DOT@": "1",
281276
},
@@ -359,6 +354,9 @@ cc_library(
359354
":aten_src_ATen_config",
360355
] + generated_cpu_cpp + aten_ufunc_generated_cpu_sources("aten/src/ATen/{}"),
361356
copts = ATEN_COPTS,
357+
linkopts = [
358+
"-ldl",
359+
],
362360
data = if_cuda(
363361
[":libcaffe2_nvrtc.so"],
364362
[],
@@ -774,6 +772,9 @@ cc_library(
774772
],
775773
)) + torch_sources,
776774
copts = TORCH_COPTS,
775+
linkopts = [
776+
"-lrt",
777+
],
777778
defines = [
778779
"CAFFE2_NIGHTLY_VERSION=20200115",
779780
],
@@ -794,6 +795,9 @@ cc_library(
794795
cc_library(
795796
name = "shm",
796797
srcs = glob(["torch/lib/libshm/*.cpp"]),
798+
linkopts = [
799+
"-lrt",
800+
],
797801
deps = [
798802
":torch",
799803
],

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ cmake_dependent_option(
329329
cmake_dependent_option(
330330
USE_TENSORPIPE "Use TensorPipe. Only available if USE_DISTRIBUTED is on." ON
331331
"USE_DISTRIBUTED" OFF)
332-
option(USE_TBB "Use TBB (Deprecated)" OFF)
333-
cmake_dependent_option(
334-
USE_SYSTEM_TBB "Use system-provided Intel TBB." OFF "USE_TBB" OFF)
335332
option(ONNX_ML "Enable traditional ONNX ML API." ON)
336333
option(HAVE_SOVERSION "Whether to add SOVERSION to the shared objects" OFF)
337334
option(BUILD_LIBTORCH_CPU_WITH_DEBUG "Enable RelWithDebInfo for libtorch_cpu target only" OFF)
@@ -431,9 +428,6 @@ if(USE_SYSTEM_LIBS)
431428
if(USE_NCCL)
432429
set(USE_SYSTEM_NCCL ON)
433430
endif()
434-
if(USE_TBB)
435-
set(USE_SYSTEM_TBB ON)
436-
endif()
437431
endif()
438432

439433
# Used when building Caffe2 through setup.py

WORKSPACE

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,6 @@ new_local_repository(
168168
path = "third_party/opentelemetry-cpp",
169169
)
170170

171-
new_patched_local_repository(
172-
name = "tbb",
173-
build_file = "//third_party:tbb.BUILD",
174-
patch_strip = 1,
175-
patches = [
176-
"@//third_party:tbb.patch",
177-
],
178-
path = "third_party/tbb",
179-
)
180-
181171
new_local_repository(
182172
name = "tensorpipe",
183173
build_file = "//third_party:tensorpipe.BUILD",

aten/src/ATen/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,6 @@ endif()
349349

350350
list(APPEND ATen_CPU_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/..)
351351

352-
if(USE_TBB)
353-
if(USE_SYSTEM_TBB)
354-
message("ATen is compiled with system-provided Intel TBB.")
355-
else()
356-
message("ATen is compiled with Intel TBB (${TBB_ROOT_DIR}).")
357-
endif()
358-
list(APPEND ATen_CPU_INCLUDE ${TBB_INCLUDE_DIR})
359-
list(APPEND ATen_CPU_DEPENDENCY_LIBS TBB::tbb)
360-
endif()
361-
362352
if(BLAS_FOUND)
363353
if($ENV{TH_BINARY_BUILD})
364354
message(STATUS "TH_BINARY_BUILD detected. Enabling special linkage.")

aten/src/ATen/Config.h.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
#define AT_BUILD_WITH_LAPACK() @AT_BUILD_WITH_LAPACK@
1818
#define AT_PARALLEL_OPENMP @AT_PARALLEL_OPENMP@
1919
#define AT_PARALLEL_NATIVE @AT_PARALLEL_NATIVE@
20-
#define AT_PARALLEL_NATIVE_TBB @AT_PARALLEL_NATIVE_TBB@
2120
#define AT_BLAS_F2C() @AT_BLAS_F2C@
2221
#define AT_BLAS_USE_CBLAS_DOT() @AT_BLAS_USE_CBLAS_DOT@

aten/src/ATen/Parallel.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ TORCH_API int intraop_default_num_threads();
153153
#include <ATen/ParallelOpenMP.h> // IWYU pragma: keep
154154
#elif AT_PARALLEL_NATIVE
155155
#include <ATen/ParallelNative.h> // IWYU pragma: keep
156-
#elif AT_PARALLEL_NATIVE_TBB
157-
#include <ATen/ParallelNativeTBB.h> // IWYU pragma: keep
158156
#endif
159157

160158
#include <ATen/Parallel-inl.h> // IWYU pragma: keep

aten/src/ATen/ParallelCommon.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ std::string get_parallel_info() {
8080
ss << "OpenMP";
8181
#elif AT_PARALLEL_NATIVE
8282
ss << "native thread pool";
83-
#elif AT_PARALLEL_NATIVE_TBB
84-
ss << "native thread pool and TBB";
8583
#endif
8684
#ifdef C10_MOBILE
8785
ss << " [mobile]";

0 commit comments

Comments
 (0)