Skip to content

Commit 5585138

Browse files
cyyeverpytorchmergebot
authored andcommitted
Remove caffe2 contrib and experiments (#125038)
This PR tries to decompose #122527 into a smaller one. To be noted, this was inspired and is co-dev with @r-barnes. Pull Request resolved: #125038 Approved by: https://github.com/malfet
1 parent 555f1ae commit 5585138

189 files changed

Lines changed: 1 addition & 37411 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BUILD.bazel

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -446,30 +446,13 @@ cu_library(
446446
# caffe2
447447
CAFFE2_COPTS = COMMON_COPTS + [
448448
"-Dcaffe2_EXPORTS",
449-
"-DCAFFE2_USE_GLOO",
450449
"-DCAFFE2_USE_CUDNN",
451450
"-DCAFFE2_BUILD_MAIN_LIB",
452451
"-fvisibility-inlines-hidden",
453452
"-fno-math-errno",
454453
"-fno-trapping-math",
455454
]
456455

457-
filegroup(
458-
name = "caffe2_contrib_srcs",
459-
srcs = [
460-
"caffe2/contrib/aten/aten_op.cc",
461-
"caffe2/contrib/gloo/allgather_ops.cc",
462-
"caffe2/contrib/gloo/allreduce_ops.cc",
463-
"caffe2/contrib/gloo/barrier_ops.cc",
464-
"caffe2/contrib/gloo/broadcast_ops.cc",
465-
"caffe2/contrib/gloo/common.cc",
466-
"caffe2/contrib/gloo/common_world_ops.cc",
467-
"caffe2/contrib/gloo/context.cc",
468-
"caffe2/contrib/gloo/reduce_scatter_ops.cc",
469-
"caffe2/contrib/gloo/store_handler.cc",
470-
],
471-
)
472-
473456
filegroup(
474457
name = "caffe2_core_srcs",
475458
srcs = [
@@ -1024,10 +1007,6 @@ filegroup(
10241007
filegroup(
10251008
name = "caffe2_cuda_cpp_srcs",
10261009
srcs = [
1027-
"caffe2/contrib/aten/aten_op_gpu.cc",
1028-
"caffe2/contrib/gloo/allreduce_ops_gpu.cc",
1029-
"caffe2/contrib/gloo/broadcast_ops_gpu.cc",
1030-
"caffe2/contrib/gloo/common_world_ops_gpu.cc",
10311010
"caffe2/core/blob_serialization_gpu.cc",
10321011
"caffe2/core/common_cudnn.cc",
10331012
"caffe2/core/common_gpu.cc",
@@ -1271,35 +1250,10 @@ cc_library(
12711250
],
12721251
)
12731252

1274-
py_binary(
1275-
name = "gen_op",
1276-
srcs = ["caffe2/contrib/aten/gen_op.py"],
1277-
deps = ["//torchgen"],
1278-
)
1279-
1280-
genrule(
1281-
name = "generated_caffe2_aten_op_headers",
1282-
srcs = [
1283-
"caffe2/contrib/aten/aten_op_template.h",
1284-
"aten/src/ATen/Declarations.yaml",
1285-
],
1286-
outs = ["caffe2/caffe2/contrib/aten/gen_aten_op.h"],
1287-
cmd = """
1288-
$(location :gen_op) \
1289-
--output_prefix gen_ \
1290-
--install_dir $(@D) \
1291-
--aten_root `dirname $(location aten/src/ATen/Declarations.yaml)`/../.. \
1292-
--template_dir `dirname $(location caffe2/contrib/aten/aten_op_template.h)` \
1293-
--yaml_dir `dirname $(location aten/src/ATen/Declarations.yaml)`""",
1294-
tools = [":gen_op"],
1295-
)
1296-
12971253
cc_library(
12981254
name = "caffe2_headers",
12991255
hdrs = glob(
13001256
[
1301-
"caffe2/contrib/aten/*.h",
1302-
"caffe2/contrib/gloo/*.h",
13031257
"caffe2/core/*.h",
13041258
"caffe2/core/nomnigraph/include/nomnigraph/Converters/*.h",
13051259
"caffe2/core/nomnigraph/include/nomnigraph/Generated/*.h",
@@ -1338,10 +1292,9 @@ cc_library(
13381292
) + if_cuda(glob([
13391293
"caffe2/**/*.cuh",
13401294
"caffe2/image/*.h",
1341-
])) + [":generated_caffe2_aten_op_headers"],
1295+
])),
13421296
copts = CAFFE2_COPTS,
13431297
includes = [
1344-
"caffe2/contrib/aten",
13451298
"caffe2/core/nomnigraph/include",
13461299
],
13471300
visibility = ["//visibility:public"],
@@ -1385,7 +1338,6 @@ cc_library(
13851338
"caffe2/db/create_db_op.cc",
13861339
"caffe2/db/protodb.cc",
13871340
"caffe2/share/contrib/depthwise/depthwise3x3_conv_op.cc",
1388-
":caffe2_contrib_srcs",
13891341
":caffe2_core_srcs",
13901342
":caffe2_distributed_srcs",
13911343
":caffe2_ideep_srcs",
@@ -1419,7 +1371,6 @@ cc_library(
14191371
"@fbgemm//:fbgemm_src_headers",
14201372
"@fmt",
14211373
"@foxi",
1422-
"@gloo",
14231374
"@onnx",
14241375
] + if_cuda(
14251376
[
@@ -1467,7 +1418,6 @@ cu_library(
14671418
"@cuda//:curand",
14681419
"@cudnn",
14691420
"@eigen",
1470-
"@gloo",
14711421
"@tensorpipe//:tensorpipe_cuda",
14721422
],
14731423
alwayslink = True,

caffe2/CMakeLists.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,7 @@ if(INTERN_BUILD_ATEN_OPS)
5959

6060
# Generate the headers wrapped by our operator
6161
file(GLOB_RECURSE torchgen_python "${PROJECT_SOURCE_DIR}/torchgen/*.py")
62-
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/contrib/aten/aten_op.h
63-
COMMAND
64-
"${PYTHON_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/contrib/aten/gen_op.py
65-
--aten_root=${CMAKE_CURRENT_SOURCE_DIR}/../aten
66-
--template_dir=${CMAKE_CURRENT_SOURCE_DIR}/contrib/aten
67-
--yaml_dir=${CMAKE_BINARY_DIR}/aten/src/ATen
68-
--install_dir=${CMAKE_CURRENT_BINARY_DIR}/contrib/aten
69-
DEPENDS
70-
${torchgen_python}
71-
${CMAKE_BINARY_DIR}/aten/src/ATen/Declarations.yaml
72-
${CMAKE_CURRENT_SOURCE_DIR}/contrib/aten/gen_op.py
73-
${CMAKE_CURRENT_SOURCE_DIR}/contrib/aten/aten_op_template.h)
7462

75-
add_custom_target(__aten_op_header_gen
76-
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/contrib/aten/aten_op.h)
77-
add_library(aten_op_header_gen INTERFACE)
78-
add_dependencies(aten_op_header_gen __aten_op_header_gen)
7963

8064
# Add source, includes, and libs to lists
8165
list(APPEND Caffe2_CPU_SRCS ${ATen_CPU_SRCS})
@@ -132,7 +116,6 @@ endif()
132116

133117
# Skip modules that are not used by libtorch mobile yet.
134118
if(BUILD_CAFFE2 AND NOT INTERN_BUILD_MOBILE)
135-
add_subdirectory(contrib)
136119
add_subdirectory(predictor)
137120
add_subdirectory(predictor/emulator)
138121
add_subdirectory(core/nomnigraph)
@@ -141,7 +124,6 @@ if(BUILD_CAFFE2 AND NOT INTERN_BUILD_MOBILE)
141124
endif()
142125
add_subdirectory(db)
143126
add_subdirectory(distributed)
144-
# add_subdirectory(experiments) # note, we may remove this folder at some point
145127
add_subdirectory(ideep)
146128
add_subdirectory(image)
147129
add_subdirectory(video)

caffe2/contrib/CMakeLists.txt

Lines changed: 0 additions & 37 deletions
This file was deleted.

caffe2/contrib/__init__.py

Whitespace-only changes.

caffe2/contrib/aten/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

caffe2/contrib/aten/README.md

Lines changed: 0 additions & 80 deletions
This file was deleted.

caffe2/contrib/aten/__init__.py

Whitespace-only changes.

caffe2/contrib/aten/aten_op.cc

Lines changed: 0 additions & 56 deletions
This file was deleted.

caffe2/contrib/aten/aten_op.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

caffe2/contrib/aten/aten_op_gpu.cc

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)