Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package OpenBLAS and use OpenBLAS in scipy (#3331)
- Loading branch information
Showing
41 changed files
with
444 additions
and
659 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -9,4 +9,4 @@ cpython | |
.vscode | ||
.pytest_cache | ||
.clang-format | ||
packages/CLAPACK/make.inc | ||
packages/libf2c/make.inc |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
45 changes: 45 additions & 0 deletions
45
packages/gensim/patches/0001-Avoid-signature-mismatch-in-sdot-detection.patch
This file contains 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,45 @@ | ||
From 2c816f54d3a6b056f42b97ad646789e9fe31a670 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= <loic.esteve@ymail.com> | ||
Date: Thu, 6 Apr 2023 17:52:34 +0200 | ||
Subject: [PATCH] Avoid signature mismatch in sdot detection. | ||
|
||
In Pyodide, OpenBLAS sdot returns float so use it rather than trying | ||
to adapt the somewhat tricky gensim logic. | ||
--- | ||
gensim/models/word2vec_inner.pyx | 20 +++----------------- | ||
1 file changed, 3 insertions(+), 17 deletions(-) | ||
|
||
diff --git a/gensim/models/word2vec_inner.pyx b/gensim/models/word2vec_inner.pyx | ||
index 1c0807ee..3d4a6847 100755 | ||
--- a/gensim/models/word2vec_inner.pyx | ||
+++ b/gensim/models/word2vec_inner.pyx | ||
@@ -939,23 +939,9 @@ def init(): | ||
EXP_TABLE[i] = <REAL_t>(EXP_TABLE[i] / (EXP_TABLE[i] + 1)) | ||
LOG_TABLE[i] = <REAL_t>log( EXP_TABLE[i] ) | ||
|
||
- # check whether sdot returns double or float | ||
- d_res = dsdot(&size, x, &ONE, y, &ONE) | ||
- p_res = <float *>&d_res | ||
- if abs(d_res - expected) < 0.0001: | ||
- our_dot = our_dot_double | ||
- our_saxpy = saxpy | ||
- return 0 # double | ||
- elif abs(p_res[0] - expected) < 0.0001: | ||
- our_dot = our_dot_float | ||
- our_saxpy = saxpy | ||
- return 1 # float | ||
- else: | ||
- # neither => use cython loops, no BLAS | ||
- # actually, the BLAS is so messed up we'll probably have segfaulted above and never even reach here | ||
- our_dot = our_dot_noblas | ||
- our_saxpy = our_saxpy_noblas | ||
- return 2 | ||
+ our_dot = our_dot_float | ||
+ our_saxpy = saxpy | ||
+ return 1 # float | ||
|
||
FAST_VERSION = init() # initialize the module | ||
MAX_WORDS_IN_BATCH = MAX_SENTENCE_LEN | ||
-- | ||
2.34.1 | ||
|
File renamed without changes.
This file contains 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
2 changes: 1 addition & 1 deletion
2
...es/CLAPACK/patches/0002-fix-arith.h.patch → ...ges/libf2c/patches/0001-fix-arith.h.patch
This file contains 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
2 changes: 1 addition & 1 deletion
2
...PACK/patches/0004-fix-f2clibs-build.patch → ...bf2c/patches/0002-fix-f2clibs-build.patch
This file contains 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
2 changes: 1 addition & 1 deletion
2
...tches/0005-remove-redundant-symbols.patch → ...tches/0003-remove-redundant-symbols.patch
This file contains 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
2 changes: 1 addition & 1 deletion
2
...K/patches/0006-correct-return-types.patch → ...c/patches/0004-correct-return-types.patch
This file contains 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
27 changes: 27 additions & 0 deletions
27
packages/libf2c/patches/0005-Remove-symbols-defined-in-OpenBLAS.patch
This file contains 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,27 @@ | ||
From eaf5c5db6e956036869255cb51831e720474d01d Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= <loic.esteve@ymail.com> | ||
Date: Fri, 7 Apr 2023 15:20:18 +0200 | ||
Subject: [PATCH 5/5] Remove symbols defined in OpenBLAS | ||
|
||
--- | ||
F2CLIBS/libf2c/Makefile | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/F2CLIBS/libf2c/Makefile b/F2CLIBS/libf2c/Makefile | ||
index 57eff0d..136050f 100644 | ||
--- a/F2CLIBS/libf2c/Makefile | ||
+++ b/F2CLIBS/libf2c/Makefile | ||
@@ -31,8 +31,8 @@ MISC = f77vers.o i77vers.o main.o s_rnge.o abort_.o exit_.o getarg_.o iargc_.o\ | ||
getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o ctype.o\ | ||
derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o | ||
POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o | ||
-CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o | ||
-DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o | ||
+CX = c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o | ||
+DCX = z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o | ||
REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\ | ||
r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\ | ||
r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\ | ||
-- | ||
2.34.1 | ||
|
Oops, something went wrong.