-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ blas/OpenCL ] Added multiply OpenCL kernel and unit test #2630
Conversation
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2630. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s-debadri, 💯 All CI checkers are successfully verified. Thanks.
9b1e33b
to
8baf1c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s-debadri, 💯 All CI checkers are successfully verified. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall, LGTM
@@ -662,6 +662,10 @@ std::string RunLayerContext::getKernelName(LayerKernel layerKernel) { | |||
return "dot_cl_fp16"; | |||
case LayerKernel::SGEMM_FP16: | |||
return "sgemm_cl_fp16"; | |||
case LayerKernel::SSCAL: | |||
return "sscal_cl"; | |||
case LayerKernel::SSCAL_FP16: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep in mind that sscal_fp16
should later be hscal
!
* @brief Process data and dimensions for OpenCL dot operation | ||
* @param[in] input Tensor | ||
* @param[in] m Tensor | ||
* @param[in] result Tensor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param[in] result Tensor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in latest commit.
|
||
/** | ||
* @brief fp16 sscal value element by element immediately | ||
* @param[in] X float * input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param[in] X float * input | |
* @param[in] X __fp16 * input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s-debadri, 💯 All CI checkers are successfully verified. Thanks.
@@ -662,6 +662,10 @@ std::string RunLayerContext::getKernelName(LayerKernel layerKernel) { | |||
return "dot_cl_fp16"; | |||
case LayerKernel::SGEMM_FP16: | |||
return "sgemm_cl_fp16"; | |||
case LayerKernel::SSCAL: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cl kernel information should be handled in cl context. Otherwise, we cannot support the custom cl layer. We do need CLLernel Class and it should be managed in Cl_Context. and if the layer is created, then N Cl kernel should be mapped to the layer object. and also, if there is a custom cl layer, the cl kernel must be registered to the cl context. I guess the basic cl kernels for dot, sgemm, etc. could be managed as an basic cl math kernels we provide and CLKernel has the list of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, this will be done in future PRs.
@@ -30,6 +30,14 @@ void dotBatchedCl(Tensor const &input, Tensor const &m, Tensor &result, | |||
} | |||
} | |||
|
|||
Tensor dotCl(Tensor const &input, Tensor const &m, RunLayerContext &context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RunLayerContext should be used as a data provider. It shouldn't have Kernel related information.
This dotCL level could be the CLKernel Class. I guess. and managed in clAppContext.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, this will be done in future PRs.
Added sscal equivalent kernel and multiply function. Added unit test setup to test standalone kernels. Signed-off-by: Debadri Samaddar <[email protected]>
Modified doxygen docs as required Signed-off-by: Debadri Samaddar <[email protected]>
cb9c323
to
bce13bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s-debadri, 💯 All CI checkers are successfully verified. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
sscal
equivalent kernel added for multiply.unittest_blas_kernels_cl.cpp
for easily testing OpenCL kernels.dotCl
.Self evaluation:
Signed-off-by: Debadri Samaddar [email protected]