libmir / mir-glas

[Experimental] LLVM-accelerated Generic Linear Algebra Subprograms
Other
103 stars 10 forks source link

Blog/Wiki/Documentation on your approach to writing glas and gemm algorithm #12

Open dataPulverizer opened 7 years ago

dataPulverizer commented 7 years ago

Hi,

Your glas library is very interesting, and the benchmark for your gemm is impressive. I think users and potential contributors would benefit greatly from a series of blogs or documentation explaining the design approach you have taken for the whole library and for the gemm algorithm.

One of the issues about D is that the advanced methods, idioms, and techniques are not particularly well popularised as they are in C++. So I think a good set of blogs describing the techniques used in this library would greatly help the community. The same thing extends to other mir libraries but I am more interested in glas.

Thank you

9il commented 7 years ago

Hi

The only D specific features was used is static if, static foreach, and pragma inline.

Other features is blocking, GLAS blocking is improved version of https://www.cs.utexas.edu/users/pingali/CS378/2008sp/papers/gotoPaper.pdf. LDC LLVM IR allows to make it generic.

If you are interesting to contribute or write an article we can chat in more details

dataPulverizer commented 7 years ago

Thanks for the paper, I shall read it today! I would be happy to begin by writing an article on the implementation details of gemm with you. I will start with me asking lots of questions! The best way might be for me to make some commented questions on a forked copy of the glas library and you can write your answers there. Once I have a good idea of how the code works for instance how it uses llvm to improve performance, how it does pre-fetching, and cpu specific targeting and the role D's template/library tools play in composing all these together, I would be happy to write the article with you.

9il commented 7 years ago

Looks good

dataPulverizer commented 7 years ago

I have started looking at the code in your glas library and decided to start with a small module with fewest dependencies to begin to understand the library. I have forked the library and made some comment questions on the glas.ndslice.d module:

https://github.com/dataPulverizer/mir-glas-comments/commit/20ef2b8a0d3fd621d2844103fc42081c61b71851

I await your comments. Cheers

RoyiAvital commented 6 years ago

Is MIR Multi Threaded (Like Eigen) or only Single Thread?

9il commented 6 years ago
  1. Mir GLAS is single thread and experimental.
  2. For other mir parts can be easily parallelised with https://dlang.org/phobos/std_parallelism.html as well as with some more efforts with C's alternatives