-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add w/a for oneMath to fix test oneMKL interfaces action #2360
Conversation
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
Array API standard conformance tests for dpnp=0.18.0dev0=py312he4f9c94_32 ran successfully. |
sycl_free_noexcept(scratchpad, exec_q); | ||
if (ipiv != nullptr) | ||
sycl_free_noexcept(ipiv, exec_q); | ||
throw LinAlgError("The input coefficient matrix is singular."); |
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'm curious why is it handled in another way comparing to oneapi::mkl::lapack::computation_error
above?
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.
Above we handle all exceptions in oneapi::mkl::lapack::exception
class by defining a specific exception using the value of info()
method.
In this case if the input matrix is singular, the exception oneapi::mkl::computation_error
is thrown.
Also info
method is not available in oneapi::mkl::exception:
class
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 see, the main reason is that we can't use gesv_utils::handle_lapack_exc
here, because oneapi::mkl::computation_error
doesn't expose info()
method.
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 @vlad-perevezentsev for investigating the issue with oneMath tests scope and implementing the workaround.
This PR suggests adding a temporary workaround to a problem in oneMath [#642 ](uxlfoundation/oneMath#642) where exceptions are no longer thrown in `lapack` namespace for `getrf` function as expected. In oneMath develop branch `oneapi::mkl::lapack::computation_error` is not thrown. Instead, `oneapi::mkl::computation_error` from `mkl` namespace is used so existing catch block `mkl_lapack::exception` does not handle singular matrix errors. A workaround has been added to explicitly catch `oneapi::mkl::computation_error` and update `dev_info` ensuring that singular matrices are handled correctly. 1b0ce60
This PR suggests adding a temporary workaround to a problem in oneMath #642 where exceptions are no longer thrown in
lapack
namespace forgetrf
function as expected.In oneMath develop branch
oneapi::mkl::lapack::computation_error
is not thrown.Instead,
oneapi::mkl::computation_error
frommkl
namespace is used so existing catch blockmkl_lapack::exception
does not handle singular matrix errors.A workaround has been added to explicitly catch
oneapi::mkl::computation_error
and updatedev_info
ensuring that singular matrices are handled correctly.