On Fri, Dec 17, 2021 at 02:43:00PM +0100, Rafael Sadowski wrote: > > On Fri Dec 17, 2021 at 01:03:30PM +0800, Kevin Lo wrote: > > Hi, > > > > Please find attached a port of the openblas. > > > > Description: > > OpenBLAS is an optimized BLAS (Basic Linear Algebra Subprograms) library > > based on GotoBLAS2 1.13 BSD version. > > > > It's loosely based on the one at openbsd-wip [1]. > > I tested on i386, amd64, arm, arm64, and mips64. > > > > I didn't test on others platforms due to lack of hardware. > > > > If somebody is interested, can you give it a try, check if it works for > > you and give some feedback? Thanks. > > > > [1] https://github.com/jasperla/openbsd-wip/tree/master/math/openblas > > > > Regards, > > Kevin > > I like to see openblas, I really do. But I think it will be found by > many other ports when it is imported. Checkout "This port is required > by" from https://www.freshports.org/math/openblas/ > > That means a bit more work needs to happen here, doesn't it?
Thanks for the feedback. I don't know if we want to replace math/{blas,cblas,lapack} dependencies of ports with math/openblas. I only tested math/{py-numpy,py-scipy}, seems to be working fine. There's a numpy benchmark is available on the net [1]. I changed the matrix sizes to 2048 [2]. Let's find out how the different implementation compare in terms of performance on my PC. $ sysctl hw.model hw.model=Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz blas & lapack: Dotted two 2048x2048 matrices in 6.69 s. Dotted two vectors of length 262144 in 0.33 ms. SVD of a 1024x512 matrix in 1.13 s. Cholesky decomposition of a 1024x1024 matrix in 0.15 s. Eigendecomposition of a 1024x1024 matrix in 6.79 s. openblas: Dotted two 2048x2048 matrices in 0.18 s. Dotted two vectors of length 262144 in 0.04 ms. SVD of a 1024x512 matrix in 0.14 s. Cholesky decomposition of a 1024x1024 matrix in 0.04 s. Eigendecomposition of a 1024x1024 matrix in 1.41 s. $ sysctl hw.{model,product} hw.model=ARM Cortex-A72 r0p3 hw.product=Raspberry Pi 4 Model B Rev 1.1 blas & lapack: Dotted two 2048x2048 matrices in 49.86 s. Dotted two vectors of length 262144 in 1.94 ms. SVD of a 1024x512 matrix in 8.78 s. Cholesky decomposition of a 1024x1024 matrix in 1.63 s. Eigendecomposition of a 1024x1024 matrix in 50.11 s. openblas: Dotted two 2048x2048 matrices in 3.21 s. Dotted two vectors of length 262144 in 1.96 ms. SVD of a 1024x512 matrix in 2.08 s. Cholesky decomposition of a 1024x1024 matrix in 0.39 s. Eigendecomposition of a 1024x1024 matrix in 12.34 s. [1] https://gist.github.com/markus-beuckelmann/8bc25531b11158431a5b09a45abd6276 [2] https://gist.github.com/markus-beuckelmann/8bc25531b11158431a5b09a45abd6276#file-numpy-benchmark-py-L14