-
Notifications
You must be signed in to change notification settings - Fork 175
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
[enhancement] add oneDAL finiteness_checker implementation to onedal #2126
base: main
Are you sure you want to change the base?
Conversation
/azp run CI |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run CI |
Azure Pipelines successfully started running 1 pipeline(s). |
/intelci: run |
Private CI fail unrelated to this implementation. |
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.
@icfaust Thank you for the excellent work! I have a few questions and clarifications, and I’ve left some comments
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.
|
||
def _apply_and_pass(func, *args, **kwargs): | ||
if len(args) == 1: | ||
return func(args[0], **kwargs) | ||
return tuple(map(lambda arg: func(arg, **kwargs), args)) | ||
|
||
|
||
if _is_dpc_backend: | ||
def convert_one_to_table(arg): | ||
return _backend.to_table(np.atleast_2d(arg) if np.isscalar(arg) else arg) |
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.
It worth to add a comment. Will this properly work with dpnp ndarrays and dpctl usm_ndarrays?
if xp == dpnp: | ||
return dpnp.array(dpnp.dpctl.tensor.asarray(table), copy=False) |
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 don't know is this dpctl module in dpnp is an official part of API? This may work now, but I am not sure for further versions of DPNP. It worth to add some comments here
if dpnp_available: | ||
if _is_dpc_backend: | ||
|
||
try: |
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 use dpnp_available from _dpep_helpers instead.
if not _backend.finiteness_checker.compute.compute(policy, params, X_t).finite: | ||
type_err = "infinity" if allow_nan else "NaN, infinity" | ||
padded_input_name = input_name + " " if input_name else "" | ||
msg_err = f"Input {padded_input_name}contains {type_err}." |
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 cover with tests this message catch
@@ -48,12 +48,8 @@ def __init__(self): | |||
|
|||
|
|||
if _is_dpc_backend: | |||
from onedal._device_offload import DummySyclQueue |
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 is the only place where DummySyclQueue
is used. I am ok with this refactoring, but it worth also remove it definition as well. I didn't find the description for these changes, make sense to move into separate branch or add into commit messages on the merge this work as well, to be clear other dev/users why and when this were removed.
@icfaust I believe it would be beneficial to include links to other dependent PRs in the description. |
* carryover from #2126 * formatting * Update test_memory_usage.py * Update _data_conversion.py * Update _data_conversion.py * Update _data_conversion.py * Update test_data.py * Update onedal/datatypes/_data_conversion.py Co-authored-by: Victoriya Fedotova <viktoria.nn@gmail.com> * Update _data_conversion.py * Update _data_conversion.py * Update onedal/datatypes/_data_conversion.py Co-authored-by: Samir Nasibli <samir.nasibli@intel.com> * Update _data_conversion.py * Update _data_conversion.py --------- Co-authored-by: Victoriya Fedotova <viktoria.nn@gmail.com> Co-authored-by: Samir Nasibli <samir.nasibli@intel.com>
Description
A GPU side finiteness checker was added to oneDAL in 2024.7 (oneapi-src/oneDAL#2781), this becomes useful with the merge of #2045. This will expose the first step, which is to include it in the onedal folder. This may replace daal4py's assert_all_finite, but will occur in a later PR. This adds limited testing on onedal side.
Checklist to comply with before moving PR from draft:
PR completeness and readability
Testing
Performance