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

[OpenBLAS_jll] Upgrade to new build optimised for PowerPC #48689

Merged
merged 4 commits into from
Feb 20, 2023

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Feb 15, 2023

This only difference compared to previous build is that this one enables use of dynamic architecture detection also for the PowerPC architecture.

Ref: https://discourse.julialang.org/t/building-openblas-for-powerpc-defaults-to-power8/93972.

This only difference compared to previous build is that this one enables use of
dynamic architecture detection also for the PowerPC architecture.
@giordano giordano added external dependencies Involves LLVM, OpenBLAS, or other linked libraries stdlib:JLLs labels Feb 15, 2023
@vchuravy
Copy link
Sponsor Member

Can you also update the source recipe here?

@vchuravy vchuravy added the backport 1.9 Change should be backported to release-1.9 label Feb 15, 2023
@giordano
Copy link
Contributor Author

Uhm, where exactly? In https://github.com/JuliaLang/julia/blob/80dc13595c0aa29062705547debab679b5735c08/deps/openblas.mk I don't see anything PowerPC-specific (apart from a patch). Maybe I should just delete

julia/Make.inc

Lines 834 to 835 in e536c77

OPENBLAS_DYNAMIC_ARCH:=0
OPENBLAS_TARGET_ARCH:=POWER8
to allow optimising for the current architecture as we do on Intel?

@ViralBShah
Copy link
Member

That seems about right.

@vchuravy
Copy link
Sponsor Member

Yeah or just set dynamic arch to true

@ViralBShah
Copy link
Member

Not relevant for this PR, but it would be nice for all the logic to set the various OPENBLAS build options to live in openblas.mk.

@ViralBShah
Copy link
Member

If you just don't set OPENBLAS_TARGET_ARCH explicitly, we do default to DYNAMIC_ARCH=1 (higher up in Make.inc). May be best to just delete those two lines.

@giordano
Copy link
Contributor Author

Ok, done! To be honest I was a bit lost among those options 😅

@ViralBShah
Copy link
Member

Yeah, it is quite a maze. it would be nice to refactor those and put them all in openblas.mk.

@vchuravy
Copy link
Sponsor Member

Running make -C deps compile-openblas I see tuning for power9 and https://github.com/xianyi/OpenBLAS/blob/10be02c89605334b3095c0ac76f4aa328ae54f72/cmake/arch.cmake#L57-L58 does confirm that this is correct.

Nice!

vchuravy
vchuravy previously approved these changes Feb 16, 2023
@vchuravy vchuravy added the system:powerpc PowerPC label Feb 16, 2023
@vchuravy vchuravy dismissed their stale review February 16, 2023 15:51

Needs closer look

@vchuravy
Copy link
Sponsor Member

I spoke to soon.

It looks like we only built Power9...

/bin/sh: line 1: 609325 Segmentation fault      (core dumped) OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./test_sbgemm > SBBLAT3.SUMM

Make.inc Show resolved Hide resolved
@vchuravy
Copy link
Sponsor Member

Hm still getting a seqfault on Power8, but this time I actually saw it build many Power6, Power8, and Power9...

/bin/sh: line 1: 714674 Segmentation fault      (core dumped) OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 ./test_sbgemm > SBBLAT3.SUMM
make[2]: *** [Makefile:167: level3] Error 139
make[2]: Leaving directory '/nobackup/users/vchuravy/dev/julia/deps/scratch/openblas-b89fb708caa5a5a32de8f4306c4ff132e0228e9a/test'
make[1]: *** [Makefile:149: tests] Error 2
make[1]: Leaving directory '/nobackup/users/vchuravy/dev/julia/deps/scratch/openblas-b89fb708caa5a5a32de8f4306c4ff132e0228e9a'

@RajalakshmiSR
Copy link

What is the compiler version and make command used to build openblas? Are you trying it on POWER8 or POWER9?

@vchuravy
Copy link
Sponsor Member

This was with:

make USE_BINARYBUILDER_OPENBLAS=0 -C deps compile-openblas
[vchuravy@satori-login-001 ~]$ gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[vchuravy@satori-login-001 ~]$ cat /proc/cpuinfo 
processor	: 0
cpu		: POWER9, altivec supported
clock		: 3800.000000MHz
revision	: 2.2 (pvr 004e 1202)

Slightly surprised thought this was a Power8 cluster xD

@RajalakshmiSR
Copy link

This was with:

make USE_BINARYBUILDER_OPENBLAS=0 -C deps compile-openblas
[vchuravy@satori-login-001 ~]$ gcc --version
gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[vchuravy@satori-login-001 ~]$ cat /proc/cpuinfo 
processor	: 0
cpu		: POWER9, altivec supported
clock		: 3800.000000MHz
revision	: 2.2 (pvr 004e 1202)

Slightly surprised thought this was a Power8 cluster xD

Thanks, I can recreate it. Will debug this.

@RajalakshmiSR
Copy link

This is fixed here OpenMathLib/OpenBLAS#3718

@RajalakshmiSR
Copy link

openblas 0.3.22 will have the fix included.

@KristofferC KristofferC mentioned this pull request Feb 20, 2023
50 tasks
@KristofferC
Copy link
Sponsor Member

Good to go now?

@RajalakshmiSR
Copy link

Thanks. looks good.

@KristofferC KristofferC merged commit aacfcf0 into JuliaLang:master Feb 20, 2023
@giordano giordano deleted the mg/openblas branch February 20, 2023 14:50
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
* [OpenBLAS_jll] Upgrade to new build optimised for PowerPC

This only difference compared to previous build is that this one enables use of
dynamic architecture detection also for the PowerPC architecture.

---------

Co-authored-by: Valentin Churavy <[email protected]>
(cherry picked from commit aacfcf0)
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
* [OpenBLAS_jll] Upgrade to new build optimised for PowerPC

This only difference compared to previous build is that this one enables use of
dynamic architecture detection also for the PowerPC architecture.

---------

Co-authored-by: Valentin Churavy <[email protected]>
(cherry picked from commit aacfcf0)
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external dependencies Involves LLVM, OpenBLAS, or other linked libraries stdlib:JLLs system:powerpc PowerPC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants