-
Notifications
You must be signed in to change notification settings - Fork 179
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] Refactor onedal/datatypes
in preparation for dlpack support
#2195
Conversation
Introducing dlpack first requires refactoring the datatypes directory in order to reduce tech debt and simplify reviewing. This PR will drop dlpack support to a second PR and will focus on refactoring directory. |
18a9d4d
to
058372f
Compare
onedal/datatypes
in preparation for dlpack support
/intelci: run |
Codecov ReportAttention: Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
|
onedal/datatypes
in preparation for dlpack supportonedal/datatypes
in preparation for dlpack support
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.
Looks like pure refactoring. Let's wait for a green CI and LGTM.
/intelci: run |
Description
PR #1568 is too large and too out of date to use for refactoring the onedal
table
object. Subsequent PRs which introduced sycl_usm_array support mixed in additional C++ code in an unsustainable/ poorly extensible manner. This PR tries to find an intermediate solution which does not rewriteonedal/datatypes
but only shifts the code in a way which is clearer and better separated following #1568 in spirit. This way adding dlpack support totable
will be separated cleanly fromnumpy
andsycl_usm_array
. It defines additional namespaces so that it is clear in the code which conversion mechanism is being used where. It begins standardization of the naming schemes of functions and files for simple extensibility in the future (say supporting other array or possibly dataframe types).Therefore, because it is only namespace definitions and file movements, performance benchmarks aren't necessary.
NOTE: The
SET_CTYPE_FROM_DAL_TYPE
macro is moved out of the sycl_usm folder because of its generality and re-use within dlpack.NOTE: A function
convert_from_sua_iface
is renamedconvert_to_table
in thesycl_usm
namespace.NOTE: changes to pickling for incremental algorithms must also be done. It is clear with the changes what types of inputs/outputs are expected for
__getstate__
and__setstate__
, which will default to numpy (not explicitly discussed in those PRs, but may be important in future array_api discussions).NOTE: there are definitely inconsistencies between the sycl_usm and numpy implementations, and changes to those implementations in any functional manner should be done in a follow-up PR/ticket. They are likely to be time-intensive and require benchmarking.
PR should start as a draft, then move to ready for review state after CI is passed and all applicable checkboxes are closed.
This approach ensures that reviewers don't spend extra time asking for regular requirements.
You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way.
For example, PR with docs update doesn't require checkboxes for performance while PR with any change in actual code should have checkboxes and justify how this code change is expected to affect performance (or justification should be self-evident).
Checklist to comply with before moving PR from draft:
PR completeness and readability
Testing
Performance