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

Gemm #50

Open
wants to merge 14 commits into
base: feature/ublas00004_simd_gemm
Choose a base branch
from
Open

Conversation

imre-palik
Copy link

Changes since last request:

  • reset my environment. it is based on uBLAS/ublas::develop
  • tests are compiling without warning on icc16

ShangtongZhang and others added 14 commits March 14, 2016 00:54
Fix bug in weak equality check
Add a simple convenience function to calculate the square norm (norm_2) of a vector
Commit e6b113 changed the `size_type` typedef to be based on the
container and in doing so missed the case in vector_norm_2 when
BOOST_UBLAS_SCALED_NORM is define. Also added test cases.
Fix compilation error when BOOST_UBLAS_SCALED_NORM is defined
This patch includes the gemm implementation from Michael Lehn to
boost::ublas.

This modifies the workings of ublas::prod() and ublas::axppy_prod()
to use gemm() above a certain matrix size.

This patch only contains the basic architecture, and a generic c++
implementation.

Signed-off-by: Imre Palik <[email protected]>
Cc: Michael Lehn <[email protected]>
This patch contains an optimised, vectorised kernel, using gcc's
SIMD vectors.  This reaches matrix multiplication speeds
comparable to hand-crafted assembly kernels on x86 Haswell
microarchitecture.

The kernels are compile-time parametrisable, ans the patch also
contains optimised kernel parameters for float, double, and long
double.

The validity of the parameters are checked during compile-time,
but the produced compile error can be relatively obscure if
vector_length is too big.

For architectures that doesn't support vectorisation for all types, it is
possible to specify parameters that cause really suboptimal code generation.
But as far as I see code correctness is ensured.

Signed-off-by: Imre Palik <[email protected]>
Cc: Michael Lehn <[email protected]>
This patch increases the range of BLAS level 3 benchmarks for dense
matrices up to 1000*1000 matrices.

Signed-off-by: Imre Palik <[email protected]>
This patch enables the optimised kernel for clang.
Sadly, when compiled by clang, the performance of this kernel on
Haswell is approximately half of the kernel compiled by gcc.
But it is still way faster than anything else.

Signed-off-by: Imre Palik <[email protected]>
…ix multiplication

If the preprocessor macro BOOST_UBLAS_LEGACY_PRODUCT is defined, then
both prod() and axpy_prod() falls back to the legacy matrix
multiplication algorithm.

Signed-off-by: Imre Palik <[email protected]>
This patch contains optimised kernels for multiplying complex matrices,
together with the kernel parameters I find decently performing on Haswell.

Signed-off-by: Imre Palik <[email protected]>
This patch adds vectorised kernel support for icc.  It is implemented
using cilk arrays.  It is tested on icc16, whith older versions
your mileage may vary.

The resulting kernel is still half the speed of the one compiled by
gcc.

Signed-off-by: Imre Palik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants