Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
cmake

RemoteHandle::read()

remove StreamFuture(StreamFuture&&)

python bindings and tests

read to device memory

dependencies: aws-sdk-cpp

parse_s3_path

cmake: adding AWSSDK to python built

RemoteFile.from_url()

benchmark

benchmark: --api numpy

ibenchmark: --api cudf

cleanup

benchmark: adding --api cudf-fsspec

read(): use PushAndPopContext

impl. pread

ensure_aws_s3_api_is_initalized

AwsS3Client

S3Context

clean up

SameThreadExecutor

use shared pointer

cmake: AWSSDK COMPONENTS s3 transfer

create_transfer_manager

clean up

BufferAsStream

test_read: larger data size

KVIKIO_NVTX_FUNC_RANGE

benchmark: use random

RemoteHandle::read_to_host(): print bandwidth

benchmark

clean up

remove the use of the transfer module

ci: some more aws-sdk-cpp

benchmark:  pytest.importorskip("moto")

remote_handle.pyx

remote_file.py

make remote IO optional

don't use typing_extensions

dependencies: boto3 and moto

more aws-sdk-cpp

trigger CI error if remote module wasn't built
  • Loading branch information
madsbk committed Aug 13, 2024
1 parent ef2a704 commit 32130c2
Show file tree
Hide file tree
Showing 19 changed files with 872 additions and 13 deletions.
3 changes: 3 additions & 0 deletions conda/environments/all_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ channels:
- conda-forge
- nvidia
dependencies:
- aws-sdk-cpp
- boto3>=1.21.21
- c-compiler
- cmake>=3.26.4,!=3.30.0
- cuda-python>=11.7.1,<12.0a0
Expand All @@ -17,6 +19,7 @@ dependencies:
- dask>=2022.05.2
- doxygen=1.9.1
- gcc_linux-aarch64=11.*
- moto>=4.0.8
- ninja
- numcodecs <0.12.0
- numpy>=1.23,<2.0a0
Expand Down
3 changes: 3 additions & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ channels:
- conda-forge
- nvidia
dependencies:
- aws-sdk-cpp
- boto3>=1.21.21
- c-compiler
- cmake>=3.26.4,!=3.30.0
- cuda-python>=11.7.1,<12.0a0
Expand All @@ -19,6 +21,7 @@ dependencies:
- gcc_linux-64=11.*
- libcufile-dev=1.4.0.31
- libcufile=1.4.0.31
- moto>=4.0.8
- ninja
- numcodecs <0.12.0
- numpy>=1.23,<2.0a0
Expand Down
3 changes: 3 additions & 0 deletions conda/environments/all_cuda-125_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ channels:
- conda-forge
- nvidia
dependencies:
- aws-sdk-cpp
- boto3>=1.21.21
- c-compiler
- cmake>=3.26.4,!=3.30.0
- cuda-nvcc
Expand All @@ -18,6 +20,7 @@ dependencies:
- doxygen=1.9.1
- gcc_linux-aarch64=11.*
- libcufile-dev
- moto>=4.0.8
- ninja
- numcodecs <0.12.0
- numpy>=1.23,<2.0a0
Expand Down
3 changes: 3 additions & 0 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ channels:
- conda-forge
- nvidia
dependencies:
- aws-sdk-cpp
- boto3>=1.21.21
- c-compiler
- cmake>=3.26.4,!=3.30.0
- cuda-nvcc
Expand All @@ -18,6 +20,7 @@ dependencies:
- doxygen=1.9.1
- gcc_linux-64=11.*
- libcufile-dev
- moto>=4.0.8
- ninja
- numcodecs <0.12.0
- numpy>=1.23,<2.0a0
Expand Down
3 changes: 3 additions & 0 deletions conda/recipes/kvikio/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ requirements:
- {{ compiler('cuda') }}
{% endif %}
- {{ stdlib("c") }}
- aws-sdk-cpp
host:
- python
- pip
Expand All @@ -64,11 +65,13 @@ requirements:
- rapids-build-backend >=0.3.0,<0.4.0.dev0
- scikit-build-core >=0.10.0
- libkvikio ={{ version }}
- aws-sdk-cpp
run:
- python
- numpy >=1.23,<2.0a0
- cupy >=12.0.0
- zarr
- aws-sdk-cpp
# See https://github.com/zarr-developers/numcodecs/pull/475
- numcodecs <0.12.0
- packaging
Expand Down
8 changes: 8 additions & 0 deletions conda/recipes/libkvikio/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ requirements:
{% endif %}
- ninja
- {{ stdlib("c") }}
- aws-sdk-cpp
host:
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
Expand All @@ -52,6 +53,7 @@ requirements:
{% else %}
- libcufile-dev # [linux]
{% endif %}
- aws-sdk-cpp

outputs:
- name: libkvikio
Expand All @@ -72,8 +74,10 @@ outputs:
requirements:
build:
- cmake {{ cmake_version }}
- aws-sdk-cpp
host:
- cuda-version ={{ cuda_version }}
- aws-sdk-cpp
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
Expand All @@ -83,6 +87,7 @@ outputs:
{% else %}
- libcufile-dev # [linux]
{% endif %}
- aws-sdk-cpp
test:
commands:
- test -f $PREFIX/include/kvikio/file_handle.hpp
Expand All @@ -106,6 +111,7 @@ outputs:
- cuda-cudart-dev
- libcufile-dev # [linux]
{% endif %}
- aws-sdk-cpp
requirements:
build:
- cmake {{ cmake_version }}
Expand All @@ -118,6 +124,7 @@ outputs:
- cuda-cudart-dev
- libcufile-dev # [linux]
{% endif %}
- aws-sdk-cpp
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
Expand All @@ -127,6 +134,7 @@ outputs:
- cuda-cudart
- libcufile # [linux]
{% endif %}
- aws-sdk-cpp
about:
home: https://rapids.ai
license: Apache-2.0
Expand Down
7 changes: 7 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ rapids_find_package(
INSTALL_EXPORT_SET kvikio-exports
)

rapids_find_package(
AWSSDK COMPONENTS s3
BUILD_EXPORT_SET kvikio-exports
INSTALL_EXPORT_SET kvikio-exports
)

rapids_find_package(
cuFile
BUILD_EXPORT_SET kvikio-exports
Expand Down Expand Up @@ -130,6 +136,7 @@ target_include_directories(
)
target_link_libraries(
kvikio INTERFACE Threads::Threads ${CMAKE_DL_LIBS} nvtx3::nvtx3-cpp BS::thread_pool
${AWSSDK_LINK_LIBRARIES}
)
target_compile_features(kvikio INTERFACE cxx_std_17)

Expand Down
4 changes: 4 additions & 0 deletions cpp/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

set(TEST_INSTALL_PATH bin/tests/libkvikio)

# Example: basic_io

if(CUDAToolkit_FOUND)
add_executable(BASIC_IO_TEST basic_io.cpp)
set_target_properties(BASIC_IO_TEST PROPERTIES INSTALL_RPATH "\$ORIGIN/../../lib")
Expand All @@ -35,6 +37,8 @@ else()
message(STATUS "Cannot build the basic_io example when CUDA is not found")
endif()

# Example: basic_no_cuda

add_executable(BASIC_NO_CUDA_TEST basic_no_cuda.cpp)
set_target_properties(BASIC_NO_CUDA_TEST PROPERTIES INSTALL_RPATH "\$ORIGIN/../../lib")
target_include_directories(BASIC_NO_CUDA_TEST PRIVATE ../include)
Expand Down
10 changes: 5 additions & 5 deletions cpp/include/kvikio/file_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class FileHandle {
bool _initialized{false};
bool _compat_mode{false};
mutable std::size_t _nbytes{0}; // The size of the underlying file, zero means unknown.
CUfileHandle_t _handle{};
CUfileHandle_t _handle{nullptr};

public:
static constexpr mode_t m644 = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
Expand Down Expand Up @@ -208,7 +208,7 @@ class FileHandle {
_initialized{std::exchange(o._initialized, false)},
_compat_mode{std::exchange(o._compat_mode, false)},
_nbytes{std::exchange(o._nbytes, 0)},
_handle{std::exchange(o._handle, CUfileHandle_t{})}
_handle{std::exchange(o._handle, CUfileHandle_t{nullptr})}
{
}
FileHandle& operator=(FileHandle&& o) noexcept
Expand All @@ -218,7 +218,7 @@ class FileHandle {
_initialized = std::exchange(o._initialized, false);
_compat_mode = std::exchange(o._compat_mode, false);
_nbytes = std::exchange(o._nbytes, 0);
_handle = std::exchange(o._handle, CUfileHandle_t{});
_handle = std::exchange(o._handle, CUfileHandle_t{nullptr});
return *this;
}
~FileHandle() noexcept { close(); }
Expand All @@ -232,8 +232,8 @@ class FileHandle {
{
if (closed()) { return; }

if (!_compat_mode) { cuFileAPI::instance().HandleDeregister(_handle); }
::close(_fd_direct_off);
if (_handle != nullptr) { cuFileAPI::instance().HandleDeregister(_handle); }
if (_fd_direct_off != -1) { ::close(_fd_direct_off); }
if (_fd_direct_on != -1) { ::close(_fd_direct_on); }
_fd_direct_on = -1;
_fd_direct_off = -1;
Expand Down
Loading

0 comments on commit 32130c2

Please sign in to comment.