flame / blis

BLAS-like Library Instantiation Software Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Want to know how to find which microkernel does the gemm use

Realtyxxx opened this issue · comments

I would want to know how does the gemm function use the gemm's kernel which are in the directory kernel?
specific , I'm using zen architecture and armv8 without sve

@Realtyxxx Welcome to BLIS and I hope you will learn a lot from BLIS like I did.

First ,I recommend reading the Goto's algorithm. BLIS is built on top of these algorithms.

Then you can give a look at what micro-kernels are and how they are named in https://github.com/flame/blis/blob/master/docs/KernelsHowTo.md

BLIS also has a GEMM sandbox for newcomers. @fgvanzee can give you more info about that.

While the course might still be of value, I'm not sure @Realtyxxx's question would be answered by @rvdg's MOOC.

@Realtyxxx Is your question about the BLIS infrastructure? That is, are you trying to understand how the microkernel functions defined in the appropriate kernels subdirectory get called by the gemm operation provided by BLIS? Or maybe your question is about where in the code they get called? Letting us know what specifically you are interested in will allow us to better guide you.

Thank you for you advices I just find out which sub directory's code the gemm operation has called, but now I have a new question, when I called a gemm operation ,I find that my codes used the file bli_gemm_int.c several times , I don't understand why, this is the print message I get (I set printf function in several files which I think the gemm function would use) :
image

@Realtyxxx Great question. The bli_gemm_int() function serves as an abstraction that allows BLIS to sort of pause and decide which loop to partition over next (that is, which algorithmic variant to call next). How it decides is determined by the makeup of the control tree that it is given. (In case you are curious, the int is supposed to be short for "internal.")

Devin is in the middle of a refactorization that will eliminate bli_gemm_int() altogether. Each variant will be able to call the next variant directly.

OKkk ,but why does the bli_gemm_int.c call itself ? and I don't know about the control tree, could you please tell me where can I get more message about that ?😁

You can check bli_gemm_cntl_create() function in file "frame\3\gemm\bli_gemm_cntl.c" which is called from bli_l3_cntl_create_if() as part of bli_l3_thread_decorator() where actual openmp/pthread parallelization happens.

You can check bli_gemm_cntl_create() function in file "frame\3\gemm\bli_gemm_cntl.c" which is called from bli_l3_cntl_create_if() as part of bli_l3_thread_decorator() where actual openmp/pthread penalization happens.

cool ,this helps a lot