daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
65 stars 57 forks source link

Efficient matrix-matrix/matrix-vector multiplication for generic value types #521

Open pdamme opened 1 year ago

pdamme commented 1 year ago

Motivation: Matrix multiplications are at the heart of many machine learning algorithms, and are often very expensive operations. Therefore, highly optimized kernels exist (e.g., in BLAS). These are typically tailored to common value types such as float or double. However, DAPHNE aims to be extensible w.r.t. the value type.

Task: Implement (C++) efficient kernels for general matrix-matrix and matrix-vector multiplication of dense matrices. Like most DAPHNE kernels, these should get the value type as a template parameter, such that various types like float and double, but also int64_t or uint8_t could be used with the same algorithm implementation. The kernels should be able to handle views into an existing matrix.

Hints:

Possible task extensions for larger teams:

pdamme commented 1 year ago

There is a related issue (#352) and pull-request (#384). However, #384 only uses floating-point numbers for the integers, which loses precision.