Skip to content
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

Build failing on various EMU128 tests #2375

Open
OliverWangData opened this issue Nov 16, 2024 · 3 comments
Open

Build failing on various EMU128 tests #2375

OliverWangData opened this issue Nov 16, 2024 · 3 comments

Comments

@OliverWangData
Copy link

OliverWangData commented Nov 16, 2024

Hey all,

I'm trying to set up a pipeline for automating building highway when needed, but I keep running into EMU128 tests related build errors. I'm building on cmake 3.31.0 with the following parameters:

[path to cmake]
-G "Visual Studio 17 2022" 
-DCMAKE_BUILD_TYPE=Release 
-DBUILD_SHARED_LIBS=OFF 
-DCMAKE_INSTALL_PREFIX=E:\Unreal\[name] 
-DCMAKE_INSTALL_INCLUDEDIR=E:\Unreal\[name]\Source\ThirdParty\Highway\Include 
-DCMAKE_INSTALL_BINDIR=E:\Unreal\[name]\Binaries\ThirdParty\Highway 
-DCMAKE_INSTALL_LIBDIR=E:\Unreal\[name]\Libraries\ThirdParty\Highway 
-B E:\Unreal\[name]\Intermediate\ThirdParty\Highway 
E:\Unreal\[name]\Source\ThirdParty\Highway\highway-1.2.0

and then

[path to cmake] --build E:\Unreal\[name]\Intermediate\ThirdParty\Highway --config Release -j

This is on a fresh install of cmake 3.31.0 and highway 1.2.0, on windows 11, with an amd 5900X.
This results in EMU128 errors on the test at various places. Some examples:

...
  === TestAllNaN for SSE2:
  === TestAllNaN for EMU128:
  f32x4 not all NaN [0+ ->]:
    340282346638528859811704183484516925440.000000000,340282346638528859811704183484516925440.000000000,340282346638528859811704183484516925440.000000000,340282346638528859811704183484516925440.000000000,
  f32x4 mask [0+ ->]:
    0.000000000E+00,0.000000000E+00,0.000000000E+00,0.000000000E+00,
  Abort at highway_test.cc:368: Expected f32x4 NaN, got 3.402823E+38 (bytes ff ff 7f 7f 00 00 00 00)
  math_test.vcxproj -> E:\Unreal\[name]\Intermediate\ThirdParty\Highway\tests\Release\math_test.exe
...
...
  f64x2: Expm1 max_ulp 2
  f64: Expm1 max_ulp 2
  === TestAllExpm1 for SSE2:
  f32x4: Expm1 max_ulp 2
  f32x2: Expm1 max_ulp 2
  f32: Expm1 max_ulp 2
  f64x2: Expm1 max_ulp 2
  f64: Expm1 max_ulp 2
  === TestAllExpm1 for EMU128:
  f32x4: Expm1(-177.271637) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-193.591629) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-209.911621) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-226.231613) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-242.551605) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-261.743195) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
...

...
  f32x4: Expm1(-17117656388378759790592.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-18321859256042567761920.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  CMake Error at E:/Unreal/[name]/Programs/CMake/cmake-3.31.0/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:148 (message):
    Error running test executable.

      Path: 'E:/Unreal/[name]/Intermediate/ThirdParty/Highway/tests/Release/highway_test.exe'
      Working directory: 'E:/Unreal/[name]/Intermediate/ThirdParty/Highway'
      Result: Exit code 0xc0000409



      Output:


  Call Stack (most recent call first):
    E:/Unreal/[name]/Programs/CMake/cmake-3.31.0/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:283 (gtest_discover_tests_impl)

...
...
  === TestAllF16 for SSE2:
  === TestAllF16 for EMU128:


  f32x4 expect [0+ ->]:
    1.000000000,-1.000000000,0.000000000E+00,-0.000000000E+00,
  f32x4 actual [0+ ->]:
    1.000000000,-1.000000000,0.000030518,-0.000030518,
  Abort at convert_test.cc:435: EMU128, f32x4 lane 2 mismatch: expected '0.000000000E+00', got '0.000030518'.
...

...
  f32x4: Expm1(-525682881587271557419057532633088.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-567058977062195326696480458145792.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  cast_test.vcxproj -> E:\Unreal\[name]\Intermediate\ThirdParty\Highway\tests\Release\cast_test.exe
  f32x4: Expm1(-608435072537119095973903383658496.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  dup128_vec_test.vcxproj -> E:\Unreal\[name]\Intermediate\ThirdParty\Highway\tests\Release\dup128_vec_test.exe
...

These last two I'm not 100% sure are related, but just in case:

...
  f32x4: Expm1(-299056523702242511024693239993073664.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-320241084585403480894733777855578112.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  f32x4: Expm1(-350544291990899933303596866366078976.000000) expected -1.000000E+00 actual -INF ulp 1.07374e+09 max ulp 4
  CMake Error at E:/Unreal/[name]/Programs/CMake/cmake-3.31.0/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:148 (message):
    Error running test executable.

      Path: 'E:/Unreal/[name]/Intermediate/ThirdParty/Highway/tests/Release/convert_test.exe'
      Working directory: 'E:/Unreal/[name]/Intermediate/ThirdParty/Highway'
      Result: Exit code 0xc0000409



      Output:


  Call Stack (most recent call first):
    E:/Unreal/[name]/Programs/CMake/cmake-3.31.0/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:283 (gtest_discover_tests_impl)
...
...
  === TestAllReorderWidenMulAccumulate for SSE2:
  === TestAllReorderWidenMulAccumulate for EMU128:
  Abort at widen_mul_test.cc:541: EMU128, f32x1 lane 0 mismatch: expected '1.000000000', got '0.000000000E+00'.

  CMake Error at E:/Unreal/Rift/Programs/CMake/cmake-3.31.0/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:148 (message):
    Error running test executable.

      Path: 'E:/Unreal/Rift/Intermediate/ThirdParty/Highway/tests/Release/widen_mul_test.exe'
      Working directory: 'E:/Unreal/Rift/Intermediate/ThirdParty/Highway'
      Result: Exit code 0xc0000409



      Output:
...

I've tried skipping the testing portions of the cmake by removing gtest references like the documentation says, and also by trying to remove any HWY_TEST_FILES files. Both result in the cmake "succeeding", but no export when dumpbin-ing the hwy.lib.

I've also tried passing /O2 flags and the cl.exe compiler to the cmake options (among various other tests), but this changes nothing. Any suggestions?

@johnplatts
Copy link
Contributor

johnplatts commented Nov 16, 2024

I am able to get all of the tests in hwy/tests in the master branch to pass successfully with Visual C++ 2022 on the EMU128 target on both x86 and x86_64 with the fixes I made to hwy/tests/hwy_gtest.h in pull request #2376.

The HWY_EMU128 and HWY_SCALAR targets can also be disabled by passing -DCMAKE_CXX_FLAGS="-DHWY_DISABLED_TARGETS=0x6000000000000000" to the cmake command line. It is okay to disable HWY_EMU128 and HWY_SCALAR targets on x86_64 as the HWY_SSE2 target is guaranteed to be supported on all x86_64 CPU's.

Google Highway needs to be updated to the latest commit of the master branch (which is currently commit 28c442f) to fix the build failure issues with various EMU128 tests with Visual C++.

@johnplatts
Copy link
Contributor

Also implemented a fix in pull request #2377 to fix a linker error in bench_sort if HWY_TEST_STANDALONE is 1.

@OliverWangData
Copy link
Author

Thanks for the reply! Yea indeed that fixes the issue. With the latest commit on the master branch everything compiles fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants