Skip to content

Add TdsKVBackend storage driver with zero-copy O_DIRECT and 4KB bounce-buffering. - #948

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_983561034
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_983561034

Conversation

@copybara-service

Copy link
Copy Markdown

Add TdsKVBackend storage driver with zero-copy O_DIRECT and 4KB bounce-buffering.

Standard buffered POSIX file I/O copies KV cache blocks through the Linux kernel page cache, incurring CPU memcpy overhead and host RAM page-cache bloat on high-throughput storage tiers such as Lustre, NFS, and NVMe SSDs.

Implement tpu_raiden::kv_cache::backends::storage::TdsKVBackend (tkv::backends::storage::TdsKVBackend) inheriting from KVBackend. For 4KB-aligned, registered Host DRAM slices (HostBufferDescriptor), execute zero-copy O_DIRECT transfers directly between storage and host memory (direct_ops). For unaligned buffer addresses, slice lengths, or file offsets, automatically route through a 4KB-aligned bounce-buffer engine (bounced_ops) while preserving exact logical file sizes via ftruncate. Support lustre:// and nfs:// URI resolution, configurable options (TdsBackendOptions::FromProperties), and optional Lustre OST striping (LL_IOC_LOV_SETSTRIPE).

@google-cla

google-cla Bot commented Sep 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…e-buffering.

Standard buffered POSIX file I/O copies KV cache blocks through the Linux kernel page cache, incurring CPU `memcpy` overhead and host RAM page-cache bloat on high-throughput storage tiers such as Lustre, NFS, and NVMe SSDs.

Implement `tpu_raiden::kv_cache::backends::storage::TdsKVBackend` (`tkv::backends::storage::TdsKVBackend`) inheriting from `KVBackend`. For 4KB-aligned, registered Host DRAM slices (`HostBufferDescriptor`), execute zero-copy `O_DIRECT` transfers directly between storage and host memory (`direct_ops`). For unaligned buffer addresses, slice lengths, or file offsets, automatically route through a 4KB-aligned bounce-buffer engine (`bounced_ops`) while preserving exact logical file sizes via `ftruncate`. Support `lustre://` and `nfs://` URI resolution, configurable options (`TdsBackendOptions::FromProperties`), and optional Lustre OST striping (`LL_IOC_LOV_SETSTRIPE`).

PiperOrigin-RevId: 983561034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants