Skip to content
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

[FEA] Tracker for mdspan serialization and copy #1017

Closed
1 of 8 tasks
hcho3 opened this issue Nov 15, 2022 · 0 comments · Fixed by #1173
Closed
1 of 8 tasks

[FEA] Tracker for mdspan serialization and copy #1017

hcho3 opened this issue Nov 15, 2022 · 0 comments · Fixed by #1173
Assignees
Labels
feature request New feature or request

Comments

@hcho3
Copy link
Contributor

hcho3 commented Nov 15, 2022

Following up with #752.

Design choices

  • Provide efficient serializers for mdspan's with C and Fortran layouts. Mdspan's can have an arbitrary layouts which makes it hard to serialize efficiently.
  • Provide a copy operator so that users can transform their mdspans into C or Fortran layouts.
    • In general, provide a generic fallback implementation (possibly suboptimal), and provide specialized versions of copy that are optimized for certain use cases.
  • Adopt the NumPy format for easy inter-op with NumPy and other array libraries.
  • Also expose __array_interface__ for zero-copy serialization

TODO's

  • Implement a copy operation between two mdspan's
    • Implement fallback copy operation to copy elements between two mdspan's on the host memory
    • Implement fallback copy operation to copy elements between two mdspan's on the device memory
    • Implement wrappers for copying Fortran-, C-layout, or strided arrays between the host and device memory
  • Implement serializer for mdspan's with Fortran and C layouts
    • Serialize to std::ostream
    • Serialize to container iterator
    • Serialize via __array_interface__
@hcho3 hcho3 added the feature request New feature or request label Nov 15, 2022
@rapids-bot rapids-bot bot closed this as completed in #1173 Feb 2, 2023
rapids-bot bot pushed a commit that referenced this issue Feb 2, 2023
Closes #1017

Implement a serializer for mdspan using the NumPy format. Row- and column-major layouts are supported.

TODOs
- [x] Revise IVF to use the new mdspan serializer
- [x] Add gtest to cover serializing device mdspans
- [x] Implement serializer for scalars
- [x] Rename header to `raft/core/serialize.hpp`
- [x] Use `device_resources` instead of `handle_t`
- [x] Use 64-byte alignment
- [x] Serialize scalars as 0D NumPy array
- [x] Add version field to ANN serialization
- [x] Test mdspan serializer in the Python layer

Authors:
  - Philip Hyunsu Cho (https://github.com/hcho3)
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Tamas Bela Feher (https://github.com/tfeher)
  - Artem M. Chirkin (https://github.com/achirkin)
  - Corey J. Nolet (https://github.com/cjnolet)
  - Divye Gala (https://github.com/divyegala)
  - Ray Douglass (https://github.com/raydouglass)

URL: #1173
@github-project-automation github-project-automation bot moved this from In Progress to Done in VS/ML/DM Primitives Release Board Feb 2, 2023
ahendriksen pushed a commit to ahendriksen/raft that referenced this issue Feb 2, 2023
Closes rapidsai#1017

Implement a serializer for mdspan using the NumPy format. Row- and column-major layouts are supported.

TODOs
- [x] Revise IVF to use the new mdspan serializer
- [x] Add gtest to cover serializing device mdspans
- [x] Implement serializer for scalars
- [x] Rename header to `raft/core/serialize.hpp`
- [x] Use `device_resources` instead of `handle_t`
- [x] Use 64-byte alignment
- [x] Serialize scalars as 0D NumPy array
- [x] Add version field to ANN serialization
- [x] Test mdspan serializer in the Python layer

Authors:
  - Philip Hyunsu Cho (https://github.com/hcho3)
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Tamas Bela Feher (https://github.com/tfeher)
  - Artem M. Chirkin (https://github.com/achirkin)
  - Corey J. Nolet (https://github.com/cjnolet)
  - Divye Gala (https://github.com/divyegala)
  - Ray Douglass (https://github.com/raydouglass)

URL: rapidsai#1173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant