feat: add NVMeOF storage backend and L2 adapter#1
Draft
krish-reddy wants to merge 1 commit into
Draft
Conversation
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
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.
Summary
lmcache/v1/storage_backend/plugins/nvmeof_backend.py:NVMeOFBackend— aStoragePluginInterfacethat 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 vianvme-cli.lmcache/v1/distributed/l2_adapters/nvmeof_l2_adapter.py:NVMeOFL2Adapter— anL2AdapterInterfacefor MP mode usingaiofileson a dedicated background event loop, three distinct event fds (store/lookup/load), atomictmp → renamewrites, optional O_DIRECT, and optional NVMeOF connection lifecycle. Self-registers as adapter type"nvmeof"viapkgutilauto-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.pypasses (temp dir replaces real NVMeOF mount)NVMeOFBackendcan be loaded viastorage_plugin_launcher()with the documentedextra_configkeysNVMeOFL2Adapterappears in--l2-adapterhelp output as type"nvmeof"nvmeof.mount_path, verify KV chunks are persisted and retrieved correctlyhttps://claude.ai/code/session_01FtheXdEv1wT46uYr6fEPvy
Generated by Claude Code