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

CI: Fix CI SIMD build on s390x #21750

Merged
merged 1 commit into from
Jun 14, 2022
Merged

Conversation

seiko2plus
Copy link
Member

@seiko2plus seiko2plus commented Jun 14, 2022

On s390x, Travis CI runner fails to build SIMD VX features. The assembler errors seems to be caused due to invalid repo packages or incompatible assembler. the following error looks new, I didn't detect it before so maybe a new update has been made by Travis causes this issue.

extra options: '-march=arch11 -mzvector -Werror'

WARN: CCompilerOpt.dist_test[630] : CCompilerOpt._dist_test_spawn[764] : Command (gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Werror=vla -Werror=nonnull -Werror=pointer-arith -Werror=implicit-function-declaration -Wlogical-op -Wno-sign-compare -Werror=undef -fPIC -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/home/travis/build/numpy/numpy/builds/venv/include -I/opt/python/3.8.13/include/python3.8 -Ibuild/src.linux-s390x-3.8/numpy/core/src/common -Ibuild/src.linux-s390x-3.8/numpy/core/src/npymath -c /home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.c -o /tmp/tmp7602jpef/home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.o -MMD -MF /tmp/tmp7602jpef/home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.o.d -march=arch11 -mzvector -Werror) failed with exit status 1 output -> 

/tmp/ccucTcH0.s: Assembler messages:

/tmp/ccucTcH0.s:19: Error: junk at end of line: `,3'

@seiko2plus
Copy link
Member Author

upgrades to Jammy leads to different error:

INFO: compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/home/travis/build/numpy/numpy/builds/venv/include -I/opt/python/3.10.4/include/python3.10 -Ibuild/src.linux-s390x-3.10/numpy/core/src/common -Ibuild/src.linux-s390x-3.10/numpy/core/src/npymath -c'
extra options: '-march=arch11 -mzvector -Werror'
WARN: CCompilerOpt.dist_test[630] : CCompilerOpt._dist_test_spawn[764] : Command (gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Werror=vla -Werror=nonnull -Werror=pointer-arith -Werror=implicit-function-declaration -Wlogical-op -Wno-sign-compare -Werror=undef -fPIC -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -I/home/travis/build/numpy/numpy/builds/venv/include -I/opt/python/3.10.4/include/python3.10 -Ibuild/src.linux-s390x-3.10/numpy/core/src/common -Ibuild/src.linux-s390x-3.10/numpy/core/src/npymath -c /home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.c -o /tmp/tmp4dhgcm3y/home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.o -MMD -MF /tmp/tmp4dhgcm3y/home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.o.d -march=arch11 -mzvector -Werror) failed with exit status 1 output -> 
/home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.c: In function ‘main’:
/home/travis/build/numpy/numpy/numpy/distutils/checks/cpu_vx.c:11:5: error: vector argument passed to unprototyped function
     x = vec_round(vec_ceil(x) + vec_floor(y));

@seiko2plus seiko2plus force-pushed the fix_ci_ibmz_assembler branch 7 times, most recently from ca8f9e1 to df408ec Compare June 14, 2022 09:32
@seiko2plus
Copy link
Member Author

seiko2plus commented Jun 14, 2022

upgrades to Jammy leads to different error:

It was bionic, Travis doesn't provides jammy on s390x

@seiko2plus seiko2plus force-pushed the fix_ci_ibmz_assembler branch 4 times, most recently from 5c85f5d to f800fca Compare June 14, 2022 10:44
@seiko2plus
Copy link
Member Author

seiko2plus commented Jun 14, 2022

upgrade the binutils fixes the issue and VX z13 build error can be triggered :

build error
loops_comparison.dispatch.c.src: In function ‘simd_binary_equal_b8’:

numpy/core/src/common/simd/vec/operators.h:148:22: error: ‘__builtin_s390_vec_eqv’ requires z14 or higher

  148 | #define npyv_xnor_b8 vec_eqv

      |                      ^~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src:236:21: note: in expansion of macro ‘npyv_xnor_b8’

  236 |         npyv_b8 c = npyv_@VOP@_b8(a, b);

      |                     ^~~~~~~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src: In function ‘simd_binary_scalar1_equal_b8’:

numpy/core/src/common/simd/vec/operators.h:148:22: error: ‘__builtin_s390_vec_eqv’ requires z14 or higher

  148 | #define npyv_xnor_b8 vec_eqv

      |                      ^~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src:260:21: note: in expansion of macro ‘npyv_xnor_b8’

  260 |         npyv_b8 c = npyv_@VOP@_b8(a, b);

      |                     ^~~~~~~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src: In function ‘simd_binary_scalar2_equal_b8’:

numpy/core/src/common/simd/vec/operators.h:148:22: error: ‘__builtin_s390_vec_eqv’ requires z14 or higher

  148 | #define npyv_xnor_b8 vec_eqv

      |                      ^~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src:283:21: note: in expansion of macro ‘npyv_xnor_b8’

  283 |         npyv_b8 c = npyv_@VOP@_b8(a, b);

      |                     ^~~~~~~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src: In function ‘simd_binary_less_equal_b8’:

numpy/core/src/common/simd/vec/operators.h:147:21: error: ‘__builtin_s390_vec_orc’ requires z14 or higher

  147 | #define npyv_orc_b8 vec_orc

      |                     ^~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src:236:21: note: in expansion of macro ‘npyv_orc_b8’

  236 |         npyv_b8 c = npyv_@VOP@_b8(a, b);

      |                     ^~~~~~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src: In function ‘simd_binary_scalar1_less_equal_b8’:

numpy/core/src/common/simd/vec/operators.h:147:21: error: ‘__builtin_s390_vec_orc’ requires z14 or higher

  147 | #define npyv_orc_b8 vec_orc

      |                     ^~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src:260:21: note: in expansion of macro ‘npyv_orc_b8’

  260 |         npyv_b8 c = npyv_@VOP@_b8(a, b);

      |                     ^~~~~~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src: In function ‘simd_binary_scalar2_less_equal_b8’:

numpy/core/src/common/simd/vec/operators.h:147:21: error: ‘__builtin_s390_vec_orc’ requires z14 or higher

  147 | #define npyv_orc_b8 vec_orc

      |                     ^~~~~~~

numpy/core/src/umath/loops_comparison.dispatch.c.src:283:21: note: in expansion of macro ‘npyv_orc_b8’

  283 |         npyv_b8 c = npyv_@VOP@_b8(a, b);

@seiko2plus
Copy link
Member Author

seiko2plus commented Jun 14, 2022

build passed after merges #21748

optimization log
########### EXT COMPILER OPTIMIZATION ###########
INFO: Platform      : 
  Architecture: s390x
  Compiler    : gcc

CPU baseline  : 
  Requested   : 'min'
  Enabled     : none
  Flags       : none
  Extra checks: none

CPU dispatch  : 
  Requested   : 'max -xop -fma4'
  Enabled     : VX VXE VXE2
  Generated   : 
              : 
  VX          : 
  Flags       : -march=arch11 -mzvector
  Extra checks: none
  Detect      : VX
              : build/src.linux-s390x-3.8/numpy/core/src/multiarray/argfunc.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_unary_fp.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_arithm_fp.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_arithmetic.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_minmax.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_hyperbolic.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_comparison.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/_simd/_simd.dispatch.c
              : 
  VXE         : VX
  Flags       : -mzvector -march=arch12
  Extra checks: none
  Detect      : VXE
              : build/src.linux-s390x-3.8/numpy/core/src/multiarray/argfunc.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_unary_fp.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_arithm_fp.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_minmax.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_trigonometric.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_hyperbolic.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_comparison.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/_simd/_simd.dispatch.c
              : 
  VXE2        : VX VXE
  Flags       : -mzvector -march=arch13
  Extra checks: none
  Detect      : VXE2
              : build/src.linux-s390x-3.8/numpy/core/src/umath/loops_trigonometric.dispatch.c
              : build/src.linux-s390x-3.8/numpy/core/src/_simd/_simd.dispatch.c

@seiko2plus
Copy link
Member Author

@mattip, Any ideas to ask Travis to upgrade their images? the assembler needs to be upgraded to avoid incompatibility with gcc >= 9

@seiko2plus
Copy link
Member Author

@mattip mattip merged commit 9788a2a into numpy:main Jun 14, 2022
@mattip
Copy link
Member

mattip commented Jun 14, 2022

Thanks @seiko2plus

seiko2plus added a commit to seiko2plus/numpy that referenced this pull request Jun 15, 2022
  This guard protects against any sudden unexpected changes that may adversely
  affect the compile-time SIMD features detection which could leave the SIMD code
  inactivated. Until now we have faced two cases:

  1. Hardening the compile-time test files of Neon/ASIMD features without checking
     the sanity of the modification leading to disabling all optimizations on aarch64.
     see numpygh-21747

  2. A sudden compiler upgrades by CI side on s390x that causes conflicts with the
     installed assembler leading to disabling the whole VX/E features, which made us
     merge SIMD code without testing it. Later, it was discovered that this code
     disrupted the NumPy build.
     see numpygh-21750, numpygh-21748
seiko2plus added a commit to seiko2plus/numpy that referenced this pull request Jun 15, 2022
  This guard protects against any sudden unexpected changes that may adversely
  affect the compile-time SIMD features detection which could leave the SIMD code
  inactivated. Until now we have faced two cases:

  1. Hardening the compile-time test files of Neon/ASIMD features without checking
     the sanity of the modification leading to disabling all optimizations on aarch64.
     see numpygh-21747

  2. A sudden compiler upgrades by CI side on s390x that causes conflicts with the
     installed assembler leading to disabling the whole VX/E features, which made us
     merge SIMD code without testing it. Later, it was discovered that this code
     disrupted the NumPy build.
     see numpygh-21750, numpygh-21748
seiko2plus added a commit to seiko2plus/numpy that referenced this pull request Jun 15, 2022
  This guard protects against any sudden unexpected changes that may adversely
  affect the compile-time SIMD features detection which could leave the SIMD code
  inactivated. Until now we have faced two cases:

  1. Hardening the compile-time test files of Neon/ASIMD features without checking
     the sanity of the modification leading to disabling all optimizations on aarch64.
     see numpygh-21747

  2. A sudden compiler upgrades by CI side on s390x that causes conflicts with the
     installed assembler leading to disabling the whole VX/E features, which made us
     merge SIMD code without testing it. Later, it was discovered that this code
     disrupted the NumPy build.
     see numpygh-21750, numpygh-21748
@seiko2plus seiko2plus deleted the fix_ci_ibmz_assembler branch June 16, 2022 23:04
@rgommers rgommers added the component: SIMD Issues in SIMD (fast instruction sets) code or machinery label Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants