Skip to content

Commit

Permalink
Remove caffe2 mobile (pytorch#84338)
Browse files Browse the repository at this point in the history
We're no longer building Caffe2 mobile as part of our CI, and it adds a lot of clutter to our make files. Any lingering internal dependencies will use the buck build and so wont be effected.
Pull Request resolved: pytorch#84338
Approved by: https://github.com/dreiss
  • Loading branch information
jmdetloff authored and pytorchmergebot committed Sep 8, 2022
1 parent 9669e3c commit e0229d6
Show file tree
Hide file tree
Showing 16 changed files with 628 additions and 989 deletions.
54 changes: 0 additions & 54 deletions .jenkins/caffe2/bench.sh

This file was deleted.

231 changes: 0 additions & 231 deletions .jenkins/caffe2/build.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .jenkins/caffe2/dirty.sh

This file was deleted.

9 changes: 0 additions & 9 deletions .jenkins/pytorch/dirty.sh

This file was deleted.

16 changes: 3 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ option(BUILD_LITE_INTERPRETER "Master flag to build Lite Interpreter" OFF)
cmake_dependent_option(
BUILD_CAFFE2_OPS "Build Caffe2 operators" ON
"BUILD_CAFFE2" OFF)
cmake_dependent_option(
BUILD_CAFFE2_MOBILE "Build libcaffe2 for mobile (deprecating)" OFF
"BUILD_CAFFE2" OFF)
option(BUILD_SHARED_LIBS "Build libcaffe2.so" ON)
cmake_dependent_option(
CAFFE2_LINK_LOCAL_PROTOBUF "If set, build protobuf inside libcaffe2.so." ON
Expand Down Expand Up @@ -591,18 +588,11 @@ if(ANDROID OR IOS OR DEFINED ENV{BUILD_PYTORCH_MOBILE_WITH_HOST_TOOLCHAIN})
endif()

# INTERN_BUILD_ATEN_OPS is used to control whether to build ATen/TH operators.
# It's disabled for caffe2 mobile library.
if(INTERN_BUILD_MOBILE AND BUILD_CAFFE2_MOBILE)
set(INTERN_BUILD_ATEN_OPS OFF)
else()
set(INTERN_BUILD_ATEN_OPS ON)
endif()
set(INTERN_BUILD_ATEN_OPS ON)

# BUILD_CAFFE2_MOBILE is the master switch to choose between libcaffe2 v.s. libtorch mobile build.
# When it's enabled it builds original libcaffe2 mobile library without ATen/TH ops nor TorchScript support;
# When it's disabled it builds libtorch mobile library, which contains ATen/TH ops and native support for
# Build libtorch mobile library, which contains ATen/TH ops and native support for
# TorchScript model, but doesn't contain not-yet-unified caffe2 ops;
if(INTERN_BUILD_MOBILE AND NOT BUILD_CAFFE2_MOBILE)
if(INTERN_BUILD_MOBILE)
if(NOT BUILD_SHARED_LIBS AND NOT "${SELECTED_OP_LIST}" STREQUAL "")
string(APPEND CMAKE_CXX_FLAGS " -DNO_EXPORT")
endif()
Expand Down
7 changes: 0 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,6 @@ In 2018, we merged Caffe2 into the PyTorch source repository. While the
steady state aspiration is that Caffe2 and PyTorch share code freely,
in the meantime there will be some separation.
If you submit a PR to only PyTorch or only Caffe2 code, CI will only
run for the project you edited. The logic for this is implemented
in `.jenkins/pytorch/dirty.sh` and `.jenkins/caffe2/dirty.sh`; you
can look at this to see what path prefixes constitute changes.
This also means if you ADD a new top-level path, or you start
sharing code between projects, you need to modify these files.
There are a few "unusual" directories which, for historical reasons,
are Caffe2/PyTorch specific. Here they are:
Expand Down
13 changes: 4 additions & 9 deletions binaries/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
if(INTERN_BUILD_MOBILE)
if(BUILD_CAFFE2_MOBILE)
#caffe2_binary_target("predictor_verifier.cc")
caffe2_binary_target("speed_benchmark.cc")
else()
caffe2_binary_target("speed_benchmark_torch.cc")
caffe2_binary_target("load_benchmark_torch.cc")
if(NOT BUILD_LITE_INTERPRETER)
caffe2_binary_target("compare_models_torch.cc")
endif()
caffe2_binary_target("speed_benchmark_torch.cc")
caffe2_binary_target("load_benchmark_torch.cc")
if(NOT BUILD_LITE_INTERPRETER)
caffe2_binary_target("compare_models_torch.cc")
endif()
return()
endif()
Expand Down
Loading

0 comments on commit e0229d6

Please sign in to comment.