Skip to content

Commit

Permalink
Serializer for mdspans (rapidsai#1173)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hcho3 authored and ahendriksen committed Feb 2, 2023
1 parent af93c05 commit 5219a9e
Show file tree
Hide file tree
Showing 24 changed files with 1,276 additions and 258 deletions.
4 changes: 2 additions & 2 deletions conda/recipes/libraft/build_libraft_distance.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

./build.sh libraft -v --allgpuarch --compile-dist --no-nvtx
PARALLEL_LEVEL=8 ./build.sh libraft -v --allgpuarch --compile-dist --no-nvtx
4 changes: 2 additions & 2 deletions conda/recipes/libraft/build_libraft_nn.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

./build.sh libraft -v --allgpuarch --compile-nn --no-nvtx
PARALLEL_LEVEL=8 ./build.sh libraft -v --allgpuarch --compile-nn --no-nvtx
4 changes: 2 additions & 2 deletions conda/recipes/libraft/build_libraft_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

./build.sh tests bench -v --allgpuarch --no-nvtx
PARALLEL_LEVEL=8 ./build.sh tests bench -v --allgpuarch --no-nvtx
cmake --install cpp/build --component testing
9 changes: 9 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ target_link_libraries(

target_compile_features(raft INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)

# Endian detection
include(TestBigEndian)
test_big_endian(BIG_ENDIAN)
if(BIG_ENDIAN)
target_compile_definitions(raft INTERFACE RAFT_SYSTEM_LITTLE_ENDIAN=0)
else()
target_compile_definitions(raft INTERFACE RAFT_SYSTEM_LITTLE_ENDIAN=1)
endif()

if(RAFT_COMPILE_DIST_LIBRARY OR RAFT_COMPILE_NN_LIBRARY)
file(
WRITE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld"
Expand Down
Loading

0 comments on commit 5219a9e

Please sign in to comment.