Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [blas]

Basic Linear Algebra Subprograms - A standard API library with vector-vector, matrix-vector, and matrix-matrix operations.

1
vote
0answers
36 views

Fast calculation of $A^T B$

I need to compute a matrix-matrix product, $A^T B$, where $A$ is $n \times r$ sparse, and $B$ is $n \times q$ dense. The number of rows $n$ is far larger than both $r$ and $q$. In fact $n$ is so large ...
1
vote
1answer
50 views

Wrong result of 'ddot' from BLAS

I am having trouble with a C/C++ program that uses the BLAS routine ddot. I am running Linux and so far LAPACK routines worked without any problems. I get a wrong ...
1
vote
0answers
54 views

$ A * B $ computation when B is a symmetric matrix in armadillo

Is there any way to multiply a symmetric matrix by a dense one in armadillo(and use the fact that we have a symmetric matrix)? I know about DSYMM Routine in BLAS,...
1
vote
0answers
57 views

Kronecker product of matrices

I have to use Kronecker product of a matrix with a unit matrix is there any routine in ScaLapack or Lapack which can do so efficiently.
1
vote
0answers
67 views

Eigenvalue problem (LAPACK)

I am working on a project in numerical analysis which I have to program in C (using Lapack and Blas). Matrix is given which is tridiagonal and "almost" symmetric (one element is to be changed to make ...
1
vote
1answer
176 views

The difference between mkl_intel_lp64 vs mkl_gf_lp64 in a numerical reproducibility issue with Intel MKL

It has been discussed that Intel MKL can exhibit irreproducible behavior under certain conditions. In fact, this is a known thing and described by Intel as Conditional Numerical Reproducibility. A ...
1
vote
1answer
157 views

GPU libraries for integer matmul | overflow tolerated

Are there any high performance integer BLAS libraries that implement matrix multiplication i.e. i32gemm and i64gemm ? I need to use them for a cryptographic application and can tolerate overflows, i.e....
2
votes
0answers
70 views

What matrix criteria is “large enough” for Eigen to use a BLAS backend?

Eigen's documentation says that any BLAS back-end can be used (e.g. MKL) to perform the actual matrix calculations. It is, however, very vague when discussing the criteria as to which the ...
2
votes
1answer
259 views

Distributed (MPI) matrix matrix multiplication

I perform matrix matrix multiplications (between rank-3 and rank-2 arrays) in fortran using following subroutine, ...
16
votes
3answers
1k views

Are BLAS implementations guaranteed to give the exact same result?

Given two different BLAS implementations, can we expect that they make the exact same floating point computations and return the same results? Or can it happen, for instance, that one computes a ...
1
vote
2answers
2k views

BLAS libraries for Octave or Matlab, preferrably with GPU support?

I just searched around a bit for BLAS implementations and was amazed by the sheer amount of libraries around. Does someone know of a benchmark or otherwise rating of the various libraries? How easy ...
1
vote
1answer
84 views

Set strictly upper triangular part of a matrix to alpha using BLAS or LAPACK

Is there routine in standard BLAS or LAPACK to set strictly-upper triangular part (the part above the diagonal) of a matrix to alpha? I do not want to change diagonal elements so ...
4
votes
3answers
2k views

Beating typical BLAS libraries matrix multiplication performance

A dull matrix multiplication algorithm where we use the formula $$C_{ij}=\sum_{k}A_{ik}B_{kj}$$ By literally following this in 3 loops we'll get a very slow program, because we don't utilize ...
5
votes
2answers
438 views

Smart way to multiply 3 matrices

I have a quantum mechanics simulation where I need to multiply three matrices that look like this: $$\rho(t_1)=U^\dagger \rho(t_0) \, U$$ where $U^\dagger$ is the hermitian conjugate of $U$. This ...
3
votes
2answers
780 views

Fastest way to perform element-wise multiplication on a sparse matrix

I have two large-ish matrices (~100K cols x ~100K rows). They are sparse and symmetrical (about 0.1% of them values are non-zero). I want to do element-wise multiplication between them. Also, I ...
1
vote
1answer
194 views

Efficiently rotate vector in 2D (and 3D)

I need to efficiently rotate a 2D (and 3D) vector in a CUDA kernel. I was thinking about generating random unitary rotation matrices. I don't need to know the angle, it just has to be randomly ...
8
votes
0answers
2k views

Best Open Source BLAS / LAPACK package

I was wondering what is a more optimized open source BLAS/LAPACK package with respect to modern multi-core processors (Haswell and beyond). Is there any distribution that can attain performance close ...
3
votes
2answers
171 views

Optimized parallel routine for $X' W X$ with $W$ diagonal

$X$ is a dense matrix of real doubles, typically of size 20 million rows and 500 columns, and $W$ is a diagonal matrix of real, non-negative doubles stored as a vector. I'm working in C and have ...
3
votes
2answers
84 views

Do BLAS routines compute their respective operations with minimum error?

Do all BLAS routines compute the respective operation with minimum error ? i.e. Is the reduction in sdot computed with least error ? I need to call these ...
1
vote
1answer
250 views

Kronecker products and basis contractions (ie. B.A.Transpose[B]) in C?

I have implemented a basis transformation in C of the following form kron[A,A]*B*Transpose[kron[A,A]] where A and ...
1
vote
0answers
209 views

Sparse Linear Algebra vs Dense Linear Algebra

I am interested in a reference in the literature that discusses the performance of Dense Linear Algebra (blas routines) and dense linear algebra (sparse blas routines). I am interested in knowing for ...
3
votes
2answers
2k views

BLAS, LAPACK or ATLAS for Matrix Multiplication in C

I am trying to find the most optimized way to perform Matrix Multiplication of very large sizes in C language and under Windows 7 or Ubuntu 14.04. And searching led me to BLAS, LAPACK and ATLAS. ...
1
vote
1answer
104 views

How to make this matrix efficiently?

Originally posted on stats.stackexchange, I'll pair the post down to something a bit more general. Suppose I have vectors $\{\mathbf{\delta}, \mathbf{x}_1, \ldots, \mathbf{x}_J\}$, where $\delta \in \...
4
votes
1answer
134 views

Level 3 BLAS accelerated solver for banded linear systems.

At the moment I consider the following problem. I have a huge dense banded matrix $A$ which I want to factorize and use to solve linear systems $Ax=b$. $b$ has around more than 100 columns. At the ...
11
votes
2answers
557 views

Danger of complex arithmetics in scientific computing

The complex inner product $\langle u,v\rangle$ has two different definitions decided by conventions: $\bar{u}^Tv$ or $u^T\bar{v}$. In BLAS, I found the routines cdotu, zdotu, and cdotc, zdotc. The ...
2
votes
1answer
793 views

BLAS/LAPACK Non absolute sum

I need to know if there is some function in BLAS/LAPACK or some other Scientific Library that returns a non absolute sum of a vector/matrix. I've found the 'asum', but it returns only the absolute ...
2
votes
2answers
1k views

Impact of frequent row major / column major conversions using LAPACK/BLAS?

If you call a library like LAPACK or BLAS (which are written in FORTRAN and use column major order) from a C-like language that uses row major order, won't you lose performance and use a lot of memory ...
3
votes
1answer
182 views

How does matrix-matrix product scale with multiple CPUs?

These days, one can have 64 cores in a single node. I wonder how well the dense matrix-matrix product (SGEMM and DGEMM) scales ...
3
votes
3answers
1k views

Fast vector - “diagonal” matrix multiplication

Let $\mathbf{1}\in\mathbb{R}^d$ be a vector with all elements equal to $1$. Define: $$\mathbf{D} = \mathrm{diag}(\mathbf{1}^\top,\mathbf{1}^\top,\ldots,\mathbf{1}^\top) = \begin{bmatrix} 1 \cdots 1 &...
1
vote
2answers
146 views

Do vendors release their own LAPACK library?

Every CPU vendor seems to make BLAS libraries that are specialized to run on their hardware. Do they do the same for LAPACK? Or is that a non-issue because LAPACK is written entirely in terms of BLAS ...
6
votes
1answer
2k views

What is the best way to multiply a diagonal matrix (in fortran)

What is the best way to compute: $$ Y = D X $$ where $D \in \mathbb{R}^{m\times m}$ is diagonal and $X \in \mathbb{C}^{m \times n}$ is general. I am mostly interested in these two cases: $m >> ...
4
votes
2answers
270 views

How gracefully does scalapack/pblas revert to lapack/blas in serial

If I use scalapack and pblas, and the code is run in serial (1x1 blacs process grid), how well does scalapack and pblas revert to the performance of lapack/blas? I am particularly interested in the ...
3
votes
2answers
967 views

How Do I solve large systems given UMFPACK memory limitations?

I am trying to solve a system of equations (A x = b) for 3D heat diffusion (i.e. each equation has at most 7 terms not including the constant "b" term) using UMFPACK with boost numeric bindings to C++....
10
votes
6answers
1k views

Is there a reference-level implementation of BLAS in C/C++?

The netlib BLAS implementation is an excellent reference, being mostly un-optimized and well documented (e.g. zgemm). However, it is in Fortran 77, making it somewhat inaccessible to those with a ...
3
votes
4answers
3k views

How to tell which (sequential or parallel) version of Intel MKL is linked?

Recently I am using Umfpack with Intel MKL BLAS. To link the library to a program one has to link mkl_rt.lib / mkl_rt.so. However there is no word which version: sequential or parallel of library is ...
26
votes
3answers
3k views

What is the relationship of BLAS, LAPACK, and other linear algebra libraries?

I have been looking into C++ linear algebra libraries for a project I've been working on. Something that I still don't have any grasp on is the connection of BLAS and LAPACK to other linear algebra ...
5
votes
3answers
975 views

Performance optimization or tuning possible for Scalapack Gemm?

I'm comparing the performance of distributed gemm, using Scalapack over OpenBLAS, with threaded gemm, using OpenBLAS. It seems quite hard for me to get scalapack to give better results than ...
3
votes
2answers
548 views

How to make Elemental Gemm run quickly?

How to make Elemental Gemm run quickly? I have the following code: ...
1
vote
1answer
165 views

Does scalapack need threaded or unthreaded blas?

I'm compiling a blas to use with scalapack. Some blases, such as openblas, are naturally multithreaded, but scalapack uses mpi, so maybe needs a single-threaded blas? My questions then are: does ...
4
votes
1answer
1k views

How to do transpose for trtrs (or tptrs) in blas?

How to do transpose for trtrs (or tptrs) in blas? I want to solve: XA = B But it seems that trtrs only lets me solve: ...
6
votes
1answer
387 views

Reference BLAS/LAPACK from NETLIB is twice as fast as MKL for complex numbers

I'm solving the Helmholtz equation using PETSc. I found with the PETSc configure option --download-f-blas-lapack my program runs twice as fast over running it with ...
3
votes
1answer
2k views

Intel MKL - Difference between mkl_intel_lp64 and mkl_gf_lp64

I am currently trying to link a program against the Intel MKL 11.0 library instead of using NetLIB or OpenBLAS. Doing this I recognized the following error which I can not explain to my self at the ...
5
votes
1answer
3k views

Threaded OpenBlas benchmark slower than system blas?

I'm not sure if I did something wrong or if I just didn't understand the concept of an optimized BLAS. I'm a FEM engineer trying to optimize my setup on a small cluster computer (six nodes). I'm ...
1
vote
1answer
150 views

Understanding Inner blocking size in lapack/plasma

I could not get accurate description that aids to my understanding of inner blocking size parameter that is used in many LAPACK routines(such as DGEQRT, DLARFB). Thanks
5
votes
1answer
2k views

Magma vs. Plasma

I'm having a difficult time understanding the difference between the linear algebra packages MAGMA and PLASMA from just a quick glance. It looks like MAGMA is oriented towards GPU's and vector ...
11
votes
2answers
2k views

What are the fastest available implementations of BLAS/LAPACK or other linear algebra routines on GPU systems?

nVidia, for example, has CUBLAS, which promises 7-14x speedup. Naively, this is nowhere near the theoretical throughput of any of nVidia's GPU cards. What are the challenges in speeding up linear ...
3
votes
2answers
190 views

Efficiently changing basis on many diagonal matrices

I have to perform a [complex] basis transformation on a large number of [real] diagonal matrices: $$ \langle b_i | A | b_j \rangle = \sum_k \langle b_i | \bar{b}_k\rangle \langle\bar{b}_k | A | \bar{b}...
8
votes
1answer
162 views

Sudden drops in matrix multiplication performance

I've been reading about implementing dense matrix multiplication when the matrix doesn't fit in cache. One of the graphs I've seen (slide 9 from these slides) shows sudden drops in performance using ...
-1
votes
2answers
4k views

BLAS/LAPACK subroutine to add two matrices with different offsets and leading dimensions

I currently searching for a subroutine from BLAS or LAPACK which realizes the following operation A = alpha*A + beta * B where A and B have different leading ...
9
votes
1answer
682 views

Does PETSc ever make use of LAPACK libraries for sparse matrix math?

Does compiling PETSc with an external BLAS/LAPACK library significantly affect performance on sparse matrices, or does it only use those libraries for dense matrix math?