Add optional S3-over-RDMA (NVIDIA cuObject) data plane to remote I/O#993
Draft
harshavardhana wants to merge 1 commit into
Draft
Add optional S3-over-RDMA (NVIDIA cuObject) data plane to remote I/O#993harshavardhana wants to merge 1 commit into
harshavardhana wants to merge 1 commit into
Conversation
Add an opt-in RDMA data plane for the S3 remote endpoint, backed by NVIDIA cuObject (libcuobjclient). When enabled, RemoteHandle::read() registers the destination buffer (host or device memory) with cuObject, mints an RDMA descriptor, and issues a body-less range GET carrying the SigV4-signed x-amz-rdma-token header; the RDMA-capable endpoint transfers the payload directly into the buffer, bypassing the HTTP body and the CPU copy. The HTTP control plane (range, auth) continues to flow through the existing libcurl path, so the change is additive. cuObject's client is a C++ class, so it is not loaded directly through the dlopen shim mechanism the way libcufile is. Instead a small C-ABI shim (cpp/cuobj_shim/cuobj_shim.cpp) wraps it and is built into the optional libkvikio_cuobj_shim.so only when cuobjclient.h is found; the cuObjAPI singleton dlopens that shim at runtime (mirroring cuFileAPI), so cuObject remains an optional runtime dependency and KvikIO links neither it nor the shim. Activation is gated by the KVIKIO_REMOTE_RDMA environment variable plus a successful cuObject connection (S3Endpoint::supports_rdma()), so existing behavior is unchanged when unset. A 501 reply (x-amz-rdma-reply) fails loudly rather than silently falling back, since RDMA must be explicit. This is host-staged-capable today and validated against an RDMA-capable endpoint; device-memory (GPUDirect) registration uses the same code path and is compile-validated, with hardware end-to-end validation pending. Test Plan: - Build on a host with the cuObject SDK; confirm libkvikio_cuobj_shim.so builds and KvikIO loads without it when absent. - Host-memory round trip against an RDMA MinIO AIStor endpoint with KVIKIO_REMOTE_RDMA=on: RemoteHandle::read()/pread() returns byte-identical data and x-amz-rdma-reply is 200. - With KVIKIO_REMOTE_RDMA unset, the standard libcurl data plane is used (existing tests unaffected).
Contributor
|
Thanks for the PR. I'll take a closer look. If possible, could you share any performance numbers for a RDMA-S3 vs regular S3 comparison? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an opt-in S3-over-RDMA data plane to KvikIO's remote I/O, backed by NVIDIA cuObject (
libcuobjclient). For RDMA-capable S3 endpoints (e.g. MinIO AIStor),RemoteHandle::read()/pread()register the destination buffer (host or device memory) with cuObject, mint an RDMA descriptor, and issue a body-less range GET carrying the SigV4-signedx-amz-rdma-tokenheader; the endpoint RDMA-writes the payload directly into the buffer, bypassing the HTTP body and the CPU copy. The HTTP control plane (range, auth) still flows through the existing libcurl path, so the change is additive.How it fits KvikIO
libcufileis. A small C-ABI shim (cpp/cuobj_shim/cuobj_shim.cpp) wraps it and is built into the optionallibkvikio_cuobj_shim.soonly whencuobjclient.his found. The newcuObjAPIsingletondlopens that shim at runtime (mirroringcuFileAPI), so cuObject stays an optional runtime dependency and KvikIO links neither it nor the shim. Override the path withKVIKIO_CUOBJ_SHIM.KVIKIO_REMOTE_RDMA=onand a successful cuObject connection (S3Endpoint::supports_rdma()). A501reply (x-amz-rdma-reply) fails loudly rather than silently falling back, since RDMA must be explicit. No Python API change.read()(a discard write-callback; the payload arrives out of band), so it does not interfere with the libcurl streaming callbacks or the device bounce buffer.Files
cpp/cuobj_shim/cuobj_shim.cpp— C-ABI shim overcuObjClient(built optionally).cpp/include/kvikio/shim/cuobj.hpp,cpp/src/shim/cuobj.cpp—cuObjAPIdlopen singleton +is_cuobj_available().cpp/src/remote_handle.cpp,cpp/include/kvikio/remote_handle.hpp—RemoteEndpoint::supports_rdma()/setopt_rdma(),S3Endpointoverrides, single-shotread_rdma()+ RDMA reply check.cpp/CMakeLists.txt— cuObject detection + optional shim library.docs/source/remote_file.rst— usage.Validated
Built and proven end-to-end on hardware: NVIDIA H200 client → RDMA-capable MinIO AIStor endpoint over 400G RoCE (toolkit cuObject 1.2.0 / cuFile 1.18.0).
libkvikio_cuobj_shim.sobuilds when cuObject is present;RemoteHandle::read()withKVIKIO_REMOTE_RDMA=onreturns byte-identical data (64 MiB) for both:supports_rdma()correctly gates onKVIKIO_REMOTE_RDMA+ a live cuObject connection, and a missing/501x-amz-rdma-replyfails loudly. With cuObject absent, the shim is not built andis_cuobj_available()returns false; withKVIKIO_REMOTE_RDMAunset, the standard libcurl data plane is used unchanged.(Minor: for non-AWS endpoints, construct
S3Endpoint(bucket, object)+AWS_ENDPOINT_URLrather thanRemoteHandle::open(http_url, S3), sinceS3Endpoint::is_url_validonly matchesamazonaws.comhosts for the explicit S3 type.)