Skip to content

Commit 0e74e59

Browse files
gchalumpfacebook-github-bot
authored andcommitted
Remove fbgemm autovec (pytorch#4123)
Summary: DO NOT LAND Testing PyTorch CI without fbgemm autovec Differential Revision: D74747522
1 parent d1181b3 commit 0e74e59

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,7 @@ endif()
422422
if(FBGEMM_BUILD_FBGEMM_GPU)
423423
add_subdirectory(fbgemm_gpu)
424424
endif()
425+
426+
if(HAVE_GNU_F2H_IEEE)
427+
add_definitions(-DHAVE_GNU_F2H_IEEE)
428+
endif()

cmake/modules/FindGnuH2fIeee.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD-style license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
8+
################################################################################
9+
# Finds and sets GNU_FH2_IEEE compilation flags
10+
################################################################################
11+
12+
INCLUDE(CheckCXXSourceCompiles)
13+
14+
CHECK_CXX_SOURCE_COMPILES("
15+
#include <arm_neon.h>
16+
int main() {
17+
float f = 1.0f;
18+
uint16_t h = __gnu_f2h_ieee(f);
19+
return 0;
20+
}
21+
" HAVE_GNU_F2H_IEEE)

fbgemm_gpu/cmake/Fbgemm.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
set(fbgemm_sources_normal
1212
"${FBGEMM}/src/EmbeddingSpMDM.cc"
13-
"${FBGEMM}/src/EmbeddingSpMDMAutovec.cc"
1413
"${FBGEMM}/src/EmbeddingSpMDMNBit.cc"
1514
"${FBGEMM}/src/QuantUtils.cc"
1615
"${FBGEMM}/src/RefImplementations.cc"

include/fbgemm/FloatConversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ inline float cpu_half2float_ref(const float16 h) {
287287
// Same as the previous function, but use the built-in fp16 to fp32
288288
// conversion provided by the compiler
289289
inline float cpu_half2float(const float16 h) {
290-
#ifdef HAS_NATIVE_FP16_TYPE
290+
#if defined(HAS_NATIVE_FP16_TYPE) && defined(HAVE_GNU_F2H_IEEE)
291291
__fp16 h_fp16;
292292
std::memcpy(&h_fp16, &h, sizeof(__fp16));
293293
return h_fp16;
@@ -297,7 +297,7 @@ inline float cpu_half2float(const float16 h) {
297297
}
298298

299299
inline float16 cpu_float2half(const float f) {
300-
#ifdef HAS_NATIVE_FP16_TYPE
300+
#if defined(HAS_NATIVE_FP16_TYPE) && defined(HAVE_GNU_F2H_IEEE)
301301
__fp16 h = f;
302302
float16 res;
303303
std::memcpy(&res, &h, sizeof(__fp16));

0 commit comments

Comments
 (0)