-
Hello,guys,I made some modification in openblas (add a new function cblas_mygemm)and I wanna to use it in mxnet , is there have a place or something to call cblas_sgemm() in mxnet source code ? Hope for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
cc @larroy |
Beta Was this translation helpful? Give feedback.
-
Hi @knjwhn The blas calls are generated with some preprocessor macro magic as you can see from here: https://github.com/apache/incubator-mxnet/blob/master/src/operator/linalg_impl.h#L149 I think you might be able to do what you want around these functions. |
Beta Was this translation helpful? Give feedback.
-
Thanks! and there still a question, what if my gemmlib only contains cblas_sgemm , can it pass the compile? because i see there is another function like trmm. |
Beta Was this translation helpful? Give feedback.
-
could you clarify your question? You mean there's two functions with the same name when linking? |
Beta Was this translation helpful? Give feedback.
-
yeah, I made a new sgemm function(name not same as cblas_sgemm) in a lite version Openblas(I called gemmlib),and I want use it in mxnet, Do you have some suggestion?Many thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @knjwhn I think you want to link mxnet with your library and call the function in the dispatcher for the linalg operations if I understood your intention correctly. |
Beta Was this translation helpful? Give feedback.
-
Yeah,that’s my intention, I want to test it in DNN training (especially in convolution),Do you have some suggestion that how can I change the makefile?
发自我的iPhone
…------------------ Original ------------------
From: Pedro Larroy <[email protected]>
Date: Sat,Oct 26,2019 6:24 AM
To: apache/incubator-mxnet <[email protected]>
Cc: He Nan <[email protected]>, Mention <[email protected]>
Subject: Re: [apache/incubator-mxnet] Where is the place that mxnet call cblas_gemm if I use openblas? (#16557)
Hi @knjwhn I think you want to link mxnet with your library and call the function in the dispatcher for the linalg operations if I understood your intention correctly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
You can see how libraries are added in the CMakefile, for make just link with your library. Let me know if you have issues. That should be straighforward. |
Beta Was this translation helpful? Give feedback.
-
in cmake you can use |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot , I modified the makefile and compile it successsfully. and I run the example/image-classfication/train_mnist.py ,However I don't know if my sgemm is called? What should I do? and There is another question , I wrote an int8 gemm function(A:u8/s8 B:u8/s8 C:int32),can it use in convolution calculation after quantization? Hope for your help. |
Beta Was this translation helpful? Give feedback.
-
Hi @knjwhn, |
Beta Was this translation helpful? Give feedback.
-
Thanks,I've done that. and instead of float32 type . I wrote an int8 openblas gemm function(A:u8/s8 B:u8/s8 C:int32),can it use in convolution calculation after quantization? Hope for your help. |
Beta Was this translation helpful? Give feedback.
Hi @knjwhn,
https://github.com/apache/incubator-mxnet/blob/60d74bc948869588c2f143fd3d55231859dc979f/src/operator/linalg_impl.h#L149