Various tests failing on Win10 / Intel C++ 18 / AVX512-machine
Description
After switching from a development notebook (i7-6XXX generation, i.e. no AVX-512, everything running fine) to a different desktop running an i9-7980XE (AVX-512 machine) but almost the same dev environment, I encounter various bound checking errors (debug compilations) and exceptions/failures during the tests:
The following tests FAILED:
6 - test_iface_pd_iter (Failed)
7 - test_iface_attr (Exit code 0xc0000139
)
8 - test_sum (NUMERICAL)
9 - test_reorder (NUMERICAL)
10 - test_concat (Failed)
11 - test_softmax_forward (Failed)
13 - test_relu (Failed)
16 - test_pooling_forward (Failed)
17 - test_pooling_backward (Failed)
19 - test_inner_product_forward (SEGFAULT)
20 - test_inner_product_backward_data (Failed)
21 - test_inner_product_backward_weights (Failed)
23 - test_convolution_forward_f32 (Exit code 0xc0000139
)
24 - test_convolution_forward_s16s16s32 (Exit code 0xc0000139
)
25 - test_convolution_forward_u8s8s32 (Exit code 0xc0000139
)
26 - test_convolution_forward_u8s8fp (Exit code 0xc0000139
)
27 - test_convolution_relu_forward_f32 (Exit code 0xc0000139
)
28 - test_convolution_relu_forward_s16s16s32 (Exit code 0xc0000139
)
29 - test_convolution_backward_data_f32 (Exit code 0xc0000139
)
30 - test_convolution_backward_data_s16s16s32 (Exit code 0xc0000139
)
31 - test_convolution_backward_weights (Exit code 0xc0000139
Environment
Both machines are running Windows 10, the most recent Visual Studio 2017 v15.5.4 and Intel C++ Compiler 18.0 U1. From the software side, the major difference is that the company notebook (where everything is running ok) is not yet patched for Meltdown and has not the most recent BIOS (i.e. no Spectre fixes).
However, my home desktop is making problems:
- Core i9-7980XE on ASUS X299-PRIME, patched to most recent BIOS 1102
- Windows 10 16299.162 with most recent patches installed
- Intel C++ Compiler 18.0 U1 (most recent)
- CMake 3.10.2 (most recent)
- CMake output log
Steps to reproduce
Downloaded both the v0.12 source package and the most recent master commit of the MKL-DNN repository, configured via CMake and ran "Rebuilt all" from within the Visual Studio environment, which compiles the library and then runs all the tests. Working fine on the company notebook.
cmake -T"Intel C++ Compiler 18.0" -G"Visual Studio 15 2017 Win64" ..
-- The C compiler identification is Intel 18.0.1.20171018
-- The CXX compiler identification is Intel 18.0.1.20171018
-- Check for working C compiler: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018/windows/bin/intel64/icl.exe
-- Check for working C compiler: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018/windows/bin/intel64/icl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018/windows/bin/intel64/icl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/IntelSWTools/compilers_and_libraries_2018/windows/bin/intel64/icl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE is unset, defaulting to Release
-- Detecting Intel(R) MKL: trying mklml_intel
-- Detecting Intel(R) MKL: trying mklml
-- Detecting Intel(R) MKL: trying mkl_rt
CMake Warning at cmake/MKL.cmake:177 (message):
Intel(R) MKL not found. Some performance features may not be available.
Please run scripts/prepare_mkl.sh to download a minimal set of libraries or
get a full version from https://software.intel.com/en-us/intel-mkl
Call Stack (most recent call first):
cmake/OpenMP.cmake:24 (include)
CMakeLists.txt:57 (include)
-- Found OpenMP_C: -Qopenmp (found version "5.0")
-- Found OpenMP_CXX: -Qopenmp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.13") found components: doxygen dot
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/ml-dev-env/test-software/mkldnn_vs_test/src/external/mkl-dnn/build
I'm not using the MKL library on purpose for the moment, but I also tried it using the MKL lib, some result...
I originally ran into the issue using the v0.12 release source, but also tried with the most recent repository commit from the 'master'-branch. Stuff is compiling fine, but the same code crashes on the i9-7980XE, so there are either bugs in the AVX512 portion of the implementation (but I guess you would have noticed this during the usual test runs) or there is some weird interaction between the Meltdown scheduler fixes (maybe wrecking OpenMP?) or Spectre fixes (changed microcode for string/array range checks) or something entirely else...
Any ideas? Thanks a lot!
I highly doubt this behavior is related to Meltdown/Spectre patches. The more likely culprits are MSVS 2017 and Intel AVX512 codepath in the library. Did you try running the code with the latest master (3e1f8f5)?
Yes, I tried both the v0.12 release source package and the latest master commit 3e1f8f5. Also tried both packages with and without the Intel MKL library.
I fully agree with you that Meltdown/Spectre are probably not responsible, but aside from the CPU and the code path that is basically the major difference between the two systems.
Assuming that the error is in the AVX512 code path, I will collect the specific assert error locations that come up in the debug build during some of the tests (not all of them). Maybe that will narrow down the issue (but not before tomorrow)...
Hi @BenjaminJurke,
The problem is really weird. For example test_iface_attr does almost nothing -- it does not use anything that is architecture specific (i.e. doesn't matter whether you run it on avx2, avx512, or sse).
Most likely the problem is in C++ (not sure where exactly).
- Could you please check whether both C and C++ example crash, or only C++?
- Also, could you please try either different configuration or do not use Intel Compiler (and use just MSVS)?
Oh my... I have solved the problem... an utterly stupid mistake by myself.
I must have more or less accidentally run the "Install" script part of the Visual Studio solution while using Administrator mode (probably while adding some packages to VS). Therefore, the compiled DLL was properly moved over to the programs folder, where it automatically becomes subject to the Windows protected files system.... Whenever I recompiled the entire solution, the compilation completed successfully, but in the end the DLL was not replaced, thus the test executables where using an older DLL while being statically linked to the most recent version... D'Oh
I guess this was partially "working" (i.e. not all tests failing right away) since the DLL way only a few commits old (must have happened about 1-2 weeks ago), I have been working on this on my home desktop only a few times. On the company notebook everything was linked statically. Anyway...
Everything is working fine now.
Sorry for making such a fuss and bothering you. Keep up the great work!