3 ms·
I've implemented the whole course in Nim in my tensor library: https://github.com/mratsim/Arraymancer/tree/master/src/tensor/fallback https://github.com/mratsim
by mratsim 9y ago
I've implemented the whole course in Nim in my tensor library: https://github.com/mratsim/Arraymancer/tree/master/src/tensor/fallback https://github.com/mratsim/Arraymancer/tree/master/src/tenso...
All BLAS libraries currently only care about float32 and float64, I wanted very fast routines for integer matrix multiplication and use this as a fallback for integers while
using OpenBLAS/MKL/CLBlast (OpenCL)/CuBLAS (CUDA) for floats.
Thanks to this I achieved 10x speed compared to Julia and 22x speed compared to Numpy on a 1500x1500 int64 matrix multiplication on CPU: https://github.com/mratsim/Arraymancer#micro-benchmark-int64-matrix-multiplication https://github.com/mratsim/Arraymancer#micro-benchmark-int64...
- gnufx 9y agoI don't know which operations are implemented for those types, but the "dnn" support in the libxsmm ("small matrix multiplication") library has I32, I16, and I8 <https://github.com/hfp/libxsmm> https://github.com/hfp/libxsmm>.
- mratsim 9y agoI did stumble upon libxsmm while looking for a BLAS library, I didn't see they had integers. Do you know what libxsmm means by "small", there is nothing in their README/wiki. However it does say that libxsmm doesn't support 32-bit OS. My library is used in IoT devices.
- hfp 9y ago* Small Matrix Multiplication: https://github.com/hfp/libxsmm/wiki/Q&A#what-is-a-small-matrix-multiplication https://github.com/hfp/libxsmm/wiki/Q&A#what-is-a-small-matr... * Big(ger) Matrix Multiplication: https://github.com/hfp/libxsmm/wiki/Q&A#what-about-medium-sized-and-bigger-matrix-multiplications https://github.com/hfp/libxsmm/wiki/Q&A#what-about-medium-si... There is indeed no support for 32-bit. Regarding integers, LIBXSMM supports lower-precision GEMM. However, we haven't fully represented this in our usual sample code (samples/xgemm, samples/bgemm). Put aside a tiling scheme for big matrices - the code generation for low-precision GEMM kernels is here: * https://github.com/hfp/libxsmm/blob/master/src/template/libxsmm.h#L135 https://github.com/hfp/libxsmm/blob/master/src/template/libx... * https://github.com/hfp/libxsmm/blob/master/src/template/libxsmm.h#L139 https://github.com/hfp/libxsmm/blob/master/src/template/libx... * Generic: https://github.com/hfp/libxsmm/blob/master/src/template/libxsmm.h#L124 https://github.com/hfp/libxsmm/blob/master/src/template/libx... with https://github.com/hfp/libxsmm/blob/master/include/libxsmm_generator.h#L68 https://github.com/hfp/libxsmm/blob/master/include/libxsmm_g... * C++: https://github.com/hfp/libxsmm/blob/master/src/template/libxsmm.h#L372 https://github.com/hfp/libxsmm/blob/master/src/template/libx...