Skip to content

Adding rocSOLVER support for LAPACK domain with hip backend #208

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

Merged
merged 11 commits into from
Nov 30, 2022

Conversation

srilekhainkulu99
Copy link
Contributor

@srilekhainkulu99 srilekhainkulu99 commented Jun 16, 2022

Adding rocSOLVER support for LAPACK

Description

Raising PR with initial code base to provide rocSOLVER support for LAPACK domain with the HIP backend

Checklist

All Submissions

  • Do all unit tests pass locally? test_all_log.txt
  • Have you formatted the code using clang-format?

@srilekhainkulu99 srilekhainkulu99 changed the title Adding rocSOLVER support for LAPACK domain through Intel DPCPP compil… Adding rocSOLVER support for LAPACK domain with hip backend Jun 16, 2022
});
}

// TBD: rocSolver doesn't need/support scratchpad_size
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not sure what to return as scratchpad size because rocsolver doesn't use scratchpad., Please suggest what should be return here.? or how it should be handled.?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't expect much trouble with returning 0. Users should be able to allocate as normal since SYCL 2020 spec now allows zero ranged buffers and usm allocations should just return a nullptr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion @ericlars.

Copy link
Contributor Author

@srilekhainkulu99 srilekhainkulu99 Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't expect much trouble with returning 0. Users should be able to allocate as normal since SYCL 2020 spec now allows zero ranged buffers and usm allocations should just return a nullptr.

@ericlars , When zero is returned from "get_scratchpad_size" APIs, the following error has been reported during buffer creation in the test cases for HIP backend.
"SYCL buffer size is zero. To create a device accessor, SYCL buffer size must be greater than zero."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've found that this issue was coming from creating accessor to an empty scratchpad buffer. We've addressed this in the latest commit

@srilekhainkulu99
Copy link
Contributor Author

srilekhainkulu99 commented Nov 1, 2022

@ericlars and @sknepper, I've updated the PR with the test case results. Can you please review and share your suggestions.

Copy link
Contributor

@sknepper sknepper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I'm looking forward to having rocSOLVER support added for LAPACK. =)

I have not tried running your changes, just did a visual code review with multiple comments throughout. Thanks!

@@ -167,12 +171,12 @@ Supported domains: BLAS, LAPACK, RNG
</tr>
<tr >
<td align="center">AMD GPU</td>
<td align="center">AMD rocBLAS </td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table formatting looks off when viewing the README in your branch: https://github.com/srilekhainkulu99/oneMKL/tree/rocsolver_hip_support

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I'm looking forward to having rocSOLVER support added for LAPACK. =)

I have not tried running your changes, just did a visual code review with multiple comments throughout. Thanks!

Thank you for such a detailed feedback. I've addressed majority of the comments.
Do let us know if you have any further suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table formatting still appears off, please address this. https://github.com/srilekhainkulu99/oneMKL/tree/rocsolver_hip_support

static_cast<unsigned int>(queue.get_device().get_info<sycl::info::device::vendor_id>());
if (!(queue.get_device().is_gpu() && vendor_id == AMD_ID)) {
throw unsupported_device(
"", "backend_selector<backend::" + backend_map[backend::rocsolver] + ">",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but the spacing doesn't seem to match the spacing above it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like line 135 with the queue get device is still misaligned compared to line 122 above.

Copy link
Contributor

@TejaX-Alaghari TejaX-Alaghari Nov 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran clang-format to fix the indentation of this section which differs from the format of the code with line #122

#ifndef _DETAIL_ROCSOLVER_LAPACK_CT_HPP_
#define _DETAIL_ROCSOLVER_LAPACK_CT_HPP_

#include <CL/sycl.hpp>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be guarded similarly as in include/oneapi/mkl/blas/detail/rocblas/blas_ct.hpp ?

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#else
#include <CL/sycl.hpp>
#endif


#ifndef _ONEMKL_LAPACK_ROCSOLVER_HPP_
#define _ONEMKL_LAPACK_ROCSOLVER_HPP_
#include <CL/sycl.hpp>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be guarded similarly as in include/oneapi/mkl/blas/detail/rocblas/onemkl_blas_rocblas.hpp ?

#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
#else
#include <CL/sycl.hpp>
#endif

Teja Alaghari added 2 commits November 4, 2022 18:35
* Adjusted years for copyrights of new files
* Adjusted misalignments and formatting issues
* Added default case for get_rocsolver_jobsvd
* Removed the conditional check of (m < n) for gebrd
* Removed cuda header from rocsolver_scope_handle.hpp
* Added misssing __has_include checks for CL/SYCL.hpp inclusions
* Removed circular dependency in include/oneapi/mkl/lapack/detail/rocsolver/lapack_ct.hpp
* Removed the duplicated macro of ROCSOLVER_ERROR_FUNC_T
* Added default case for get_rocsolver_jobsvd
* Removed the conditional check of (m < n) for gebrd
* Removed cuda header from rocsolver_scope_handle.hpp
* Added misssing __has_include checks for CL/SYCL.hpp inclusions
@ericlars ericlars merged commit f4866ab into uxlfoundation:develop Nov 30, 2022
ericlars added a commit that referenced this pull request Nov 30, 2022
@ericlars
Copy link
Contributor

Mistakenly merged before other approvers could take a look, if any issues please comment and we can revert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants