Skip to content

Commit 95e5c99

Browse files
cyyeverpytorchmergebot
authored andcommitted
[Submodule] Clear USE_QNNPACK build option (pytorch#126941)
Following the removal of QNNPACK third-party module pytorch#126657, we can clear more build system code. Also third_party/neon2sse was removed because it is not used. Pull Request resolved: pytorch#126941 Approved by: https://github.com/ezyang
1 parent dfabae5 commit 95e5c99

File tree

8 files changed

+5
-34
lines changed

8 files changed

+5
-34
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@
7474
ignore = dirty
7575
path = third_party/gemmlowp/gemmlowp
7676
url = https://github.com/google/gemmlowp.git
77-
[submodule "third_party/neon2sse"]
78-
ignore = dirty
79-
path = third_party/neon2sse
80-
url = https://github.com/intel/ARM_NEON_2_x86_SSE.git
8177
[submodule "third_party/fbgemm"]
8278
ignore = dirty
8379
path = third_party/fbgemm

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ option(USE_OPENMP "Use OpenMP for parallel code" ON)
260260
option(USE_PRECOMPILED_HEADERS "Use pre-compiled headers to accelerate build." OFF)
261261

262262
option(USE_PROF "Use profiling" OFF)
263-
option(USE_QNNPACK "Use QNNPACK (quantized 8-bit operators)" ON)
264263
option(USE_PYTORCH_QNNPACK "Use ATen/QNNPACK (quantized 8-bit operators)" ON)
265264
option(USE_SNPE "Use Qualcomm's SNPE library" OFF)
266265
option(USE_SYSTEM_EIGEN_INSTALL
@@ -631,7 +630,6 @@ if(INTERN_BUILD_MOBILE)
631630
set(USE_DISTRIBUTED OFF)
632631
set(NO_API ON)
633632
set(USE_FBGEMM OFF)
634-
set(USE_QNNPACK OFF)
635633
set(INTERN_DISABLE_ONNX ON)
636634
if(USE_BLAS)
637635
set(INTERN_USE_EIGEN_BLAS ON)
@@ -779,10 +777,6 @@ if(USE_FBGEMM)
779777
string(APPEND CMAKE_CXX_FLAGS " -DUSE_FBGEMM")
780778
endif()
781779

782-
if(USE_QNNPACK)
783-
string(APPEND CMAKE_CXX_FLAGS " -DUSE_QNNPACK")
784-
endif()
785-
786780
if(USE_PYTORCH_QNNPACK)
787781
string(APPEND CMAKE_CXX_FLAGS " -DUSE_PYTORCH_QNNPACK")
788782
endif()

cmake/Dependencies.cmake

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ endif()
309309
# mismatch between these shared dependencies, explicitly declare our intent to these
310310
# libraries that we are interested in using the exact same source dependencies for all.
311311

312-
if(USE_NNPACK OR USE_QNNPACK OR USE_PYTORCH_QNNPACK OR USE_XNNPACK)
312+
if(USE_NNPACK OR USE_PYTORCH_QNNPACK OR USE_XNNPACK)
313313
set(DISABLE_NNPACK_AND_FAMILY OFF)
314314

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

351351
if(DISABLE_NNPACK_AND_FAMILY)
352352
caffe2_update_option(USE_NNPACK OFF)
353-
caffe2_update_option(USE_QNNPACK OFF)
354353
caffe2_update_option(USE_PYTORCH_QNNPACK OFF)
355354
caffe2_update_option(USE_XNNPACK OFF)
356355
else()
357356
# Disable unsupported NNPack combinations with MSVC
358357
if(MSVC)
359358
caffe2_update_option(USE_NNPACK OFF)
360-
caffe2_update_option(USE_QNNPACK OFF)
361359
caffe2_update_option(USE_PYTORCH_QNNPACK OFF)
362360
endif()
363361

@@ -383,13 +381,6 @@ else()
383381
set(DISABLE_NNPACK_AND_FAMILY ON)
384382
endif()
385383

386-
if(USE_QNNPACK AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
387-
message(WARNING
388-
"QNNPACK does not compile for Apple Silicon. "
389-
"Turn this warning off by explicit USE_QNNPACK=OFF.")
390-
caffe2_update_option(USE_QNNPACK OFF)
391-
endif()
392-
393384
set(CONFU_DEPENDENCIES_SOURCE_DIR ${PROJECT_BINARY_DIR}/confu-srcs
394385
CACHE PATH "Confu-style dependencies source directory")
395386
set(CONFU_DEPENDENCIES_BINARY_DIR ${PROJECT_BINARY_DIR}/confu-deps
@@ -479,14 +470,9 @@ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x|ppc64le)$")
479470
list(APPEND Caffe2_DEPENDENCY_LIBS cpuinfo)
480471
endif()
481472

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

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

511499
if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
512500
target_compile_definitions(

cmake/Summary.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ function(caffe2_print_configuration_summary)
163163
message(STATUS " USE_VULKAN_RELAXED_PRECISION : ${USE_VULKAN_RELAXED_PRECISION}")
164164
endif()
165165
message(STATUS " USE_PROF : ${USE_PROF}")
166-
message(STATUS " USE_QNNPACK : ${USE_QNNPACK}")
167166
message(STATUS " USE_PYTORCH_QNNPACK : ${USE_PYTORCH_QNNPACK}")
168167
message(STATUS " USE_XNNPACK : ${USE_XNNPACK}")
169168
message(STATUS " USE_DISTRIBUTED : ${USE_DISTRIBUTED}")

cmake/TorchConfig.cmake.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ else()
8989
append_torchlib_if_found(pytorch_qnnpack)
9090
endif()
9191

92-
if(@USE_QNNPACK@)
93-
append_torchlib_if_found(qnnpack)
94-
endif()
95-
9692
if(@USE_XNNPACK@)
9793
append_torchlib_if_found(XNNPACK)
9894
endif()

defs.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ default_compiler_flags = [
3535
"-DNO_CUDNN_DESTROY_HANDLE",
3636
"-DUSE_EXPERIMENTAL_CUDNN_V8_API", # enable cudnn v8 api
3737
"-DUSE_FBGEMM",
38-
"-DUSE_QNNPACK",
3938
"-DUSE_PYTORCH_QNNPACK",
4039
# The dynamically loaded NVRTC trick doesn't work in fbcode,
4140
# and it's not necessary anyway, because we have a stub

test/cpp/jit/test_misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3134,7 +3134,7 @@ TEST_F(Composed, ComposedOp) {
31343134
}
31353135

31363136
TEST(ConstantPropagation, CustomClassesCanBePropagated) {
3137-
#ifdef USE_QNNPACK
3137+
#ifdef USE_PYTORCH_QNNPACK
31383138
const auto src = R"IR(
31393139
graph():
31403140
%none: NoneType = prim::Constant()

third_party/neon2sse

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

0 commit comments

Comments
 (0)