-
Notifications
You must be signed in to change notification settings - Fork 99
Fixing tests #3589
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
base: main
Are you sure you want to change the base?
Fixing tests #3589
Conversation
djeong20
left a comment
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.
Thank you for your contribution. Please take a moment to review the comments below. :)
|
|
||
| result = kernel_concat_ptr->SetKernelArguments( | ||
| 0, clbuffInstance.getInBufferA()->GetBuffer(), sizeof(cl_mem)); | ||
| result = kernel_concat_ptr->SetKernelArguments(0, &bufferInA, sizeof(cl_mem)); |
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.
Would this also work in the same way?
| result = kernel_concat_ptr->SetKernelArguments(0, &bufferInA, sizeof(cl_mem)); | |
| result = kernel_concat_ptr->SetKernelArguments(0, &clbuffInstance.getInBufferA()->GetBuffer(), sizeof(cl_mem)); |
| void ClBufferManager::initBuffers() { | ||
| inBufferA = new opencl::Buffer(context_inst_, buffer_size_bytes, true); | ||
| inBufferB = new opencl::Buffer(context_inst_, buffer_size_bytes, true); | ||
| inBufferC = new opencl::Buffer(context_inst_, unused_buffer_bytes, true); |
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.
Let's also revert inBufferC since it is used for the attention_kernel, which is also one of the failing tests
| inBufferC = new opencl::Buffer(context_inst_, unused_buffer_bytes, true); | |
| inBufferC = new opencl::Buffer(context_inst_, buffer_size_bytes, true); |
| #include <cblas.h> | ||
| #include <cblas_interface.h> |
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.
I would not recommend directly including headers related to CBLAS. The reason is that there is an option called enable-blas, which only includes OpenBLAS when it is set to true. If you include the headers directly and enable-blas is set to false, it will result in an error. I personally suggest modifying the code accordingly.
nntrainer/nntrainer/tensor/cpu_backend/x86/x86_compute_backend.cpp
Lines 233 to 239 in b332f3f
| float snrm2(const unsigned int N, const float *X, const unsigned int incX) { | |
| #ifdef USE_BLAS | |
| return __cblas_snrm2(N, X, incX); | |
| #else | |
| return __fallback_snrm2(N, X, incX); | |
| #endif | |
| } |
Dependency of the PR
Commits to be reviewed in this PR
l2norm test fix
test: blas_kernels --> l2norm
problem: the output was compared against CPU version of the algorithm which turned out to be less precise
solution: using fp64 version of the CPU algorithm as ground truth
Self evaluation:
Signed-off-by: Anna Szal [email protected]
rotary_emb test fix
test: attention_kernels --> rotary_emb
problem: InBufferC is used as third input buffer which
solution: switch to outBufferB which is nor read-only and change its size to "buffer_size_bytes"
Self evaluation:
Signed-off-by: Anna Szal [email protected]
concatGPU test fix
test: layers--> ConcatGPU/LayerGoldenTest
problem: improper passing of buffers as arguments to SetKernelArguments()
solution: retrieve and store buffer pointer in a variable, then pass its address as the argument
Self evaluation:
Signed-off-by: Anna Szal [email protected]
Summary
Signed-off-by: Anna Szal [email protected]