Skip to content

feat: add NVMeOF storage backend and L2 adapter#1

Draft
krish-reddy wants to merge 1 commit into
devfrom
claude/implement-nvmeof-backend-fk5TO
Draft

feat: add NVMeOF storage backend and L2 adapter#1
krish-reddy wants to merge 1 commit into
devfrom
claude/implement-nvmeof-backend-fk5TO

Conversation

@krish-reddy
Copy link
Copy Markdown
Owner

Summary

  • lmcache/v1/storage_backend/plugins/nvmeof_backend.py: NVMeOFBackend — a StoragePluginInterface that stores KV cache chunks as files on an NVMeOF-attached block device mounted as a filesystem (ext4/XFS). Supports pluggable LRU/LFU/FIFO/MRU eviction, O_DIRECT I/O, capacity limiting, and optional auto-connect/disconnect lifecycle via nvme-cli.
  • lmcache/v1/distributed/l2_adapters/nvmeof_l2_adapter.py: NVMeOFL2Adapter — an L2AdapterInterface for MP mode using aiofiles on a dedicated background event loop, three distinct event fds (store/lookup/load), atomic tmp → rename writes, optional O_DIRECT, and optional NVMeOF connection lifecycle. Self-registers as adapter type "nvmeof" via pkgutil auto-discovery.
  • docs/design/v1/storage_backend/plugins/nvmeof_backend.md: Design doc for the storage plugin.
  • docs/design/v1/distributed/l2_adapters/nvmeof_l2_adapter.md: Design doc for the L2 adapter.
  • tests/v1/storage_backend/test_nvmeof_backend.py: Unit tests covering filename helpers, nvme-cli connect/disconnect helpers, config validation, store/lookup/load/delete flows, listener notifications, and adapter registration.

Test plan

  • pytest tests/v1/storage_backend/test_nvmeof_backend.py passes (temp dir replaces real NVMeOF mount)
  • NVMeOFBackend can be loaded via storage_plugin_launcher() with the documented extra_config keys
  • NVMeOFL2Adapter appears in --l2-adapter help output as type "nvmeof"
  • Manual smoke test: format/mount a real NVMeOF target, set nvmeof.mount_path, verify KV chunks are persisted and retrieved correctly
  • O_DIRECT path verified on a block-aligned tensor size

https://claude.ai/code/session_01FtheXdEv1wT46uYr6fEPvy


Generated by Claude Code

Implements KV cache storage on NVMe-over-Fabrics attached block devices
formatted as a filesystem. Includes:

- lmcache/v1/storage_backend/plugins/nvmeof_backend.py: StoragePluginInterface
  with LRU/LFU/FIFO/MRU eviction, O_DIRECT support, auto-connect/disconnect
  lifecycle via nvme-cli, and priority-queue async I/O.

- lmcache/v1/distributed/l2_adapters/nvmeof_l2_adapter.py: L2AdapterInterface
  for MP mode using aiofiles, three event fds, atomic tmp→rename writes, and
  optional O_DIRECT. Self-registers as adapter type "nvmeof".

- docs/design/v1/storage_backend/plugins/nvmeof_backend.md: design doc.
- docs/design/v1/distributed/l2_adapters/nvmeof_l2_adapter.md: design doc.
- tests/v1/storage_backend/test_nvmeof_backend.py: unit tests covering
  filename helpers, connect/disconnect helpers, config validation, store/
  lookup/load/delete flows, listener notifications, and registration.

https://claude.ai/code/session_01FtheXdEv1wT46uYr6fEPvy
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.

2 participants