-
Notifications
You must be signed in to change notification settings - Fork 686
OpenBLAS: New version 0.3.31 #12970
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
Open
eschnett
wants to merge
31
commits into
JuliaPackaging:master
Choose a base branch
from
eschnett:eschnett/openblas-0.3.31
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
OpenBLAS: New version 0.3.31 #12970
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e9d25d7
[OpenBLAS] Update to 0.3.30
imciner2 e5dbd41
Add patch to fix compilation of SBGEMM Neoversev1 kernel
imciner2 ca77865
Remove old patch
imciner2 255afe7
Increase LLVM version to get newer aarch64 instructions
imciner2 b1d9941
Add printing of build flags to make it obvious what we do
imciner2 25b2ed7
Merge branch 'master' into im/ob0.3.30
eschnett 43bbf5f
Correct aarch64 build problems
eschnett 51854bc
OpenBLAS: Correct aarch64 build problems
eschnett da7d7c5
OpenBLAS: Correct Darwin patch
eschnett 401f1ad
Merge branch 'master' into eschnett/openblas-0.3.30
eschnett cef04a7
OpenBLAS: Save state
eschnett d32b938
Merge branch 'master' into eschnett/openblas-0.3.30
eschnett 0d1e203
Add bfloat16 for all platforms
eschnett e60dca6
OpenBLAS: Reduce build parallelism
eschnett c0fbcf7
OpenBLAS: Reduce build parallelism
eschnett 559c696
OpenBLAS: Build with LLVM 18
eschnett 2d9613a
OpenBLAS: Add float16 support
eschnett a8a1bd2
Merge branch 'master' into eschnett/openblas-0.3.31
eschnett 20f51e6
OpenBLAS: Disable -Werror, or try to
eschnett 268e40b
OpenBLAS: Correct x86_64-apple build
eschnett fed83f9
OpenBLAS: All working now
eschnett 80547c5
OpenBLAS: Undo accidental delete
eschnett 92adfcf
Use GCC 11 except for aarch64-*-darwin*
eschnett c98c48d
Correct platform selection
eschnett f8deaf3
Debug platform selection
eschnett d9ac582
Debug platform selection
eschnett 517f59f
Debug platform selection
eschnett 7ce67d6
Debug platform selection
eschnett 67fc816
Require GCC 12
eschnett 1ab7574
Trigger rebuild
eschnett f788045
Trigger rebuild
eschnett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| using BinaryBuilder | ||
|
|
||
| include("../common.jl") | ||
|
|
||
| # Collection of sources required to build OpenBLAS | ||
| name = "OpenBLAS32" | ||
| version = v"0.3.31" | ||
|
|
||
| sources = openblas_sources(version) | ||
| script = openblas_script(openblas32=true, bfloat16=true, float16=true) | ||
| platforms = openblas_platforms(; version) | ||
| products = openblas_products() | ||
| preferred_gcc_version = v"11" | ||
| preferred_llvm_version = v"18.1.7" | ||
| dependencies = openblas_dependencies(platforms; llvm_compilerrt_version=preferred_llvm_version) | ||
|
|
||
| # Do we build all platforms, or those specified as arguments? | ||
| platform_args = filter(arg -> !startswith(arg, "--"), ARGS) | ||
| if !isempty(platform_args) | ||
| @assert length(platform_args) == 1 | ||
| platforms = BinaryBuilderBase.parse_platform.(split(platform_args[1], ",")) | ||
| end | ||
|
|
||
| aarch64_darwin_preferred_gcc_version = v"15" | ||
|
|
||
| # The regular options, excluding the list of platforms | ||
| option_args = filter(arg -> startswith(arg, "--"), ARGS) | ||
| non_register_option_args = filter(arg -> arg != "--register", option_args) | ||
|
|
||
| for (n,platform) in enumerate(platforms) | ||
| # We register the build products only after the last build. | ||
| args = n == length(platforms) ? option_args : non_register_option_args | ||
|
|
||
| build_tarballs(args, name, version, sources, script, non_msan_platforms, products, dependencies; | ||
| julia_compat="1.11", | ||
| lock_microarchitecture=false, | ||
| preferred_gcc_version = | ||
| arch(platform) == "aarch64" && Sys.isapple(platform) ? | ||
| aarch64_darwin_preferred_gcc_version : preferred_gcc_version, | ||
| preferred_llvm_version=preferred_llvm_version, | ||
| ) | ||
| end | ||
|
|
||
| # Build trigger: 0 |
21 changes: 21 additions & 0 deletions
21
O/OpenBLAS/OpenBLAS32@0.3.31/bundled/patches/10-dynamic-riscv64.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| diff --git a/driver/others/dynamic_riscv64.c b/driver/others/dynamic_riscv64.c | ||
| index 726f76d79..919663b22 100644 | ||
| --- a/driver/others/dynamic_riscv64.c | ||
| +++ b/driver/others/dynamic_riscv64.c | ||
| @@ -99,7 +99,7 @@ struct riscv_hwprobe { | ||
| #define RISCV_HWPROBE_IMA_V (1 << 2) | ||
| #define RISCV_HWPROBE_EXT_ZFH (1 << 27) | ||
| #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) | ||
| -#define RISCV_HWPROBE_EXT_ZVFBFWMA (1 << 54) | ||
| +#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 54) | ||
|
|
||
| #ifndef NR_riscv_hwprobe | ||
| #ifndef NR_arch_specific_syscall | ||
| @@ -152,6 +152,7 @@ char* gotoblas_corename(void) { | ||
| static gotoblas_t* get_coretype(void) { | ||
| uint64_t vector_mask; | ||
| unsigned vlenb = 0; | ||
| + char coremsg[128]; | ||
|
|
||
| #if !defined(OS_LINUX) | ||
| return NULL; |
170 changes: 170 additions & 0 deletions
170
O/OpenBLAS/OpenBLAS32@0.3.31/bundled/patches/50-openblas-winexit.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,170 @@ | ||
| diff --git a/driver/others/memory.c b/driver/others/memory.c | ||
| index 6e654ccf..1d2f9f12 100644 | ||
| --- a/driver/others/memory.c | ||
| +++ b/driver/others/memory.c | ||
| @@ -1534,7 +1534,7 @@ void CONSTRUCTOR gotoblas_init(void) { | ||
|
|
||
| } | ||
|
|
||
| -void DESTRUCTOR gotoblas_quit(void) { | ||
| +void gotoblas_quit(void) { | ||
|
|
||
| if (gotoblas_initialized == 0) return; | ||
|
|
||
| @@ -1572,75 +1572,11 @@ void DESTRUCTOR gotoblas_quit(void) { | ||
| } | ||
|
|
||
| #if defined(_MSC_VER) && !defined(__clang__) | ||
| -BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) | ||
| -{ | ||
| - switch (ul_reason_for_call) | ||
| - { | ||
| - case DLL_PROCESS_ATTACH: | ||
| - gotoblas_init(); | ||
| - break; | ||
| - case DLL_THREAD_ATTACH: | ||
| - break; | ||
| - case DLL_THREAD_DETACH: | ||
| -#if defined(SMP) | ||
| - blas_thread_memory_cleanup(); | ||
| -#endif | ||
| - break; | ||
| - case DLL_PROCESS_DETACH: | ||
| - gotoblas_quit(); | ||
| - break; | ||
| - default: | ||
| - break; | ||
| - } | ||
| - return TRUE; | ||
| -} | ||
| - | ||
| -/* | ||
| - This is to allow static linking. | ||
| - Code adapted from Google performance tools: | ||
| - https://gperftools.googlecode.com/git-history/perftools-1.0/src/windows/port.cc | ||
| - Reference: | ||
| - https://sourceware.org/ml/pthreads-win32/2008/msg00028.html | ||
| - http://ci.boost.org/svn-trac/browser/trunk/libs/thread/src/win32/tss_pe.cpp | ||
| -*/ | ||
| -static int on_process_term(void) | ||
| -{ | ||
| - gotoblas_quit(); | ||
| - return 0; | ||
| -} | ||
| #ifdef _WIN64 | ||
| #pragma comment(linker, "/INCLUDE:_tls_used") | ||
| #else | ||
| #pragma comment(linker, "/INCLUDE:__tls_used") | ||
| #endif | ||
| - | ||
| -#ifdef _WIN64 | ||
| -#pragma const_seg(".CRT$XLB") | ||
| -#else | ||
| -#pragma data_seg(".CRT$XLB") | ||
| -#endif | ||
| - | ||
| -#ifdef _WIN64 | ||
| -static const PIMAGE_TLS_CALLBACK dll_callback(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; | ||
| -#pragma const_seg() | ||
| -#else | ||
| -static void (APIENTRY *dll_callback)(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; | ||
| -#pragma data_seg() | ||
| -#endif | ||
| - | ||
| -#ifdef _WIN64 | ||
| -#pragma const_seg(".CRT$XTU") | ||
| -#else | ||
| -#pragma data_seg(".CRT$XTU") | ||
| -#endif | ||
| - | ||
| -#ifdef _WIN64 | ||
| -static const int(*p_process_term)(void) = on_process_term; | ||
| -#pragma const_seg() | ||
| -#else | ||
| -static int(*p_process_term)(void) = on_process_term; | ||
| -#pragma data_seg() | ||
| -#endif | ||
| #endif | ||
|
|
||
| #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64)) | ||
| @@ -3146,7 +3082,7 @@ void CONSTRUCTOR gotoblas_init(void) { | ||
|
|
||
| } | ||
|
|
||
| -void DESTRUCTOR gotoblas_quit(void) { | ||
| +void gotoblas_quit(void) { | ||
|
|
||
| if (gotoblas_initialized == 0) return; | ||
|
|
||
| @@ -3175,71 +3111,6 @@ void DESTRUCTOR gotoblas_quit(void) { | ||
| #endif | ||
| } | ||
|
|
||
| -#if defined(_MSC_VER) && !defined(__clang__) | ||
| -BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) | ||
| -{ | ||
| - switch (ul_reason_for_call) | ||
| - { | ||
| - case DLL_PROCESS_ATTACH: | ||
| - gotoblas_init(); | ||
| - break; | ||
| - case DLL_THREAD_ATTACH: | ||
| - break; | ||
| - case DLL_THREAD_DETACH: | ||
| - break; | ||
| - case DLL_PROCESS_DETACH: | ||
| - gotoblas_quit(); | ||
| - break; | ||
| - default: | ||
| - break; | ||
| - } | ||
| - return TRUE; | ||
| -} | ||
| - | ||
| -/* | ||
| - This is to allow static linking. | ||
| - Code adapted from Google performance tools: | ||
| - https://gperftools.googlecode.com/git-history/perftools-1.0/src/windows/port.cc | ||
| - Reference: | ||
| - https://sourceware.org/ml/pthreads-win32/2008/msg00028.html | ||
| - http://ci.boost.org/svn-trac/browser/trunk/libs/thread/src/win32/tss_pe.cpp | ||
| -*/ | ||
| -static int on_process_term(void) | ||
| -{ | ||
| - gotoblas_quit(); | ||
| - return 0; | ||
| -} | ||
| -#ifdef _WIN64 | ||
| -#pragma comment(linker, "/INCLUDE:_tls_used") | ||
| -#else | ||
| -#pragma comment(linker, "/INCLUDE:__tls_used") | ||
| -#endif | ||
| - | ||
| -#ifdef _WIN64 | ||
| -#pragma const_seg(".CRT$XLB") | ||
| -#else | ||
| -#pragma data_seg(".CRT$XLB") | ||
| -#endif | ||
| -static void (APIENTRY *dll_callback)(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; | ||
| -#ifdef _WIN64 | ||
| -#pragma const_seg() | ||
| -#else | ||
| -#pragma data_seg() | ||
| -#endif | ||
| - | ||
| -#ifdef _WIN64 | ||
| -#pragma const_seg(".CRT$XTU") | ||
| -#else | ||
| -#pragma data_seg(".CRT$XTU") | ||
| -#endif | ||
| -static int(*p_process_term)(void) = on_process_term; | ||
| -#ifdef _WIN64 | ||
| -#pragma const_seg() | ||
| -#else | ||
| -#pragma data_seg() | ||
| -#endif | ||
| -#endif | ||
| - | ||
| #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64)) | ||
| /* Don't call me; this is just work around for PGI / Sun bug */ | ||
| void gotoblas_dummy_for_PGI(void) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| using BinaryBuilder | ||
| using BinaryBuilderBase | ||
|
|
||
| include("../common.jl") | ||
|
|
||
| # Collection of sources required to build OpenBLAS | ||
| name = "OpenBLAS" | ||
| version = v"0.3.31" | ||
|
|
||
| sources = openblas_sources(version) | ||
| script = openblas_script(; aarch64_ilp64=true, num_64bit_threads=512, bfloat16=true) | ||
| platforms = openblas_platforms(; version) | ||
| # Note: The msan build doesn't use gfortran, and we thus don't expand the gfortran versions | ||
| push!(platforms, Platform("x86_64", "linux"; sanitize="memory")) | ||
| products = openblas_products() | ||
| preferred_gcc_version = v"11" | ||
| preferred_llvm_version = v"18.1.7" | ||
| dependencies = openblas_dependencies(platforms; llvm_compilerrt_version=preferred_llvm_version) | ||
|
|
||
| # Everything below is necessary only because we need to build msan platforms with a different LLVM version. | ||
| # We can only build msan platforms with LLVM 13, but we need to build non-msan builds with LLVM 17 to get bfloat16 support. | ||
| # | ||
| # For the love of god, can someone PLEASE just build msan support for a modern LLVM? | ||
|
|
||
| # Do we build all platforms, or those specified as arguments? | ||
| platform_args = filter(arg -> !startswith(arg, "--"), ARGS) | ||
| if !isempty(platform_args) | ||
| @assert length(platform_args) == 1 | ||
| platforms = BinaryBuilderBase.parse_platform.(split(platform_args[1], ",")) | ||
| end | ||
|
|
||
| msan_preferred_llvm_version = v"13.0.1+0" | ||
| aarch64_darwin_preferred_gcc_version = v"15" | ||
|
|
||
| # The regular options, excluding the list of platforms | ||
| option_args = filter(arg -> startswith(arg, "--"), ARGS) | ||
| non_register_option_args = filter(arg -> arg != "--register", option_args) | ||
|
|
||
| for (n,platform) in enumerate(platforms) | ||
| # We register the build products only after the last build. | ||
| args = n == length(platforms) ? option_args : non_register_option_args | ||
|
|
||
| build_tarballs(args, name, version, sources, script, non_msan_platforms, products, dependencies; | ||
| julia_compat="1.11", | ||
| lock_microarchitecture=false, | ||
| preferred_gcc_version = | ||
| arch(platform) == "aarch64" && Sys.isapple(platform) ? | ||
| aarch64_darwin_preferred_gcc_version : preferred_gcc_version, | ||
| preferred_llvm_version = sanitize(platform) == "memory" ? msan_preferred_llvm_version : preferred_llvm_version, | ||
| ) | ||
| end | ||
|
|
||
| # Build trigger: 0 | ||
21 changes: 21 additions & 0 deletions
21
O/OpenBLAS/OpenBLAS@0.3.31/bundled/patches/10-dynamic-riscv64.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| diff --git a/driver/others/dynamic_riscv64.c b/driver/others/dynamic_riscv64.c | ||
| index 726f76d79..919663b22 100644 | ||
| --- a/driver/others/dynamic_riscv64.c | ||
| +++ b/driver/others/dynamic_riscv64.c | ||
| @@ -99,7 +99,7 @@ struct riscv_hwprobe { | ||
| #define RISCV_HWPROBE_IMA_V (1 << 2) | ||
| #define RISCV_HWPROBE_EXT_ZFH (1 << 27) | ||
| #define RISCV_HWPROBE_EXT_ZVFH (1 << 30) | ||
| -#define RISCV_HWPROBE_EXT_ZVFBFWMA (1 << 54) | ||
| +#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 54) | ||
|
|
||
| #ifndef NR_riscv_hwprobe | ||
| #ifndef NR_arch_specific_syscall | ||
| @@ -152,6 +152,7 @@ char* gotoblas_corename(void) { | ||
| static gotoblas_t* get_coretype(void) { | ||
| uint64_t vector_mask; | ||
| unsigned vlenb = 0; | ||
| + char coremsg[128]; | ||
|
|
||
| #if !defined(OS_LINUX) | ||
| return NULL; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.