Skip to content

Commit 6790eb9

Browse files
dsharletxnnpack-bot
authored andcommitted
Copybara import of the project:
-- 17f6dab by Dillon <[email protected]>: Add .vs to .gitignore -- 951240c by Dillon <[email protected]>: Fix warnings on MSVC -- 585faa1 by Dillon <[email protected]>: Disable warning on MSVC -- 92acc17 by Dillon <[email protected]>: Disable AVX256 when /vlen not supported by MSVC FUTURE_COPYBARA_INTEGRATE_REVIEW=#7840 from google:ds/windows 92acc17 PiperOrigin-RevId: 728495899
1 parent e4113ae commit 6790eb9

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ ehthumbs.db
3434
Thumbs.db
3535
*.swp
3636
.vscode
37+
.vs

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
277277
ENDIF()
278278
ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
279279
SET(XNNPACK_ENABLE_AVX512BF16 OFF)
280+
IF(MSVC_VERSION LESS_EQUAL 1941)
281+
# /vlen option not supported
282+
SET(XNNPACK_ENABLE_AVX256SKX OFF)
283+
SET(XNNPACK_ENABLE_AVX256VNNI OFF)
284+
SET(XNNPACK_ENABLE_AVX256VNNIGFNI OFF)
285+
ENDIF()
280286
ENDIF()
281287
OPTION(XNNPACK_ENABLE_HVX "Build XNNPACK with Hexagon HVX micro-kernels" ON)
282288
OPTION(XNNPACK_ENABLE_KLEIDIAI "Use KleidiAI GEMM microkernels for Arm" ON)
@@ -341,6 +347,8 @@ IF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
341347
# Test files have many sections, increase the limit. See
342348
# https://learn.microsoft.com/en-us/cpp/build/reference/bigobj-increase-number-of-sections-in-dot-obj-file.
343349
ADD_COMPILE_OPTIONS("/bigobj")
350+
# Our float16 datatypes have constructors in C++ and not in C, which prompts a warning in MSVC
351+
ADD_COMPILE_OPTIONS("/wd4190")
344352
ENDIF()
345353

346354
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

src/configs/gemm-config.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,11 @@ static void init_qd8_f16_qc8w_gemm_config(void) {
27992799
qd8_f16_qc8w_gemm_config.pack_weights_and_biases = NULL; // Override the default packing function.
28002800
qd8_f16_qc8w_gemm_config.packed_stride_weights_and_biases = NULL; // Override the default packing function.
28012801
qd8_f16_qc8w_gemm_config.pack_gemm_gio = (xnn_packw_gemm_gio_ukernel_fn) xnn_pack_qs8_gemm_gio_w;
2802+
#if XNN_ENABLE_AVX256VNNI
28022803
qd8_f16_qc8w_gemm_config.pack_gemm_goi = (xnn_packw_gemm_goi_ukernel_fn) xnn_qs8_packw_gemm_goi_ukernel_x64c4__avx256vnni_prfm;
2804+
#else
2805+
qd8_f16_qc8w_gemm_config.pack_gemm_goi = (xnn_packw_gemm_goi_ukernel_fn) xnn_pack_qs8_gemm_goi_w;
2806+
#endif
28032807
qd8_f16_qc8w_gemm_config.mr = 16;
28042808
qd8_f16_qc8w_gemm_config.nr = 64;
28052809
qd8_f16_qc8w_gemm_config.log2_kr = 2;
@@ -3389,7 +3393,11 @@ static void init_qd8_f32_qc8w_gemm_config(void) {
33893393
qd8_f32_qc8w_gemm_config.pack_weights_and_biases = NULL; // Override the default packing function.
33903394
qd8_f32_qc8w_gemm_config.packed_stride_weights_and_biases = NULL; // Override the default packing function.
33913395
qd8_f32_qc8w_gemm_config.pack_gemm_gio = (xnn_packw_gemm_gio_ukernel_fn) xnn_pack_qs8_gemm_gio_w;
3396+
#if XNN_ENABLE_AVX256VNNI
33923397
qd8_f32_qc8w_gemm_config.pack_gemm_goi = (xnn_packw_gemm_goi_ukernel_fn) xnn_qs8_packw_gemm_goi_ukernel_x64c4__avx256vnni_prfm;
3398+
#else
3399+
qd8_f32_qc8w_gemm_config.pack_gemm_goi = (xnn_packw_gemm_goi_ukernel_fn) xnn_pack_qs8_gemm_goi_w;
3400+
#endif
33933401
qd8_f32_qc8w_gemm_config.mr = 16;
33943402
qd8_f32_qc8w_gemm_config.nr = 64;
33953403
qd8_f32_qc8w_gemm_config.log2_kr = 2;
@@ -4089,7 +4097,11 @@ static void init_qs8_qc8w_gemm_config(void) {
40894097
qs8_qc8w_gemm_config.pack_weights_and_biases = NULL; // Override the default packing function.
40904098
qs8_qc8w_gemm_config.packed_stride_weights_and_biases = NULL; // Override the default packing function.
40914099
qs8_qc8w_gemm_config.pack_gemm_gio = (xnn_packw_gemm_gio_ukernel_fn) xnn_pack_qs8_gemm_gio_w;
4100+
#if XNN_ENABLE_AVX256VNNI
40924101
qs8_qc8w_gemm_config.pack_gemm_goi = (xnn_packw_gemm_goi_ukernel_fn) xnn_qs8_packw_gemm_goi_ukernel_x64c4__avx256vnni_prfm;
4102+
#else
4103+
qs8_qc8w_gemm_config.pack_gemm_goi = (xnn_packw_gemm_goi_ukernel_fn) xnn_pack_qs8_gemm_goi_w;
4104+
#endif
40934105
qs8_qc8w_gemm_config.pack_igemm_goki = (xnn_pack_conv_goki_w_fn) xnn_pack_qs8_conv_goki_w;
40944106
qs8_qc8w_gemm_config.pack_igemm_kgo = (xnn_pack_conv_kgo_w_fn) xnn_pack_qs8_conv_kgo_w;
40954107
qs8_qc8w_gemm_config.pack_deconv_goki = (xnn_pack_deconv_goki_w_fn) xnn_pack_qs8_deconv_goki_w;

src/operator-run.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,14 +2237,14 @@ void xnn_compute_f16_qd8_convert(
22372237
const struct f16_qd8_convert_context context[restrict XNN_MIN_ELEMENTS(1)],
22382238
size_t batch_index)
22392239
{
2240-
return xnn_compute_f16_qx8_convert(context, xnn_f16_qd8_asymmetric_quantization_params, batch_index);
2240+
xnn_compute_f16_qx8_convert(context, xnn_f16_qd8_asymmetric_quantization_params, batch_index);
22412241
}
22422242

22432243
void xnn_compute_f16_qdu8_convert(
22442244
const struct f16_qd8_convert_context context[restrict XNN_MIN_ELEMENTS(1)],
22452245
size_t batch_index)
22462246
{
2247-
return xnn_compute_f16_qx8_convert(context, xnn_f16_qdu8_asymmetric_quantization_params, batch_index);
2247+
xnn_compute_f16_qx8_convert(context, xnn_f16_qdu8_asymmetric_quantization_params, batch_index);
22482248
}
22492249

22502250
void xnn_compute_f32_qx8_convert(
@@ -2273,14 +2273,14 @@ void xnn_compute_f32_qd8_convert(
22732273
const struct f32_qd8_convert_context context[restrict XNN_MIN_ELEMENTS(1)],
22742274
size_t batch_index)
22752275
{
2276-
return xnn_compute_f32_qx8_convert(context, xnn_f32_qd8_asymmetric_quantization_params, batch_index);
2276+
xnn_compute_f32_qx8_convert(context, xnn_f32_qd8_asymmetric_quantization_params, batch_index);
22772277
}
22782278

22792279
void xnn_compute_f32_qdu8_convert(
22802280
const struct f32_qd8_convert_context context[restrict XNN_MIN_ELEMENTS(1)],
22812281
size_t batch_index)
22822282
{
2283-
return xnn_compute_f32_qx8_convert(context, xnn_f32_qdu8_asymmetric_quantization_params, batch_index);
2283+
xnn_compute_f32_qx8_convert(context, xnn_f32_qdu8_asymmetric_quantization_params, batch_index);
22842284
}
22852285

22862286
void xnn_compute_pack_lh(

0 commit comments

Comments
 (0)