forked from mooncake-track/Mooncake
PutToLocalFile and FileStorage::OffloadObjects crash with SIGSEGV when slice.ptr points to GPU device memory, because CPU memcpy cannot access GPU virtual addresses. The RDMA memory-replica path is unaffected. Add synchronous Device-to-Host staging via PinnedBufferPool before data reaches the disk-write paths: - New gpu_staging_utils.h: shared IsDevicePointer/CopyDeviceToHost/ SetDevice helpers with cross-platform support (CUDA/HIP/MUSA/MACA/ Ascend CANN) - New PinnedBufferPool: thread-safe pinned host memory pool with max capacity limit (default 32) and O(1) swap-pop acquire - PutToLocalFile: sync D2H on calling thread, PutRevoke on failure - OffloadObjects: D2H staging before BatchOffload; on per-slice failure the entire object is skipped to prevent partial/corrupt data - CMakeLists: auto-detect CUDAToolkit/HIP/Ascend independently of global USE_CUDA flag, with explicit PRIVATE compile definitions - CI: add -lcudart to Go test CGO_LDFLAGS when CUDA is present Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| benchmarks | ||
| conf | ||
| go | ||
| include | ||
| rust | ||
| src | ||
| tests | ||
| CMakeLists.txt | ||