Skip to content

Commit

Permalink
[Submodule] Clear USE_QNNPACK build option (#126941)
Browse files Browse the repository at this point in the history
Following the removal of QNNPACK third-party module #126657, we can clear more build system code. Also third_party/neon2sse was removed because it is not used.
Pull Request resolved: #126941
Approved by: https://github.com/ezyang
  • Loading branch information
cyyever authored and pytorchmergebot committed May 24, 2024
1 parent dfabae5 commit 95e5c99
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 34 deletions.
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
ignore = dirty
path = third_party/gemmlowp/gemmlowp
url = https://github.com/google/gemmlowp.git
[submodule "third_party/neon2sse"]
ignore = dirty
path = third_party/neon2sse
url = https://github.com/intel/ARM_NEON_2_x86_SSE.git
[submodule "third_party/fbgemm"]
ignore = dirty
path = third_party/fbgemm
Expand Down
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ option(USE_OPENMP "Use OpenMP for parallel code" ON)
option(USE_PRECOMPILED_HEADERS "Use pre-compiled headers to accelerate build." OFF)

option(USE_PROF "Use profiling" OFF)
option(USE_QNNPACK "Use QNNPACK (quantized 8-bit operators)" ON)
option(USE_PYTORCH_QNNPACK "Use ATen/QNNPACK (quantized 8-bit operators)" ON)
option(USE_SNPE "Use Qualcomm's SNPE library" OFF)
option(USE_SYSTEM_EIGEN_INSTALL
Expand Down Expand Up @@ -631,7 +630,6 @@ if(INTERN_BUILD_MOBILE)
set(USE_DISTRIBUTED OFF)
set(NO_API ON)
set(USE_FBGEMM OFF)
set(USE_QNNPACK OFF)
set(INTERN_DISABLE_ONNX ON)
if(USE_BLAS)
set(INTERN_USE_EIGEN_BLAS ON)
Expand Down Expand Up @@ -779,10 +777,6 @@ if(USE_FBGEMM)
string(APPEND CMAKE_CXX_FLAGS " -DUSE_FBGEMM")
endif()

if(USE_QNNPACK)
string(APPEND CMAKE_CXX_FLAGS " -DUSE_QNNPACK")
endif()

if(USE_PYTORCH_QNNPACK)
string(APPEND CMAKE_CXX_FLAGS " -DUSE_PYTORCH_QNNPACK")
endif()
Expand Down
20 changes: 4 additions & 16 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ endif()
# mismatch between these shared dependencies, explicitly declare our intent to these
# libraries that we are interested in using the exact same source dependencies for all.

if(USE_NNPACK OR USE_QNNPACK OR USE_PYTORCH_QNNPACK OR USE_XNNPACK)
if(USE_NNPACK OR USE_PYTORCH_QNNPACK OR USE_XNNPACK)
set(DISABLE_NNPACK_AND_FAMILY OFF)

# Sanity checks - Can we actually build NNPACK and family given the configuration provided?
Expand Down Expand Up @@ -350,14 +350,12 @@ if(USE_NNPACK OR USE_QNNPACK OR USE_PYTORCH_QNNPACK OR USE_XNNPACK)

if(DISABLE_NNPACK_AND_FAMILY)
caffe2_update_option(USE_NNPACK OFF)
caffe2_update_option(USE_QNNPACK OFF)
caffe2_update_option(USE_PYTORCH_QNNPACK OFF)
caffe2_update_option(USE_XNNPACK OFF)
else()
# Disable unsupported NNPack combinations with MSVC
if(MSVC)
caffe2_update_option(USE_NNPACK OFF)
caffe2_update_option(USE_QNNPACK OFF)
caffe2_update_option(USE_PYTORCH_QNNPACK OFF)
endif()

Expand All @@ -383,13 +381,6 @@ else()
set(DISABLE_NNPACK_AND_FAMILY ON)
endif()

if(USE_QNNPACK AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
message(WARNING
"QNNPACK does not compile for Apple Silicon. "
"Turn this warning off by explicit USE_QNNPACK=OFF.")
caffe2_update_option(USE_QNNPACK OFF)
endif()

set(CONFU_DEPENDENCIES_SOURCE_DIR ${PROJECT_BINARY_DIR}/confu-srcs
CACHE PATH "Confu-style dependencies source directory")
set(CONFU_DEPENDENCIES_BINARY_DIR ${PROJECT_BINARY_DIR}/confu-deps
Expand Down Expand Up @@ -479,14 +470,9 @@ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x|ppc64le)$")
list(APPEND Caffe2_DEPENDENCY_LIBS cpuinfo)
endif()

# ---[ Caffe2 Int8 operators (enabled by USE_QNNPACK) depend on gemmlowp and neon2sse headers
if(USE_QNNPACK)
set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp")
include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/neon2sse")
endif()

# ---[ PYTORCH_QNNPACK
set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
if(USE_PYTORCH_QNNPACK)
if(NOT DEFINED PYTORCH_QNNPACK_SOURCE_DIR)
set(PYTORCH_QNNPACK_SOURCE_DIR "${PROJECT_SOURCE_DIR}/aten/src/ATen/native/quantized/cpu/qnnpack" CACHE STRING "QNNPACK source directory")
Expand All @@ -507,6 +493,8 @@ if(USE_PYTORCH_QNNPACK)
# them into a shared library for Caffe2, so they need PIC.
set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
# QNNPACK depends on gemmlowp headers
target_include_directories(pytorch_qnnpack PRIVATE "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp")

if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
target_compile_definitions(
Expand Down
1 change: 0 additions & 1 deletion cmake/Summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ function(caffe2_print_configuration_summary)
message(STATUS " USE_VULKAN_RELAXED_PRECISION : ${USE_VULKAN_RELAXED_PRECISION}")
endif()
message(STATUS " USE_PROF : ${USE_PROF}")
message(STATUS " USE_QNNPACK : ${USE_QNNPACK}")
message(STATUS " USE_PYTORCH_QNNPACK : ${USE_PYTORCH_QNNPACK}")
message(STATUS " USE_XNNPACK : ${USE_XNNPACK}")
message(STATUS " USE_DISTRIBUTED : ${USE_DISTRIBUTED}")
Expand Down
4 changes: 0 additions & 4 deletions cmake/TorchConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ else()
append_torchlib_if_found(pytorch_qnnpack)
endif()

if(@USE_QNNPACK@)
append_torchlib_if_found(qnnpack)
endif()

if(@USE_XNNPACK@)
append_torchlib_if_found(XNNPACK)
endif()
Expand Down
1 change: 0 additions & 1 deletion defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ default_compiler_flags = [
"-DNO_CUDNN_DESTROY_HANDLE",
"-DUSE_EXPERIMENTAL_CUDNN_V8_API", # enable cudnn v8 api
"-DUSE_FBGEMM",
"-DUSE_QNNPACK",
"-DUSE_PYTORCH_QNNPACK",
# The dynamically loaded NVRTC trick doesn't work in fbcode,
# and it's not necessary anyway, because we have a stub
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/jit/test_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3134,7 +3134,7 @@ TEST_F(Composed, ComposedOp) {
}

TEST(ConstantPropagation, CustomClassesCanBePropagated) {
#ifdef USE_QNNPACK
#ifdef USE_PYTORCH_QNNPACK
const auto src = R"IR(
graph():
%none: NoneType = prim::Constant()
Expand Down
1 change: 0 additions & 1 deletion third_party/neon2sse
Submodule neon2sse deleted from 97a126

0 comments on commit 95e5c99

Please sign in to comment.