sarah-quinones / faer-rs

Linear algebra foundation for the Rust programming language
https://faer-rs.github.io
MIT License
1.82k stars 61 forks source link

Support integer Sparse Matrix #145

Closed ThomAub closed 2 months ago

ThomAub commented 2 months ago

Is your feature request related to a problem? Please describe.

This is not a real issue, maybe an improvement for this great crate ? I'm will

I was trying to understand if it would be possible to support integer matrices for simple matrix multiplication or matrix-vector multiplication. Faer is great to use and very efficient, and I wanted to see if I could use quantization for extra performance. If this adds too much complexity to this crate, gemm and nano-gemm maybe it could be behind a cargo feature ?

sarah-quinones commented 2 months ago

integer operations are not on my roadmap since they require a more complicated api. for example integer matrix multiplication typically uses an accumulator type that is wider than the input types (e.g. u8×u8 -> u32), where as faer expects the same type to be used everywhere

if all you want is matrix multiplication, a separate project would be a better idea

ThomAub commented 2 months ago

Thanks ! Do you have any good read for this kind of workload and tips to build such project ?

sarah-quinones commented 2 months ago

if you want to learn about high perf matrix multiplication, you can take a look at the blis publications https://github.com/flame/blis?tab=readme-ov-file#citations

ThomAub commented 2 months ago

Thanks !