Skip to content

Commit 5015450

Browse files
committed
Update
[ghstack-poisoned]
2 parents 9324d3f + 7f1ce35 commit 5015450

File tree

8 files changed

+248
-356
lines changed

8 files changed

+248
-356
lines changed

.ci/docker/build.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,3 @@ elif [ "$HAS_TRITON" = "yes" ]; then
456456
echo "expecting triton to not be installed, but it is"
457457
exit 1
458458
fi
459-
460-
# Sanity check cmake version. Executorch reinstalls cmake and I'm not sure if
461-
# they support 4.0.0 yet, so exclude them from this check.
462-
CMAKE_VERSION=$(drun cmake --version)
463-
if [[ "$EXECUTORCH" != *yes* && "$CMAKE_VERSION" != *4.* ]]; then
464-
echo "CMake version is not 4.0.0:"
465-
drun cmake --version
466-
exit 1
467-
fi

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ cmake_dependent_option(USE_CUFILE "Use cuFile" ON "USE_CUDA AND NOT WIN32" OFF)
253253
option(USE_FBGEMM "Use FBGEMM (quantized 8-bit server operators)" ON)
254254
option(USE_KINETO "Use Kineto profiling library" ON)
255255
option(USE_CUPTI_SO "Use CUPTI as a shared library" ON)
256-
option(USE_FAKELOWP "Use FakeLowp operators" OFF)
257256
option(USE_GFLAGS "Use GFLAGS" OFF)
258257
option(USE_GLOG "Use GLOG" OFF)
259258
option(USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
@@ -836,10 +835,11 @@ include(ExternalProject)
836835

837836
# ---[ Dependencies ---[ FBGEMM doesn't work on x86 32bit and
838837
# CMAKE_SYSTEM_PROCESSOR thinks its 64bit
839-
if(USE_FBGEMM
840-
AND((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_SIZEOF_VOID_P EQUAL
841-
4)
842-
OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86"))
838+
if(USE_FBGEMM AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
839+
message(WARNING
840+
"x64 operating system is required for FBGEMM. "
841+
"Not compiling with FBGEMM. "
842+
"Turn this warning off by USE_FBGEMM=OFF.")
843843
set(USE_FBGEMM OFF)
844844
endif()
845845

cmake/BLAS_ABI.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include(CMakePushCheckState)
12
# Push host architecture when cross-compiling otherwise check would fail
23
# when cross-compiling for arm64 on x86_64
34
cmake_push_check_state(RESET)

cmake/Dependencies.cmake

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -664,55 +664,20 @@ if(USE_FBGEMM)
664664
if(NOT DEFINED FBGEMM_SOURCE_DIR)
665665
set(FBGEMM_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/fbgemm" CACHE STRING "FBGEMM source directory")
666666
endif()
667-
if(NOT CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS)
668-
message(WARNING
669-
"A compiler with AVX512 support is required for FBGEMM. "
670-
"Not compiling with FBGEMM. "
671-
"Turn this warning off by USE_FBGEMM=OFF.")
672-
set(USE_FBGEMM OFF)
673-
endif()
674-
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
675-
message(WARNING
676-
"x64 operating system is required for FBGEMM. "
677-
"Not compiling with FBGEMM. "
678-
"Turn this warning off by USE_FBGEMM=OFF.")
679-
set(USE_FBGEMM OFF)
680-
endif()
681667
if(USE_FBGEMM AND NOT TARGET fbgemm)
682668
set(FBGEMM_BUILD_TESTS OFF CACHE BOOL "")
683669
set(FBGEMM_BUILD_BENCHMARKS OFF CACHE BOOL "")
684-
if(MSVC AND BUILD_SHARED_LIBS)
685-
set(FBGEMM_LIBRARY_TYPE "shared" CACHE STRING "")
686-
else()
687-
set(FBGEMM_LIBRARY_TYPE "static" CACHE STRING "")
688-
endif()
689-
if(USE_ASAN)
690-
set(USE_SANITIZER "address,undefined" CACHE STRING "-fsanitize options for FBGEMM")
691-
endif()
670+
set(FBGEMM_LIBRARY_TYPE "static" CACHE STRING "")
692671
add_subdirectory("${FBGEMM_SOURCE_DIR}")
693-
set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
694-
set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
695-
set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
696-
set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
697-
698-
# Disabling autovec in fbgemm due to large library size causing symbol relocation issues, which is only allowed in static builds.
699-
# Long-term solution involves modularizing fbgemm targets.
700-
target_compile_definitions(fbgemm_generic PUBLIC DISABLE_FBGEMM_AUTOVEC)
701-
target_compile_definitions(fbgemm_avx2 PUBLIC DISABLE_FBGEMM_AUTOVEC)
702-
target_compile_definitions(fbgemm_avx512 PUBLIC DISABLE_FBGEMM_AUTOVEC)
703-
704-
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
705-
# See https://github.com/pytorch/pytorch/issues/74352
706-
target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
707-
target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
708-
endif()
672+
709673
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
710674
target_compile_options_if_supported(asmjit -Wno-extra-semi)
711675
target_compile_options_if_supported(fbgemm -Wno-extra-semi)
712676
endif()
677+
target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
678+
target_compile_options_if_supported(asmjit -Wno-unused-variable)
713679
endif()
714680
if(USE_FBGEMM)
715-
target_compile_definitions(fbgemm PUBLIC DISABLE_FBGEMM_AUTOVEC)
716681
list(APPEND Caffe2_DEPENDENCY_LIBS fbgemm)
717682
endif()
718683
endif()
@@ -721,9 +686,6 @@ if(USE_FBGEMM)
721686
caffe2_update_option(USE_FBGEMM ON)
722687
else()
723688
caffe2_update_option(USE_FBGEMM OFF)
724-
message(WARNING
725-
"Turning USE_FAKELOWP off as it depends on USE_FBGEMM.")
726-
caffe2_update_option(USE_FAKELOWP OFF)
727689
endif()
728690

729691
if(USE_OPENCL)

cmake/MiscCheck.cmake

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,6 @@ if(NOT INTERN_BUILD_MOBILE)
1212
set(CAFFE2_PERF_WITH_AVX2 1)
1313
endif()
1414
endif()
15-
# ---[ Check if the compiler has AVX512 support.
16-
cmake_push_check_state(RESET)
17-
if(MSVC AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
18-
# We could've used MSVC's hidden option /arch:AVX512 that defines __AVX512F__,
19-
# __AVX512DQ__, and __AVX512VL__, and /arch:AVX512F that defines __AVX512F__.
20-
# But, we chose not to do that not to rely on hidden options.
21-
set(CMAKE_REQUIRED_FLAGS "/D__AVX512F__ /D__AVX512DQ__ /D__AVX512VL__")
22-
else()
23-
# We only consider the case where all of avx512f, avx512dq, and avx512vl are
24-
# supported.
25-
# Platforms where avx512f is supported by not avx512dq and avx512vl as of
26-
# Jan 15 2019 : linux_manywheel_2.7mu_cpu_build and
27-
# linux_conda_3.7_cu100_build
28-
set(CMAKE_REQUIRED_FLAGS "-mavx512f -mavx512dq -mavx512vl")
29-
endif()
30-
CHECK_CXX_SOURCE_COMPILES(
31-
"#if defined(_MSC_VER)
32-
#include <intrin.h>
33-
#else
34-
#include <immintrin.h>
35-
#endif
36-
// check avx512f
37-
__m512 addConstant(__m512 arg) {
38-
return _mm512_add_ps(arg, _mm512_set1_ps(1.f));
39-
}
40-
// check avx512dq
41-
__m512 andConstant(__m512 arg) {
42-
return _mm512_and_ps(arg, _mm512_set1_ps(1.f));
43-
}
44-
int main() {
45-
__m512i a = _mm512_set1_epi32(1);
46-
__m256i ymm = _mm512_extracti64x4_epi64(a, 0);
47-
ymm = _mm256_abs_epi64(ymm); // check avx512vl
48-
__mmask16 m = _mm512_cmp_epi32_mask(a, a, _MM_CMPINT_EQ);
49-
__m512i r = _mm512_andnot_si512(a, a);
50-
}" CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS)
51-
if(CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS)
52-
message(STATUS "Current compiler supports avx512f extension. Will build fbgemm.")
53-
endif()
54-
cmake_pop_check_state()
5515

5616
# ---[ Checks if compiler supports -fvisibility=hidden
5717
check_cxx_compiler_flag("-fvisibility=hidden" COMPILER_SUPPORTS_HIDDEN_VISIBILITY)

cmake/Summary.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ function(caffe2_print_configuration_summary)
136136
message(STATUS " BUILD_NVFUSER : ${BUILD_NVFUSER}")
137137
message(STATUS " USE_EIGEN_FOR_BLAS : ${CAFFE2_USE_EIGEN_FOR_BLAS}")
138138
message(STATUS " USE_FBGEMM : ${USE_FBGEMM}")
139-
message(STATUS " USE_FAKELOWP : ${USE_FAKELOWP}")
140139
message(STATUS " USE_KINETO : ${USE_KINETO}")
141140
message(STATUS " USE_GFLAGS : ${USE_GFLAGS}")
142141
message(STATUS " USE_GLOG : ${USE_GLOG}")

0 commit comments

Comments
 (0)