Adding rocBLAS support for BLAS domain through Intel DPCPP compiler with HIP backend support#189
Conversation
|
@TejaX-Alaghari Thank you for this PR! I have built and successfully tested it on an application containing SYCL code. Just had to adjust the following line in FindrocBLAS.cmake to |
|
Thanks for the suggestion @ajaypanyala. I've added a commit for that change. |
There was a problem hiding this comment.
Thanks for the PR. Looking forward to add this feature.
I added some initial feedback. General comments:
- Please check if the comments added for cuBLAS backend still makes sense here as well. And if yes, update them accordingly.
- Please use sycl:: namespace throughout the project.
- Please make sure header guards match header names.
- Please test rocBLAS backend with hipSYCL so make sure nothing is broken. Update logs.
- I have some concerns about Copyrights - will add my feedback later ==> feedback added
- Please update README and docs folder as needed.
- In the test logs, please test MKLCPU backend as well. Also, I see segfault errors. Can you fix them?
CMakeLists.txt
Outdated
There was a problem hiding this comment.
Could you explain which deprecation warnings are being disabled here? An example would be useful.
There was a problem hiding this comment.
Below is an example for the disabled warnings
/home/ubuntu/PR/oneMKL/src/blas/backends/rocblas/rocblas_task.hpp:57:58: warning: 'hip' is deprecated: use 'ext_oneapi_hip' instead [-Wdeprecated-declarations] hipStream_t stream = sycl::get_native<sycl::backend::hip>(queue); ^ /opt/compiler/llvm/build_3/include/sycl/CL/sycl/backend_types.hpp:34:7: note: 'hip' has been explicitly marked deprecated here hip __SYCL2020_DEPRECATED("use 'ext_oneapi_hip' instead") = ext_oneapi_hip, ^ /opt/compiler/llvm/build_3/include/sycl/CL/sycl/detail/defines_elementary.hpp:54:40: note: expanded from macro '__SYCL2020_DEPRECATED' #define __SYCL2020_DEPRECATED(message) __SYCL_DEPRECATED(message) ^ /opt/compiler/llvm/build_3/include/sycl/CL/sycl/detail/defines_elementary.hpp:45:38: note: expanded from macro '__SYCL_DEPRECATED' #define __SYCL_DEPRECATED(message) [[deprecated(message)]]
There was a problem hiding this comment.
Why can't we use the recommended APIs instead of disabling the warnings?
There was a problem hiding this comment.
I agree with your suggestion. Mesut. The deprecated warning shown above could be fixed. The only concern is whether it breaks with hipSYCL config or not.
I'll explore the other kinds of deprecated warnings being thrown as well and fix them wherever possible after validating on hipSYCL as well.
|
@TejaX-Alaghari @mmeterel I get a link error in the final step. Not sure if something needs to be fixed in this file. For now, I got it to work by manually adding [EDIT] This issue probably belongs in the intel-llvm repo. There is a related issue that was just opened. |
@ajaypanyala @TejaX-Alaghari Thanks for the detailed explanation. I have seen the same issue earlier. I am leaning towards waiting for LLVM issue to be fixed, so we don't have to recommend users to use temporary hack. What do you think? |
CMakeLists.txt
Outdated
There was a problem hiding this comment.
Can you please fix the alignment?
@mmeterel Sounds good. That would be perfect! Thanks! |
@mmeterel : According to the compiler team, SYCL compiler doesn't use clang-builtins library. It uses libgcc_s.so instead. In this case, the dependency for libclang_rt is from ROCM blas library. The clang version of libclang_rt should match the ROCM library built version. It suggests that adding -L$ROCM_PATH/llvm/lib/clang/13.0.0/lib/linux is the right permanent solution. |
f5c61f3 to
510ff46
Compare
|
@TejaX-Alaghari
|
|
@TejaX-Alaghari I am getting the warning/errors/crashes as shown in the attached files. I have tested only Level1 APIs for simplicity. Could you please advise how to resolve them? Feel free to schedule a meeting to discuss in detail. |
…with HIP backend support
Added the relative path for imported location on FindrocBLAS.cmake
510ff46 to
e99dd17
Compare
Thanks for the detailed feedback on the PR. Please find below, the response for above comments:
|
|
Tested the PR again after latest commits. Still seeing major failures. Please reach out for a debug session. |
After discussing with @TejaX-Alaghari offline, this issue is most likely due to missing synchronization. Similar issue was fixed in #228 for cuBLAS backend. @TejaX-Alaghari will work on updating this PR. Please note that, similar updates will likely needs to be done for rocRAND (#218 ) and rocSOLVER (#208 ) PRs. |
|
Attached are the results for my local tests using LLVM compiler: I see three problems with these results:
I also ran this PR using hipSYCL. Attached are the results: Based on the above discussion, I don't have concerns with merging this PR. The mentioned issues can be tracked separately. Thanks for all your efforts on enabling rocBLAS backend with LLVM-HIP compiler. |
|
@vmalia @mkrainiuk I just added my test results along with related issues. The PR is ok to merge IMHO. Could you please take a look from your side? |
mkrainiuk
left a comment
There was a problem hiding this comment.
Thank you for the PR! It looks good to me with one minor question.
| template <typename H, typename F> | ||
| static inline void host_task_internal(H &cgh, sycl::queue queue, F f) { | ||
| cgh.interop_task([f, queue](sycl::interop_handler ih) { | ||
| cgh.host_task([f, queue](sycl::interop_handle ih) { |
There was a problem hiding this comment.
Could it be affected by changes in DPC++ compiler for dropping host support?
There was a problem hiding this comment.
@mkrainiuk In my tests with latest LLVM, I did not see any deprecation warnings related to host_task(). I guess, if/when the compiler drops support, we can switch to recommended API.
Description
This PR is intended to extend the HIP backend of BLAS domain, which is currently supported for hipSYCL compiler to Intel’s DPC++/SYCL compiler.
Checklist
All Submissions
New features