Skip to content

Enable fp32 tests for Windows #4722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ endif()
################################################################################

get_filelist("get_fbgemm_generic_srcs(with_base=True)" FBGEMM_GENERIC_SRCS)
if(MSVC)
list(FILTER FBGEMM_GENERIC_SRCS EXCLUDE REGEX "src/fp32/.*\\.cc$")
endif()

set(fbgemm_generic_defs "${fbgemm_arm_defs}")
if(FBGEMM_LIBRARY_TYPE STREQUAL STATIC)
Expand Down
5 changes: 0 additions & 5 deletions bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ if(FBGEMM_BUILD_BENCHMARKS)
list(FILTER BENCH_LIST EXCLUDE REGEX "quantize")
endif()

if(MSVC)
# NOTE: Skip FP32 benchmark for MSVC until intrinsic kernels are implemented
list(FILTER BENCH_LIST EXCLUDE REGEX "FP32Benchmark\\.cc$")
endif()

foreach(BENCH_FILE ${BENCH_LIST})
get_filename_component(BENCH_NAME ${BENCH_FILE} NAME_WE)
get_filename_component(BENCH_FILENAME ${BENCH_FILE} NAME)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/CxxCompilerSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BLOCK_PRINT(
)

# Strip all symbols from the .SO file after building
if(NOT MSVC AND NOT APPLE)
if(NOT WIN32 AND NOT APPLE)
add_link_options($<$<CONFIG:RELEASE>:-s>)
endif()

Expand Down
13 changes: 2 additions & 11 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def get_fbgemm_generic_srcs(with_base = False, msvc = False, buck = False):
"src/FbgemmSparseDense.cc",
"src/FbgemmI8Spmdm.cc",
"src/FbgemmPackMatrixB.cc",
"src/fp32/FbgemmFP32.cc",
"src/GenerateKernelDirectConvU8S8S32ACC32.cc",
"src/GenerateKernel.cc",
"src/GenerateKernelU8S8S32ACC16.cc",
Expand All @@ -73,17 +74,7 @@ def get_fbgemm_generic_srcs(with_base = False, msvc = False, buck = False):
"src/TransposeUtils.cc",
] + (get_fbgemm_base_srcs() if with_base else [])

fp32sources = [
"src/fp32/FbgemmFP32.cc",
]

if buck:
return select({
"DEFAULT": sources + fp32sources,
"ovr_config//compiler:cl": sources,
})

return sources + fp32sources if not msvc else sources
return sources

def get_fbgemm_public_headers():
return [
Expand Down
12 changes: 1 addition & 11 deletions include/fbgemm/FbgemmFP16.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <cpuinfo.h>

#include "fbgemm/FbgemmFPCommon.h"
#include "./FbgemmPackMatrixB.h" // @manual
#include "./FloatConversion.h" // @manual
#include "./Types.h" // @manual
Expand All @@ -31,17 +32,6 @@ struct TypeConverter<float16> {

using PackedGemmMatrixFP16 = PackedGemmMatrixB<float16>;

template <typename T>
FBGEMM_API void cblas_gemm_compute(
const matrix_op_t transa,
const int m,
const float* A,
const PackedGemmMatrixB<T>& Bp,
const float beta,
float* C,
int thread_id = 0,
int num_threads = 1);

extern template void cblas_gemm_compute<float16>(
const matrix_op_t transa,
const int m,
Expand Down
11 changes: 0 additions & 11 deletions include/fbgemm/FbgemmFP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ struct TypeConverter<float> {
using GemmParamsFP32 = GemmParams<float>;
using PackedGemmMatrixFP32 = PackedGemmMatrixB<float>;

template <typename T, int _kernel_ncol_blocks, int _brow>
void cblas_gemm_compute(
const matrix_op_t transa,
const int m,
const float* A,
const PackedGemmMatrixB<T>& Bp,
const float beta,
float* C,
int thread_id = 0,
int num_threads = 1);

extern template void cblas_gemm_compute(
const matrix_op_t transa,
const int m,
Expand Down
2 changes: 1 addition & 1 deletion src/fp32/FbgemmFP32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ FBGEMM_API void ref_kernel<float>(
}
#endif // FBGEMM_FP32_FALLBACK_TO_REF_KERNEL

template void cblas_gemm_compute(
template FBGEMM_API void cblas_gemm_compute(
const matrix_op_t transa,
const int m,
const float* A,
Expand Down
5 changes: 0 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ foreach(TEST_FILE ${TEST_LIST})
endif()
endif()

if(MSVC AND TEST_FILE MATCHES "FP32Test.cc$")
# NOTE: Skip FP32 test for MSVC until intrinsic kernels are implemented
continue()
endif()

message(STATUS "Processing: ${TEST_FILE}")

get_filename_component(TEST_NAME "${TEST_FILE}" NAME_WE)
Expand Down
Loading