lmcache-cli 0.5.8.dev0__py3-none-any.whl → 0.5.8rc2.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (534) hide show
  1. lmcache/_version.py +3 -3
  2. lmcache/cli/commands/base.py +38 -0
  3. lmcache/cli/commands/bench/l2_adapter_bench/command.py +28 -10
  4. lmcache/cli/commands/bench/l2_adapter_bench/data.py +9 -2
  5. lmcache/cli/commands/bench/l2_adapter_bench/result.py +6 -1
  6. lmcache/cli/commands/bench/l2_adapter_bench/runner.py +3 -0
  7. lmcache/cli/commands/bench/server_bench/arguments.py +12 -0
  8. lmcache/cli/commands/bench/server_bench/buffers.py +6 -2
  9. lmcache/cli/commands/bench/server_bench/client.py +21 -16
  10. lmcache/cli/commands/bench/server_bench/command.py +7 -0
  11. lmcache/cli/commands/bench/server_bench/config.py +5 -0
  12. lmcache/cli/commands/bench/server_bench/helpers.py +6 -9
  13. lmcache/cli/commands/query/_coordinator.py +6 -8
  14. lmcache/cli/commands/query/_request.py +90 -29
  15. lmcache/cli/commands/quota/_helpers.py +1 -7
  16. lmcache/cli/commands/quota/delete_command.py +2 -1
  17. lmcache/cli/commands/quota/get_command.py +2 -1
  18. lmcache/cli/commands/quota/set_command.py +2 -1
  19. lmcache/cli/commands/trace/_driver.py +69 -64
  20. lmcache/cli/http.py +18 -3
  21. lmcache/cli/profiling.py +13 -11
  22. lmcache/integration/atom/multi_process_adapter.py +12 -107
  23. lmcache/integration/sglang/unified_lmcache_mp_connector.py +181 -119
  24. lmcache/integration/tensorrt_llm/__init__.py +3 -1
  25. lmcache/integration/tensorrt_llm/tensorrt_mp_adapter.py +5 -11
  26. lmcache/integration/vllm/experimental/dispatcher.py +5 -2
  27. lmcache/integration/vllm/experimental/token_drop_adapter.py +149 -0
  28. lmcache/integration/vllm/experimental/token_drop_scheduler.py +20 -0
  29. lmcache/integration/vllm/kv_cache_group_edits.py +57 -9
  30. lmcache/integration/vllm/kv_cache_groups.py +127 -23
  31. lmcache/integration/vllm/lazy_offload_manager.py +1 -0
  32. lmcache/integration/vllm/lmcache_mp_connector.py +453 -165
  33. lmcache/integration/vllm/lmcache_mp_metadata.py +167 -29
  34. lmcache/integration/vllm/mp_lookup_state.py +25 -23
  35. lmcache/integration/vllm/mp_server_launcher.py +1 -1
  36. lmcache/integration/vllm/utils.py +58 -95
  37. lmcache/integration/vllm/vllm_multi_process_adapter.py +407 -532
  38. lmcache/lmcache_frontend/app.py +101 -10
  39. lmcache/lmcache_frontend/static/index.html +2 -0
  40. lmcache/lmcache_frontend/static/js/app.js +15 -3
  41. lmcache/sdk/cache_kind.py +21 -0
  42. lmcache/sdk/context.py +181 -133
  43. lmcache/sdk/qringbuffer.py +55 -13
  44. lmcache/sdk/request.py +19 -4
  45. lmcache/sdk/wrapper/__init__.py +11 -2
  46. lmcache/sdk/wrapper/ring_mapping.py +234 -0
  47. lmcache/sdk/wrapper/ring_transfer.py +498 -0
  48. lmcache/security/api_key.py +12 -0
  49. lmcache/tools/cache_simulator/README.md +1 -1
  50. lmcache/tools/cache_simulator/lru_cache.py +14 -8
  51. lmcache/tools/cache_simulator/simulator.py +9 -2
  52. lmcache/tools/cache_simulator/trace_analyze.py +3 -3
  53. lmcache/tools/transfer_channel_benchmark/README.md +82 -9
  54. lmcache/tools/transfer_channel_benchmark/benchmark.py +168 -50
  55. lmcache/tools/transfer_channel_benchmark/config.py +33 -17
  56. lmcache/usage_telemetry/README.md +7 -7
  57. lmcache/usage_telemetry/__init__.py +4 -3
  58. lmcache/usage_telemetry/base.py +2 -1
  59. lmcache/usage_telemetry/messages.py +3 -2
  60. lmcache/utils.py +1 -306
  61. lmcache/v1/client/__init__.py +6 -0
  62. lmcache/v1/{multiprocess/transfer_context → client}/async_engine_driven.py +4 -4
  63. lmcache/v1/client/heartbeat.py +172 -0
  64. lmcache/v1/{multiprocess → client}/kv_event_subscriber.py +4 -4
  65. lmcache/v1/{multiprocess → client}/transfer_context/__init__.py +4 -14
  66. lmcache/v1/{multiprocess → client}/transfer_context/base.py +5 -5
  67. lmcache/v1/{multiprocess → client}/transfer_context/inline.py +3 -3
  68. lmcache/v1/{multiprocess → client}/transfer_context/shm.py +3 -3
  69. lmcache/v1/client/transport/__init__.py +5 -0
  70. lmcache/v1/{multiprocess → client}/transport/errors.py +6 -1
  71. lmcache/v1/{multiprocess → client}/transport/factory.py +12 -2
  72. lmcache/v1/client/transport/grpc_impl/__init__.py +43 -0
  73. lmcache/v1/client/transport/grpc_impl/auth.py +70 -0
  74. lmcache/v1/{multiprocess → client}/transport/grpc_impl/client.py +23 -40
  75. lmcache/v1/client/transport/zmq_impl/__init__.py +68 -0
  76. lmcache/v1/{multiprocess → client}/transport/zmq_impl/client.py +3 -3
  77. lmcache/v1/client/transport/zmq_impl/mq_client.py +564 -0
  78. lmcache/v1/client/transport/zmq_impl/polling_loop.py +232 -0
  79. lmcache/v1/{multiprocess/transfer_context → client}/worker_transfer.py +84 -44
  80. lmcache/v1/common/__init__.py +5 -0
  81. lmcache/v1/common/attn_window.py +79 -0
  82. lmcache/v1/common/custom_types.py +372 -0
  83. lmcache/v1/common/group_view.py +325 -0
  84. lmcache/v1/{gpu_connector → common}/kv_format/__init__.py +2 -2
  85. lmcache/v1/{gpu_connector → common}/kv_format/contiguity.py +1 -1
  86. lmcache/v1/{gpu_connector → common}/kv_format/detection.py +4 -4
  87. lmcache/v1/{gpu_connector → common}/kv_format/detectors/__init__.py +1 -1
  88. lmcache/v1/{gpu_connector → common}/kv_format/detectors/atom.py +2 -2
  89. lmcache/v1/{gpu_connector → common}/kv_format/detectors/base.py +1 -1
  90. lmcache/v1/{gpu_connector → common}/kv_format/detectors/registry.py +1 -1
  91. lmcache/v1/{gpu_connector → common}/kv_format/detectors/sglang.py +2 -2
  92. lmcache/v1/{gpu_connector → common}/kv_format/detectors/trtllm.py +2 -2
  93. lmcache/v1/{gpu_connector → common}/kv_format/detectors/vllm.py +2 -2
  94. lmcache/v1/{gpu_connector → common}/kv_format/specs/__init__.py +2 -2
  95. lmcache/v1/{gpu_connector → common}/kv_format/specs/base.py +17 -10
  96. lmcache/v1/{gpu_connector → common}/kv_format/specs/nb_nl_two_bs_nh_hs.py +1 -1
  97. lmcache/v1/{gpu_connector → common}/kv_format/specs/nb_nl_two_nh_bs_hs.py +1 -1
  98. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_bs_hs.py +2 -1
  99. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_bs_nh_cs.py +3 -1
  100. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_bs_nh_hs.py +2 -1
  101. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_bs_nh_two_hs.py +2 -2
  102. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_bsv_bss.py +2 -1
  103. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_nh_bs_cs.py +3 -1
  104. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_nh_bs_two_hs.py +2 -2
  105. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_two_bs_nh_hs.py +5 -1
  106. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_two_nh_bs_hs.py +1 -1
  107. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nb_two_nh_one_bs_hs.py +1 -1
  108. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_nbbs_one_hs.py +1 -1
  109. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_np_x_nb_bs_one_hs.py +2 -1
  110. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_two_nb_bs_nh_hs.py +1 -1
  111. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_two_nb_nh_bs_hs.py +1 -1
  112. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_two_nb_nh_one_bs_hs.py +1 -1
  113. lmcache/v1/{gpu_connector → common}/kv_format/specs/nl_x_two_x_nb_bs_nh_hs.py +4 -1
  114. lmcache/v1/{gpu_connector → common}/kv_format/specs/registry.py +2 -2
  115. lmcache/v1/{gpu_connector → common}/kv_format/specs/two_x_nl_x_nb_bs_nh_hs.py +1 -1
  116. lmcache/v1/{gpu_connector → common}/kv_format/specs/two_x_nl_x_nbbs_nh_hs.py +1 -1
  117. lmcache/v1/{multiprocess → common}/token_hasher.py +1 -1
  118. lmcache/v1/{distributed → common}/transfer_channel/api.py +2 -2
  119. lmcache/v1/{gpu_connector → common}/utils.py +28 -57
  120. lmcache/v1/distributed/api.py +172 -92
  121. lmcache/v1/distributed/config.py +110 -5
  122. lmcache/v1/distributed/eviction_policy/isolated_lru.py +9 -4
  123. lmcache/v1/distributed/key_codec.py +52 -14
  124. lmcache/v1/distributed/l1_manager/__init__.py +4 -0
  125. lmcache/v1/distributed/l1_manager/factory.py +9 -5
  126. lmcache/v1/distributed/l1_manager/shadow.py +227 -0
  127. lmcache/v1/distributed/l2_adapters/hf3fs_l2_adapter.py +20 -2
  128. lmcache/v1/distributed/l2_adapters/native_connector_l2_adapter.py +6 -5
  129. lmcache/v1/distributed/l2_adapters/p2p_l2_adapter.py +3 -3
  130. lmcache/v1/distributed/l2_adapters/raw_block/__init__.py +2 -8
  131. lmcache/v1/distributed/l2_adapters/raw_block/core.py +7 -37
  132. lmcache/v1/distributed/l2_adapters/raw_block/key_codec.py +2 -70
  133. lmcache/v1/distributed/l2_adapters/raw_block_l2_adapter.py +1 -1
  134. lmcache/v1/distributed/l2_adapters/resp_l2_adapter.py +19 -8
  135. lmcache/v1/distributed/l2_adapters/valkey/blob_tcp_worker_pool.py +193 -0
  136. lmcache/v1/distributed/l2_adapters/valkey/rdma_worker_pool.py +446 -0
  137. lmcache/v1/distributed/l2_adapters/valkey/worker_pool.py +20 -5
  138. lmcache/v1/distributed/l2_adapters/valkey_l2_adapter.py +181 -37
  139. lmcache/v1/distributed/memory_manager/__init__.py +7 -0
  140. lmcache/v1/distributed/memory_manager/shadow_l1_memory_manager.py +78 -0
  141. lmcache/v1/distributed/serde/utils.py +6 -6
  142. lmcache/v1/distributed/storage_controllers/prefetch_controller.py +69 -26
  143. lmcache/v1/distributed/storage_controllers/prefetch_policy.py +18 -12
  144. lmcache/v1/distributed/storage_manager.py +5 -1
  145. lmcache/v1/distributed/transfer_channel/__init__.py +5 -5
  146. lmcache/v1/distributed/transfer_channel/abstract.py +83 -11
  147. lmcache/v1/distributed/transfer_channel/impl/mooncake_te_impl.py +103 -49
  148. lmcache/v1/distributed/transfer_channel/impl/nixl_impl.py +156 -55
  149. lmcache/v1/kv_layer_groups.py +14 -34
  150. lmcache/v1/memory_management.py +264 -1
  151. lmcache/v1/memory_orchestrator/_codec.py +2 -2
  152. lmcache/v1/memory_orchestrator/_proto_gen/__init__.py +1 -1
  153. lmcache/v1/memory_orchestrator/_proto_gen/memory_orchestrator_pb2.pyi +1 -1
  154. lmcache/v1/memory_orchestrator/client.py +5 -1
  155. lmcache/v1/mp_coordinator/api.py +30 -1
  156. lmcache/v1/mp_coordinator/app.py +2 -2
  157. lmcache/v1/mp_coordinator/blend_client.py +1 -0
  158. lmcache/v1/mp_coordinator/blend_index.py +2 -2
  159. lmcache/v1/mp_coordinator/cache_events.py +1 -1
  160. lmcache/v1/mp_coordinator/controllers/eviction_controller.py +2 -7
  161. lmcache/v1/mp_coordinator/controllers/eviction_http_api.py +3 -0
  162. lmcache/v1/mp_coordinator/controllers/prefetch_manager.py +7 -1
  163. lmcache/v1/mp_coordinator/http_apis/cache_api.py +1 -0
  164. lmcache/v1/mp_coordinator/http_apis/dependencies.py +1 -1
  165. lmcache/v1/mp_coordinator/http_apis/directory_api.py +2 -0
  166. lmcache/v1/mp_coordinator/http_apis/instances_usage_api.py +7 -2
  167. lmcache/v1/mp_coordinator/http_auth.py +1 -1
  168. lmcache/v1/mp_coordinator/registrar.py +1 -1
  169. lmcache/v1/mp_coordinator/schemas.py +28 -1
  170. lmcache/v1/mp_coordinator/utils/encoding.py +14 -7
  171. lmcache/v1/mp_observability/event_bus.py +2 -1
  172. lmcache/v1/mp_observability/trace/codecs.py +3 -3
  173. lmcache/v1/multiprocess/cache_control/key_resolver.py +35 -6
  174. lmcache/v1/multiprocess/cache_control/prefetch_service.py +8 -0
  175. lmcache/v1/multiprocess/config.py +45 -8
  176. lmcache/v1/multiprocess/custom_types.py +12 -381
  177. lmcache/v1/multiprocess/engine_context.py +165 -15
  178. lmcache/v1/multiprocess/ext_server_module.py +5 -5
  179. lmcache/v1/multiprocess/group_view.py +24 -277
  180. lmcache/v1/multiprocess/http_apis/cache_api.py +1 -0
  181. lmcache/v1/multiprocess/http_apis/common/metrics_api.py +4 -1
  182. lmcache/v1/multiprocess/http_apis/schemas.py +8 -1
  183. lmcache/v1/multiprocess/http_server.py +1 -1
  184. lmcache/v1/multiprocess/modules/blend/lookup.py +63 -31
  185. lmcache/v1/multiprocess/modules/blend/matcher.py +27 -14
  186. lmcache/v1/multiprocess/modules/blend/module.py +21 -11
  187. lmcache/v1/multiprocess/modules/blend/read_set.py +33 -13
  188. lmcache/v1/multiprocess/modules/blend/registration.py +1 -1
  189. lmcache/v1/multiprocess/modules/blend/retrieve.py +17 -26
  190. lmcache/v1/multiprocess/modules/blend/rope.py +1 -1
  191. lmcache/v1/multiprocess/modules/blend/store.py +16 -4
  192. lmcache/v1/multiprocess/modules/engine_driven_transfer.py +10 -18
  193. lmcache/v1/multiprocess/modules/kv_events.py +10 -10
  194. lmcache/v1/multiprocess/modules/lmcache_driven_transfer.py +330 -77
  195. lmcache/v1/multiprocess/modules/lookup.py +188 -43
  196. lmcache/v1/multiprocess/modules/management.py +4 -4
  197. lmcache/v1/multiprocess/modules/p2p_controller.py +1 -1
  198. lmcache/v1/multiprocess/modules/server_transfer.py +20 -22
  199. lmcache/v1/multiprocess/object_group_transfer.py +316 -1
  200. lmcache/v1/multiprocess/plugin_modules/qstore.py +710 -10
  201. lmcache/v1/multiprocess/request_handler.py +1 -1
  202. lmcache/v1/multiprocess/server.py +15 -1
  203. lmcache/v1/multiprocess/session.py +55 -100
  204. lmcache/v1/multiprocess/transport/base.py +44 -9
  205. lmcache/v1/multiprocess/transport/grpc_impl/__init__.py +0 -35
  206. lmcache/v1/multiprocess/transport/grpc_impl/aio_server.py +13 -3
  207. lmcache/v1/multiprocess/transport/grpc_impl/auth.py +134 -0
  208. lmcache/v1/multiprocess/transport/grpc_impl/native_server.py +25 -20
  209. lmcache/v1/multiprocess/transport/grpc_impl/server.py +17 -4
  210. lmcache/v1/multiprocess/transport/grpc_impl/server_base.py +10 -5
  211. lmcache/v1/multiprocess/transport/grpc_impl/server_builder.py +2 -0
  212. lmcache/v1/multiprocess/transport/grpc_impl/server_handlers.py +52 -5
  213. lmcache/v1/multiprocess/transport/server_factory.py +2 -0
  214. lmcache/v1/multiprocess/transport/zmq_impl/__init__.py +0 -58
  215. lmcache/v1/multiprocess/transport/zmq_impl/mq.py +83 -444
  216. lmcache/v1/multiprocess/transport/zmq_impl/server.py +3 -1
  217. lmcache/v1/platform/__init__.py +8 -1
  218. lmcache/v1/platform/base/cache_context.py +14 -1
  219. lmcache/v1/platform/base/device_spec.py +1 -1
  220. lmcache/v1/platform/base/ipc_wrapper.py +63 -1
  221. lmcache/v1/platform/cache_context.py +3 -3
  222. lmcache/v1/platform/devices/cpu/__init__.py +1 -1
  223. lmcache/v1/platform/devices/cpu/cache_context.py +19 -4
  224. lmcache/v1/platform/devices/cpu/shm.py +5 -5
  225. lmcache/v1/platform/devices/cuda/cache_context.py +24 -9
  226. lmcache/v1/platform/devices/cuda/ipc_wrapper.py +17 -53
  227. lmcache/v1/platform/devices/mlu/device_ops.py +1 -1
  228. lmcache/v1/platform/devices/musa/__init__.py +1 -1
  229. lmcache/v1/platform/devices/musa/cache_context.py +25 -10
  230. lmcache/v1/platform/devices/musa/device_ops.py +156 -3
  231. lmcache/v1/platform/devices/musa/format_capabilities.py +2 -2
  232. lmcache/v1/platform/devices/musa/ipc_wrapper.py +32 -4
  233. lmcache/v1/platform/devices/musa/native_kv_transfer.py +1 -1
  234. lmcache/v1/platform/devices/neuron/device_ops.py +1 -1
  235. lmcache/v1/platform/devices/npu/cache_context.py +25 -5
  236. lmcache/v1/platform/devices/rbln/device_ops.py +2 -2
  237. lmcache/v1/platform/fd_channel.py +365 -0
  238. lmcache/v1/platform/kv_wrap.py +62 -3
  239. lmcache/v1/platform/native_block_transfer.py +2 -2
  240. lmcache/v1/platform/torch_ops/_kv_format.py +2 -2
  241. lmcache/v1/platform/torch_ops/mp_mem_kernels.py +1 -1
  242. lmcache/v1/protocol.py +1 -1
  243. lmcache/v1/rpc_utils.py +2 -1
  244. lmcache/v1/transport/__init__.py +6 -0
  245. lmcache/v1/transport/grpc/__init__.py +2 -0
  246. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/_proto_gen/__init__.py +1 -1
  247. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/_proto_gen/_generate.py +2 -2
  248. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/_proto_gen/common_pb2.pyi +20 -9
  249. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/_proto_gen/p2p_service_pb2.pyi +1 -1
  250. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/codecs/__init__.py +3 -3
  251. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/codecs/common.py +3 -3
  252. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/codecs/p2p.py +2 -2
  253. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/descriptors.py +2 -3
  254. lmcache/v1/transport/grpc/endpoint.py +43 -0
  255. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/method_registry.py +4 -45
  256. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/proto_codec.py +1 -1
  257. lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/common.proto +5 -1
  258. lmcache/v1/transport/grpc/protos/qstore_service.proto +75 -0
  259. lmcache/v1/transport/qstore.py +33 -0
  260. lmcache/v1/{multiprocess → transport}/rpc.py +1 -1
  261. lmcache/v1/transport/zmq/__init__.py +2 -0
  262. lmcache/v1/{multiprocess/transport/zmq_impl → transport/zmq}/wire.py +45 -1
  263. lmcache/v1/utils/frozen_dict.py +39 -0
  264. {lmcache_cli-0.5.8.dev0.dist-info → lmcache_cli-0.5.8rc2.dev0.dist-info}/METADATA +1 -1
  265. lmcache_cli-0.5.8rc2.dev0.dist-info/RECORD +735 -0
  266. lmcache/inprocess/__init__.py +0 -2
  267. lmcache/inprocess/integration/__init__.py +0 -2
  268. lmcache/inprocess/integration/base_service_factory.py +0 -171
  269. lmcache/inprocess/integration/tensorrt_llm/tensorrt_adapter.py +0 -377
  270. lmcache/inprocess/integration/tensorrt_llm/utils.py +0 -94
  271. lmcache/inprocess/integration/vllm/__init__.py +0 -2
  272. lmcache/inprocess/integration/vllm/lmcache_connector_v1.py +0 -210
  273. lmcache/inprocess/integration/vllm/lmcache_connector_v1_085.py +0 -147
  274. lmcache/inprocess/integration/vllm/utils.py +0 -160
  275. lmcache/inprocess/integration/vllm/vllm_ec_adapter.py +0 -194
  276. lmcache/inprocess/integration/vllm/vllm_service_factory.py +0 -343
  277. lmcache/inprocess/integration/vllm/vllm_v1_adapter.py +0 -1947
  278. lmcache/inprocess/observability.py +0 -1998
  279. lmcache/inprocess/standalone/__init__.py +0 -1
  280. lmcache/inprocess/standalone/__main__.py +0 -599
  281. lmcache/inprocess/standalone/manager.py +0 -82
  282. lmcache/inprocess/standalone/standalone_service_factory.py +0 -86
  283. lmcache/inprocess/tools/__init__.py +0 -1
  284. lmcache/inprocess/tools/controller_benchmark/README.md +0 -161
  285. lmcache/inprocess/tools/controller_benchmark/__init__.py +0 -1
  286. lmcache/inprocess/tools/controller_benchmark/__main__.py +0 -331
  287. lmcache/inprocess/tools/controller_benchmark/benchmark.py +0 -660
  288. lmcache/inprocess/tools/controller_benchmark/config.py +0 -44
  289. lmcache/inprocess/tools/controller_benchmark/constants.py +0 -10
  290. lmcache/inprocess/tools/controller_benchmark/handlers/__init__.py +0 -31
  291. lmcache/inprocess/tools/controller_benchmark/handlers/admit.py +0 -52
  292. lmcache/inprocess/tools/controller_benchmark/handlers/base.py +0 -47
  293. lmcache/inprocess/tools/controller_benchmark/handlers/deregister.py +0 -49
  294. lmcache/inprocess/tools/controller_benchmark/handlers/evict.py +0 -52
  295. lmcache/inprocess/tools/controller_benchmark/handlers/heartbeat.py +0 -56
  296. lmcache/inprocess/tools/controller_benchmark/handlers/p2p_lookup.py +0 -47
  297. lmcache/inprocess/tools/controller_benchmark/handlers/register.py +0 -56
  298. lmcache/inprocess/usage_telemetry/__init__.py +0 -1
  299. lmcache/inprocess/usage_telemetry/context.py +0 -106
  300. lmcache/inprocess/usage_telemetry/continuous.py +0 -212
  301. lmcache/inprocess/usage_telemetry/messages.py +0 -111
  302. lmcache/inprocess/v1/__init__.py +0 -1
  303. lmcache/inprocess/v1/api_server/__init__.py +0 -2
  304. lmcache/inprocess/v1/api_server/__main__.py +0 -545
  305. lmcache/inprocess/v1/basic_check.py +0 -112
  306. lmcache/inprocess/v1/cache_controller/__init__.py +0 -11
  307. lmcache/inprocess/v1/cache_controller/commands/__init__.py +0 -15
  308. lmcache/inprocess/v1/cache_controller/commands/base.py +0 -35
  309. lmcache/inprocess/v1/cache_controller/commands/full_sync.py +0 -49
  310. lmcache/inprocess/v1/cache_controller/config.py +0 -179
  311. lmcache/inprocess/v1/cache_controller/controller_manager.py +0 -552
  312. lmcache/inprocess/v1/cache_controller/controllers/__init__.py +0 -11
  313. lmcache/inprocess/v1/cache_controller/controllers/full_sync_tracker.py +0 -473
  314. lmcache/inprocess/v1/cache_controller/controllers/kv_controller.py +0 -441
  315. lmcache/inprocess/v1/cache_controller/controllers/registration_controller.py +0 -285
  316. lmcache/inprocess/v1/cache_controller/executor.py +0 -470
  317. lmcache/inprocess/v1/cache_controller/frontend/static/css/style.css +0 -201
  318. lmcache/inprocess/v1/cache_controller/frontend/static/img/logo.png +0 -0
  319. lmcache/inprocess/v1/cache_controller/frontend/static/index.html +0 -234
  320. lmcache/inprocess/v1/cache_controller/frontend/static/js/controller_app.js +0 -660
  321. lmcache/inprocess/v1/cache_controller/full_sync_sender.py +0 -475
  322. lmcache/inprocess/v1/cache_controller/locks.py +0 -149
  323. lmcache/inprocess/v1/cache_controller/message.py +0 -828
  324. lmcache/inprocess/v1/cache_controller/observability.py +0 -208
  325. lmcache/inprocess/v1/cache_controller/utils.py +0 -685
  326. lmcache/inprocess/v1/cache_controller/worker.py +0 -668
  327. lmcache/inprocess/v1/cache_engine.py +0 -2216
  328. lmcache/inprocess/v1/cache_interface.py +0 -19
  329. lmcache/inprocess/v1/check/__init__.py +0 -76
  330. lmcache/inprocess/v1/check/check_mode_gen.py +0 -86
  331. lmcache/inprocess/v1/check/check_mode_test_l2_adapter.py +0 -327
  332. lmcache/inprocess/v1/check/check_mode_test_remote.py +0 -155
  333. lmcache/inprocess/v1/check/check_mode_test_storage_manager.py +0 -142
  334. lmcache/inprocess/v1/check/utils.py +0 -566
  335. lmcache/inprocess/v1/compute/__init__.py +0 -2
  336. lmcache/inprocess/v1/compute/attention/__init__.py +0 -1
  337. lmcache/inprocess/v1/compute/attention/abstract.py +0 -39
  338. lmcache/inprocess/v1/compute/attention/flash_attn.py +0 -139
  339. lmcache/inprocess/v1/compute/attention/flash_infer_sparse.py +0 -285
  340. lmcache/inprocess/v1/compute/attention/metadata.py +0 -176
  341. lmcache/inprocess/v1/compute/attention/triton_kernels/__init__.py +0 -13
  342. lmcache/inprocess/v1/compute/attention/triton_kernels/block_sparse_attention.py +0 -559
  343. lmcache/inprocess/v1/compute/attention/triton_sparse.py +0 -149
  344. lmcache/inprocess/v1/compute/attention/utils.py +0 -103
  345. lmcache/inprocess/v1/compute/blend/__init__.py +0 -7
  346. lmcache/inprocess/v1/compute/blend/blender.py +0 -172
  347. lmcache/inprocess/v1/compute/blend/metadata.py +0 -34
  348. lmcache/inprocess/v1/compute/blend/utils.py +0 -64
  349. lmcache/inprocess/v1/compute/models/__init__.py +0 -0
  350. lmcache/inprocess/v1/compute/models/base.py +0 -156
  351. lmcache/inprocess/v1/compute/models/llama.py +0 -9
  352. lmcache/inprocess/v1/compute/models/qwen3.py +0 -24
  353. lmcache/inprocess/v1/compute/models/utils.py +0 -69
  354. lmcache/inprocess/v1/compute/positional_encoding.py +0 -203
  355. lmcache/inprocess/v1/config.py +0 -1228
  356. lmcache/inprocess/v1/config_base.py +0 -849
  357. lmcache/inprocess/v1/ec_engine.py +0 -202
  358. lmcache/inprocess/v1/event_manager.py +0 -145
  359. lmcache/inprocess/v1/gpu_connector/__init__.py +0 -184
  360. lmcache/inprocess/v1/gpu_connector/gpu_connectors.py +0 -1743
  361. lmcache/inprocess/v1/gpu_connector/hpu_connector.py +0 -340
  362. lmcache/inprocess/v1/gpu_connector/mock_gpu_connector.py +0 -67
  363. lmcache/inprocess/v1/gpu_connector/musa_connectors.py +0 -952
  364. lmcache/inprocess/v1/gpu_connector/utils.py +0 -41
  365. lmcache/inprocess/v1/gpu_connector/xpu_connectors.py +0 -1241
  366. lmcache/inprocess/v1/health_monitor/__init__.py +0 -1
  367. lmcache/inprocess/v1/health_monitor/base.py +0 -577
  368. lmcache/inprocess/v1/health_monitor/checks/__init__.py +0 -1
  369. lmcache/inprocess/v1/health_monitor/checks/remote_backend_check.py +0 -311
  370. lmcache/inprocess/v1/health_monitor/constants.py +0 -36
  371. lmcache/inprocess/v1/hidden_state_store.py +0 -365
  372. lmcache/inprocess/v1/internal_api_server/__init__.py +0 -0
  373. lmcache/inprocess/v1/internal_api_server/api_registry.py +0 -63
  374. lmcache/inprocess/v1/internal_api_server/api_server.py +0 -134
  375. lmcache/inprocess/v1/internal_api_server/controller/__init__.py +0 -0
  376. lmcache/inprocess/v1/internal_api_server/controller/key_stats_api.py +0 -81
  377. lmcache/inprocess/v1/internal_api_server/controller/worker_info_api.py +0 -136
  378. lmcache/inprocess/v1/internal_api_server/utils.py +0 -43
  379. lmcache/inprocess/v1/internal_api_server/vllm/__init__.py +0 -0
  380. lmcache/inprocess/v1/internal_api_server/vllm/backend_api.py +0 -221
  381. lmcache/inprocess/v1/internal_api_server/vllm/bypass_api.py +0 -204
  382. lmcache/inprocess/v1/internal_api_server/vllm/cache_api.py +0 -897
  383. lmcache/inprocess/v1/internal_api_server/vllm/chunk_statistics_api.py +0 -141
  384. lmcache/inprocess/v1/internal_api_server/vllm/conf_api.py +0 -147
  385. lmcache/inprocess/v1/internal_api_server/vllm/freeze_api.py +0 -172
  386. lmcache/inprocess/v1/internal_api_server/vllm/hot_cache_api.py +0 -184
  387. lmcache/inprocess/v1/internal_api_server/vllm/inference_api.py +0 -65
  388. lmcache/inprocess/v1/internal_api_server/vllm/load_fs_chunks_api.py +0 -320
  389. lmcache/inprocess/v1/internal_api_server/vllm/lookup_api.py +0 -145
  390. lmcache/inprocess/v1/lookup_client/__init__.py +0 -27
  391. lmcache/inprocess/v1/lookup_client/abstract_client.py +0 -77
  392. lmcache/inprocess/v1/lookup_client/async_lookup_message.py +0 -50
  393. lmcache/inprocess/v1/lookup_client/chunk_statistics_lookup_client.py +0 -211
  394. lmcache/inprocess/v1/lookup_client/factory.py +0 -253
  395. lmcache/inprocess/v1/lookup_client/hit_limit_lookup_client.py +0 -94
  396. lmcache/inprocess/v1/lookup_client/lmcache_async_lookup_client.py +0 -410
  397. lmcache/inprocess/v1/lookup_client/lmcache_lookup_client.py +0 -296
  398. lmcache/inprocess/v1/lookup_client/lmcache_lookup_client_bypass.py +0 -102
  399. lmcache/inprocess/v1/lookup_client/mooncake_lookup_client.py +0 -98
  400. lmcache/inprocess/v1/lookup_client/record_strategies/__init__.py +0 -69
  401. lmcache/inprocess/v1/lookup_client/record_strategies/base.py +0 -327
  402. lmcache/inprocess/v1/lookup_client/record_strategies/file_hash.py +0 -130
  403. lmcache/inprocess/v1/lookup_client/record_strategies/memory_bloom_filter.py +0 -81
  404. lmcache/inprocess/v1/manager.py +0 -532
  405. lmcache/inprocess/v1/memory_allocators/__init__.py +0 -2
  406. lmcache/inprocess/v1/memory_allocators/cu_file_memory_allocator.py +0 -38
  407. lmcache/inprocess/v1/memory_allocators/hip_file_memory_allocator.py +0 -34
  408. lmcache/inprocess/v1/memory_allocators/paged_cpu_gpu_memory_allocator.py +0 -205
  409. lmcache/inprocess/v1/metadata.py +0 -121
  410. lmcache/inprocess/v1/offload_server/__init__.py +0 -19
  411. lmcache/inprocess/v1/offload_server/abstract_server.py +0 -37
  412. lmcache/inprocess/v1/offload_server/message.py +0 -30
  413. lmcache/inprocess/v1/offload_server/zmq_server.py +0 -122
  414. lmcache/inprocess/v1/protocol.py +0 -148
  415. lmcache/inprocess/v1/rpc/__init__.py +0 -17
  416. lmcache/inprocess/v1/rpc/transport.py +0 -105
  417. lmcache/inprocess/v1/rpc/zmq_transport.py +0 -213
  418. lmcache/inprocess/v1/rpc_utils.py +0 -218
  419. lmcache/inprocess/v1/storage_backend/__init__.py +0 -342
  420. lmcache/inprocess/v1/storage_backend/abstract_backend.py +0 -460
  421. lmcache/inprocess/v1/storage_backend/audit_backend.py +0 -252
  422. lmcache/inprocess/v1/storage_backend/batched_message_sender.py +0 -226
  423. lmcache/inprocess/v1/storage_backend/cache_policy/__init__.py +0 -47
  424. lmcache/inprocess/v1/storage_backend/cache_policy/base_policy.py +0 -87
  425. lmcache/inprocess/v1/storage_backend/cache_policy/fifo.py +0 -61
  426. lmcache/inprocess/v1/storage_backend/cache_policy/lfu.py +0 -108
  427. lmcache/inprocess/v1/storage_backend/cache_policy/lru.py +0 -84
  428. lmcache/inprocess/v1/storage_backend/cache_policy/mru.py +0 -64
  429. lmcache/inprocess/v1/storage_backend/connector/__init__.py +0 -426
  430. lmcache/inprocess/v1/storage_backend/connector/audit_adapter.py +0 -79
  431. lmcache/inprocess/v1/storage_backend/connector/audit_connector.py +0 -363
  432. lmcache/inprocess/v1/storage_backend/connector/azure_adapter.py +0 -73
  433. lmcache/inprocess/v1/storage_backend/connector/azure_connector.py +0 -335
  434. lmcache/inprocess/v1/storage_backend/connector/base_connector.py +0 -382
  435. lmcache/inprocess/v1/storage_backend/connector/bigtable_adapter.py +0 -35
  436. lmcache/inprocess/v1/storage_backend/connector/bigtable_connector.py +0 -1172
  437. lmcache/inprocess/v1/storage_backend/connector/bigtable_schema.py +0 -74
  438. lmcache/inprocess/v1/storage_backend/connector/blackhole_adapter.py +0 -26
  439. lmcache/inprocess/v1/storage_backend/connector/blackhole_connector.py +0 -38
  440. lmcache/inprocess/v1/storage_backend/connector/eic_adapter.py +0 -33
  441. lmcache/inprocess/v1/storage_backend/connector/eic_connector.py +0 -776
  442. lmcache/inprocess/v1/storage_backend/connector/external_adapter.py +0 -81
  443. lmcache/inprocess/v1/storage_backend/connector/fs_adapter.py +0 -51
  444. lmcache/inprocess/v1/storage_backend/connector/fs_connector.py +0 -411
  445. lmcache/inprocess/v1/storage_backend/connector/hf3fs_adapter.py +0 -291
  446. lmcache/inprocess/v1/storage_backend/connector/hf3fs_connector.py +0 -631
  447. lmcache/inprocess/v1/storage_backend/connector/hfbucket_adapter.py +0 -57
  448. lmcache/inprocess/v1/storage_backend/connector/hfbucket_connector.py +0 -782
  449. lmcache/inprocess/v1/storage_backend/connector/infinistore_adapter.py +0 -58
  450. lmcache/inprocess/v1/storage_backend/connector/infinistore_connector.py +0 -178
  451. lmcache/inprocess/v1/storage_backend/connector/instrumented_connector.py +0 -221
  452. lmcache/inprocess/v1/storage_backend/connector/mock_adapter.py +0 -59
  453. lmcache/inprocess/v1/storage_backend/connector/mock_connector.py +0 -354
  454. lmcache/inprocess/v1/storage_backend/connector/mooncakestore_adapter.py +0 -43
  455. lmcache/inprocess/v1/storage_backend/connector/mooncakestore_connector.py +0 -841
  456. lmcache/inprocess/v1/storage_backend/connector/redis_adapter.py +0 -199
  457. lmcache/inprocess/v1/storage_backend/connector/redis_connector.py +0 -833
  458. lmcache/inprocess/v1/storage_backend/connector/s3_adapter.py +0 -61
  459. lmcache/inprocess/v1/storage_backend/connector/s3_connector.py +0 -717
  460. lmcache/inprocess/v1/storage_backend/connector/sagemaker_hyperpod_adapter.py +0 -243
  461. lmcache/inprocess/v1/storage_backend/connector/sagemaker_hyperpod_connector.py +0 -1031
  462. lmcache/inprocess/v1/storage_backend/connector/valkey_adapter.py +0 -178
  463. lmcache/inprocess/v1/storage_backend/connector/valkey_connector.py +0 -441
  464. lmcache/inprocess/v1/storage_backend/gds_backend.py +0 -1323
  465. lmcache/inprocess/v1/storage_backend/hipfile_shim.py +0 -167
  466. lmcache/inprocess/v1/storage_backend/job_executor/__init__.py +0 -0
  467. lmcache/inprocess/v1/storage_backend/job_executor/base_executor.py +0 -34
  468. lmcache/inprocess/v1/storage_backend/job_executor/pq_executor.py +0 -237
  469. lmcache/inprocess/v1/storage_backend/legacy_serde/__init__.py +0 -1
  470. lmcache/inprocess/v1/storage_backend/legacy_serde/cachegen_basics.py +0 -210
  471. lmcache/inprocess/v1/storage_backend/legacy_serde/cachegen_decoder.py +0 -211
  472. lmcache/inprocess/v1/storage_backend/legacy_serde/cachegen_encoder.py +0 -396
  473. lmcache/inprocess/v1/storage_backend/legacy_serde/serde.py +0 -75
  474. lmcache/inprocess/v1/storage_backend/local_cpu_backend.py +0 -994
  475. lmcache/inprocess/v1/storage_backend/local_disk_backend.py +0 -844
  476. lmcache/inprocess/v1/storage_backend/maru_backend.py +0 -737
  477. lmcache/inprocess/v1/storage_backend/naive_serde/__init__.py +0 -57
  478. lmcache/inprocess/v1/storage_backend/naive_serde/cachegen_basics.py +0 -135
  479. lmcache/inprocess/v1/storage_backend/naive_serde/cachegen_decoder.py +0 -142
  480. lmcache/inprocess/v1/storage_backend/naive_serde/cachegen_encoder.py +0 -116
  481. lmcache/inprocess/v1/storage_backend/naive_serde/kivi_serde.py +0 -25
  482. lmcache/inprocess/v1/storage_backend/naive_serde/naive_serde.py +0 -21
  483. lmcache/inprocess/v1/storage_backend/naive_serde/serde.py +0 -37
  484. lmcache/inprocess/v1/storage_backend/native_clients/aerospike_client.py +0 -74
  485. lmcache/inprocess/v1/storage_backend/native_clients/connector_client_base.py +0 -165
  486. lmcache/inprocess/v1/storage_backend/native_clients/resp_client.py +0 -35
  487. lmcache/inprocess/v1/storage_backend/nixl_storage_backend.py +0 -2422
  488. lmcache/inprocess/v1/storage_backend/p2p_backend.py +0 -794
  489. lmcache/inprocess/v1/storage_backend/path_sharder.py +0 -115
  490. lmcache/inprocess/v1/storage_backend/pd_backend.py +0 -1093
  491. lmcache/inprocess/v1/storage_backend/pd_backend_async.py +0 -1735
  492. lmcache/inprocess/v1/storage_backend/plugins/dax_backend.py +0 -931
  493. lmcache/inprocess/v1/storage_backend/plugins/rust_raw_block_backend.py +0 -758
  494. lmcache/inprocess/v1/storage_backend/remote_backend.py +0 -629
  495. lmcache/inprocess/v1/storage_backend/resp_client.py +0 -227
  496. lmcache/inprocess/v1/storage_backend/storage_backend_listener.py +0 -21
  497. lmcache/inprocess/v1/storage_backend/storage_manager.py +0 -1429
  498. lmcache/inprocess/v1/system_detection.py +0 -116
  499. lmcache/inprocess/v1/token_database.py +0 -580
  500. lmcache/inprocess/v1/transfer_channel/__init__.py +0 -83
  501. lmcache/inprocess/v1/transfer_channel/abstract.py +0 -285
  502. lmcache/inprocess/v1/transfer_channel/mock_memory_channel.py +0 -156
  503. lmcache/inprocess/v1/transfer_channel/nixl_channel.py +0 -688
  504. lmcache/inprocess/v1/transfer_channel/py_socket_channel.py +0 -260
  505. lmcache/inprocess/v1/transfer_channel/transfer_utils.py +0 -61
  506. lmcache/integration/vllm/lmcache_connector_v1.py +0 -210
  507. lmcache/sdk/wrapper/contiguous.py +0 -82
  508. lmcache/v1/multiprocess/transport/grpc_impl/protos/qstore_service.proto +0 -16
  509. lmcache_cli-0.5.8.dev0.dist-info/RECORD +0 -949
  510. /lmcache/v1/{multiprocess → client}/client_config.py +0 -0
  511. /lmcache/v1/{multiprocess → client}/transfer_context/tensor_wire.py +0 -0
  512. /lmcache/v1/{gpu_connector → common}/kv_format/types.py +0 -0
  513. /lmcache/v1/{multiprocess → common}/token_codec.py +0 -0
  514. /lmcache/{inprocess/integration/tensorrt_llm → v1/common/transfer_channel}/__init__.py +0 -0
  515. /lmcache/v1/{multiprocess → platform}/posix_shm.py +0 -0
  516. /lmcache/v1/{multiprocess → platform}/transfer_mode.py +0 -0
  517. /lmcache/v1/{multiprocess/transport → transport}/auth.py +0 -0
  518. /lmcache/v1/{multiprocess → transport}/futures.py +0 -0
  519. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/_proto_gen/.gitignore +0 -0
  520. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/codecs/base.py +0 -0
  521. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/__init__.py +0 -0
  522. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/blend_service.proto +0 -0
  523. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/engine_driven_service.proto +0 -0
  524. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/extension_service.proto +0 -0
  525. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/kv_event_service.proto +0 -0
  526. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/lmcache_driven_service.proto +0 -0
  527. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/lookup_service.proto +0 -0
  528. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/management_service.proto +0 -0
  529. /lmcache/v1/{multiprocess/transport/grpc_impl → transport/grpc}/protos/p2p_service.proto +0 -0
  530. /lmcache/v1/{multiprocess/protocols → transport}/server_module.py +0 -0
  531. {lmcache_cli-0.5.8.dev0.dist-info → lmcache_cli-0.5.8rc2.dev0.dist-info}/WHEEL +0 -0
  532. {lmcache_cli-0.5.8.dev0.dist-info → lmcache_cli-0.5.8rc2.dev0.dist-info}/entry_points.txt +0 -0
  533. {lmcache_cli-0.5.8.dev0.dist-info → lmcache_cli-0.5.8rc2.dev0.dist-info}/licenses/LICENSE +0 -0
  534. {lmcache_cli-0.5.8.dev0.dist-info → lmcache_cli-0.5.8rc2.dev0.dist-info}/top_level.txt +0 -0
lmcache/_version.py CHANGED
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.5.8.dev0'
22
- __version_tuple__ = version_tuple = (0, 5, 8, 'dev0')
21
+ __version__ = version = '0.5.8rc2.dev0'
22
+ __version_tuple__ = version_tuple = (0, 5, 8, 'rc2', 'dev0')
23
23
 
24
- __commit_id__ = commit_id = 'g236f3eec3'
24
+ __commit_id__ = commit_id = 'g6a316c3e0'
@@ -22,6 +22,44 @@ from lmcache.logging import init_logger
22
22
  logger = init_logger(__name__)
23
23
 
24
24
 
25
+ def positive_int(value: str) -> int:
26
+ """Parse an argparse value as an integer greater than zero.
27
+
28
+ Args:
29
+ value: Integer text supplied on the command line.
30
+
31
+ Returns:
32
+ The parsed positive integer.
33
+
34
+ Raises:
35
+ ValueError: If value is not integer text.
36
+ argparse.ArgumentTypeError: If the integer is zero or negative.
37
+ """
38
+ count = int(value)
39
+ if count <= 0:
40
+ raise argparse.ArgumentTypeError("must be a positive integer")
41
+ return count
42
+
43
+
44
+ def nonnegative_int(value: str) -> int:
45
+ """Parse an argparse value as an integer greater than or equal to zero.
46
+
47
+ Args:
48
+ value: Integer text supplied on the command line.
49
+
50
+ Returns:
51
+ The parsed non-negative integer.
52
+
53
+ Raises:
54
+ ValueError: If value is not integer text.
55
+ argparse.ArgumentTypeError: If the integer is negative.
56
+ """
57
+ count = int(value)
58
+ if count < 0:
59
+ raise argparse.ArgumentTypeError("must be a non-negative integer")
60
+ return count
61
+
62
+
25
63
  def _route_head(tokens: Sequence[str]) -> tuple[str | None, list[str]]:
26
64
  """Split the current level's route head off the remaining tokens.
27
65
 
@@ -15,6 +15,9 @@ import argparse
15
15
  import os
16
16
  import sys
17
17
 
18
+ # First Party
19
+ from lmcache.cli.commands.base import nonnegative_int, positive_int
20
+
18
21
  if TYPE_CHECKING:
19
22
  # First Party
20
23
  from lmcache.cli.commands.base import BaseCommand
@@ -29,6 +32,8 @@ if TYPE_CHECKING:
29
32
  def add_l2_arguments(parser: argparse.ArgumentParser) -> None:
30
33
  """Add ``lmcache bench l2`` arguments to *parser*.
31
34
 
35
+ Require positive measurement rounds and non-negative warmup rounds.
36
+
32
37
  Args:
33
38
  parser: The ``ArgumentParser`` for the L2 bench subcommand.
34
39
  """
@@ -92,15 +97,15 @@ def add_l2_arguments(parser: argparse.ArgumentParser) -> None:
92
97
  )
93
98
  parser.add_argument(
94
99
  "--rounds",
95
- type=int,
100
+ type=positive_int,
96
101
  default=1,
97
- help="Measurement rounds per operation (default: 1).",
102
+ help="Positive number of measurement rounds per operation (default: 1).",
98
103
  )
99
104
  parser.add_argument(
100
105
  "--warmup-rounds",
101
- type=int,
106
+ type=nonnegative_int,
102
107
  default=1,
103
- help="Warmup rounds before measurement (default: 1).",
108
+ help="Non-negative warmup rounds before measurement (default: 1).",
104
109
  )
105
110
  parser.add_argument(
106
111
  "--lookup-max-hit-rate",
@@ -189,6 +194,11 @@ def run_l2_adapter_bench(command: "BaseCommand", args: argparse.Namespace) -> No
189
194
  to obtain a configured :class:`Metrics` object via
190
195
  ``command.create_metrics``.
191
196
  args: Parsed CLI arguments from the ``bench l2`` subparser.
197
+
198
+ Raises:
199
+ SystemExit: With code 1 if adapter creation or verification fails, or
200
+ an operation times out in every measured round; code 2 for invalid
201
+ arguments or unavailable requested profiling tools.
192
202
  """
193
203
  # Lazy imports: keep CLI loadable without torch / native deps.
194
204
  # First Party
@@ -572,6 +582,13 @@ def run_l2_adapter_bench(command: "BaseCommand", args: argparse.Namespace) -> No
572
582
  data_per_round_mb=(keys_per_round * data_size) / mb,
573
583
  results=results,
574
584
  )
585
+ for result in results:
586
+ if result.timed_out_rounds > 0 and not result.round_durations:
587
+ print(
588
+ f"Error: all measured {result.operation.lower()} rounds timed out.",
589
+ file=sys.stderr,
590
+ )
591
+ failed = True
575
592
  finally:
576
593
  # Idempotent: a no-op if profiling already stopped on the normal
577
594
  # path; tears the recorder down if a phase raised.
@@ -607,20 +624,21 @@ def _strip_warmup(result: "BenchResult", warmup: int) -> "BenchResult":
607
624
  # First Party
608
625
  from lmcache.cli.commands.bench.l2_adapter_bench.result import BenchResult
609
626
 
610
- # Adjust the expected hit count proportionally for the kept rounds.
611
- kept_rounds = max(0, len(result.round_durations) - warmup)
612
- total_rounds = max(1, len(result.round_durations))
613
- scaled_expected_hit = int(result.expected_hit_count * kept_rounds / total_rounds)
627
+ # Timed-out rounds have no duration entry, so skip only completed warmup rounds.
628
+ warmup_timeouts = sum(result.round_timed_out[:warmup])
629
+ warmup_completed = warmup - warmup_timeouts
614
630
 
615
631
  return BenchResult(
616
632
  operation=result.operation,
617
633
  in_flight=result.in_flight,
618
634
  num_keys=result.num_keys,
619
635
  data_size_bytes=result.data_size_bytes,
620
- round_durations=result.round_durations[warmup:],
636
+ round_durations=result.round_durations[warmup_completed:],
621
637
  success_counts=result.success_counts[warmup:],
638
+ timed_out_rounds=result.timed_out_rounds - warmup_timeouts,
639
+ round_timed_out=result.round_timed_out[warmup:],
622
640
  expected_max_hit_rate=result.expected_max_hit_rate,
623
- expected_hit_count=scaled_expected_hit,
641
+ expected_hit_count=result.expected_hit_count,
624
642
  )
625
643
 
626
644
 
@@ -5,6 +5,7 @@
5
5
  from __future__ import annotations
6
6
 
7
7
  # Standard
8
+ import hashlib
8
9
  import select
9
10
 
10
11
  # Third Party
@@ -76,6 +77,10 @@ def make_object_keys(
76
77
  ``ObjectKey`` is a frozen dataclass with field order:
77
78
  (chunk_hash, model_name, kv_rank).
78
79
 
80
+ Each ``chunk_hash`` is a deterministic 32-byte hash of the key index, so
81
+ the same index always yields the same key and hash bytes are uniformly
82
+ distributed like real blake3/sha256 chunk hashes.
83
+
79
84
  Args:
80
85
  num_keys: Number of keys to generate.
81
86
  model_name: Model name embedded in each key.
@@ -84,8 +89,10 @@ def make_object_keys(
84
89
  keys: list[ObjectKey] = []
85
90
  for i in range(num_keys):
86
91
  idx = key_offset + i
87
- # chunk_hash: 16 bytes derived from index to guarantee uniqueness
88
- chunk_hash = idx.to_bytes(16, "big")
92
+ # Hash the index so keys look like real 32-byte chunk hashes. A raw
93
+ # big-endian index starts with zero bytes, which collapses adapters
94
+ # that place files by hash prefix into a single directory.
95
+ chunk_hash = hashlib.blake2b(idx.to_bytes(16, "big"), digest_size=32).digest()
89
96
  keys.append(
90
97
  ObjectKey(
91
98
  chunk_hash=chunk_hash,
@@ -49,8 +49,13 @@ class BenchResult:
49
49
  data_size_bytes: int
50
50
  round_durations: list[float] = field(default_factory=list)
51
51
  success_counts: list[int] = field(default_factory=list)
52
- # Rounds that hit the wait timeout and therefore have no duration.
52
+
53
+ # One timeout flag per attempted round, aligned with success_counts.
54
+ round_timed_out: list[bool] = field(default_factory=list)
55
+
56
+ # Timeout count for the rounds represented by this result.
53
57
  timed_out_rounds: int = 0
58
+
54
59
  # Lookup-specific metadata (left as defaults for store/load).
55
60
  expected_max_hit_rate: float = 0.0
56
61
  expected_hit_count: int = 0
@@ -176,6 +176,7 @@ def bench_store(
176
176
  if completed.get(tid, L2StoreResult(False, 0)).is_successful()
177
177
  )
178
178
 
179
+ result.round_timed_out.append(timed_out)
179
180
  if timed_out:
180
181
  log(
181
182
  f" [Store] Round {r + 1}: TIMEOUT "
@@ -246,6 +247,7 @@ def bench_lookup(
246
247
 
247
248
  total_found = sum(_bitmap_count(results.get(tid)) for tid in task_ids)
248
249
 
250
+ result.round_timed_out.append(timed_out)
249
251
  if timed_out:
250
252
  log(
251
253
  f" [Lookup] Round {r + 1}: TIMEOUT "
@@ -312,6 +314,7 @@ def bench_load(
312
314
 
313
315
  total_loaded = sum(_bitmap_count(results.get(tid)) for tid in task_ids)
314
316
 
317
+ result.round_timed_out.append(timed_out)
315
318
  if timed_out:
316
319
  log(
317
320
  f" [Load] Round {r + 1}: TIMEOUT "
@@ -55,6 +55,18 @@ def add_server_arguments(parser: argparse.ArgumentParser) -> None:
55
55
  "gpu->lmcache_driven, cpu->engine_driven."
56
56
  ),
57
57
  )
58
+ parser.add_argument(
59
+ "--isolated-ipc",
60
+ action=argparse.BooleanOptionalAction,
61
+ default=False,
62
+ help=(
63
+ "Use the IPC mechanisms for a bench client and server that share "
64
+ "no host IPC namespace or /dev/shm (CUDA: timeline-semaphore "
65
+ "events instead of interprocess event handles). GPU mode only. "
66
+ "Must match the server's --isolated-ipc setting; on a mismatch "
67
+ "the server cannot open the client's events. (Default is False)"
68
+ ),
69
+ )
58
70
  parser.add_argument(
59
71
  "--tp-size",
60
72
  type=int,
@@ -10,8 +10,8 @@ import torch
10
10
 
11
11
  # First Party
12
12
  from lmcache import torch_dev, torch_device_type
13
+ from lmcache.v1.common.group_view import EngineGroupInfo
13
14
  from lmcache.v1.kv_layer_groups import KVLayerGroupInfo
14
- from lmcache.v1.multiprocess.group_view import EngineGroupInfo
15
15
  from lmcache.v1.platform import synchronize_device
16
16
 
17
17
 
@@ -33,8 +33,11 @@ class KVCacheBuffers:
33
33
  device: str | torch.device | None = None,
34
34
  *,
35
35
  block_size: int | None = None,
36
+ tp_replicas: int = 1,
36
37
  ) -> None:
37
- """Allocate client-validated groups, optionally overriding token block size."""
38
+ """Allocate client-validated groups, optionally overriding token block size.
39
+
40
+ ``tp_replicas`` ranks share each group's object (MLA-style replication)."""
38
41
  self.kv_caches: dict[str, torch.Tensor] = {}
39
42
  self.engine_group_infos: list[EngineGroupInfo] = []
40
43
  self.block_size: int = (
@@ -61,6 +64,7 @@ class KVCacheBuffers:
61
64
  engine_group_id=group_index,
62
65
  layer_indices=tuple(group.layer_indices),
63
66
  tokens_per_block=self.block_size,
67
+ tp_replicas=tp_replicas,
64
68
  )
65
69
  )
66
70
  for _ in range(sd.nl):
@@ -44,22 +44,21 @@ from lmcache.cli.commands.bench.server_bench.helpers import (
44
44
  _wait_for_result,
45
45
  )
46
46
  from lmcache.utils import EngineType
47
- from lmcache.v1.gpu_connector.utils import LayoutHints
47
+ from lmcache.v1.client.transport.factory import RequestClientFactory
48
+ from lmcache.v1.client.worker_transfer import (
49
+ EngineDrivenTransferContext,
50
+ create_transfer_context,
51
+ )
52
+ from lmcache.v1.common.utils import LayoutHints
48
53
  from lmcache.v1.kv_layer_groups import (
49
54
  DTYPE_MAP,
50
55
  format_kvcache_shape_spec,
51
56
  parse_kvcache_shape_spec,
52
57
  )
53
- from lmcache.v1.multiprocess.transfer_context import (
54
- EngineDrivenTransferContext,
55
- create_transfer_context,
56
- )
57
- from lmcache.v1.multiprocess.transport.factory import RequestClientFactory
58
58
 
59
59
  if TYPE_CHECKING:
60
60
  # First Party
61
- from lmcache.v1.multiprocess.transfer_context import TransferContext
62
- from lmcache.v1.multiprocess.transfer_context.worker_transfer import IPCEvent
61
+ from lmcache.v1.client.worker_transfer import IPCEvent, TransferContext
63
62
  from lmcache.v1.multiprocess.transport.base import RequestClient
64
63
 
65
64
 
@@ -344,8 +343,6 @@ class ServerBenchClient:
344
343
  start=0,
345
344
  end=request.num_full_tokens,
346
345
  world_size=self._kv_world_size,
347
- num_kv_readers=sum(w.spec.retrieve_enabled for w in self._workers)
348
- // self._kv_world_size,
349
346
  )
350
347
  started_at = time.monotonic()
351
348
  if not _send_lookup(req_client, lookup_key, tp_size=len(self._workers)):
@@ -361,9 +358,8 @@ class ServerBenchClient:
361
358
  error="timeout",
362
359
  )
363
360
 
364
- hit_chunks = _poll_prefetch_status(req_client, lookup_key.request_id)
365
- if hit_chunks is None:
366
- hit_chunks = 0
361
+ hit_tokens = _poll_prefetch_status(req_client, lookup_key.request_id)
362
+ hit_chunks = 0 if hit_tokens is None else hit_tokens // self._chunk_size
367
363
  latency_ms = (time.monotonic() - started_at) * 1000
368
364
  self._log(
369
365
  " [seq %d/%s] LOOKUP: %d/%d chunks hit (%.1f ms)"
@@ -523,8 +519,13 @@ class ServerBenchClient:
523
519
  worker.spec.kv_worker_id: checksums[worker.spec.rank]
524
520
  for worker in workers
525
521
  }
522
+ # A reader's object is written by the first of its tp_replicas
523
+ # consecutive ranks.
526
524
  checksums = {
527
- worker.spec.rank: writer_checksums[worker.spec.kv_worker_id]
525
+ worker.spec.rank: writer_checksums[
526
+ worker.spec.kv_worker_id
527
+ - worker.spec.kv_worker_id % self._tp_replicas
528
+ ]
528
529
  for worker in self._workers
529
530
  if worker.spec.retrieve_enabled
530
531
  }
@@ -916,15 +917,19 @@ class ServerBenchClient:
916
917
  "--use-mla requires --kvcache-shape-spec with kv_size=1 "
917
918
  "(single-plane MLA group), got kv_size=%s" % kv_size_display
918
919
  )
919
- self._kv_world_size = 1 if use_mla else config.tp_size
920
+ # MLA replicates KV on every rank: the ranks share one object per
921
+ # chunk, keyed by rank 0, and the server counts them as its readers.
922
+ self._kv_world_size = config.tp_size
923
+ self._tp_replicas = config.tp_size if use_mla else 1
920
924
 
921
925
  for rank in range(config.tp_size):
922
926
  instance_id = _INSTANCE_ID_BASE + self._client_index * config.tp_size + rank
923
- kv_worker_id = 0 if use_mla else rank
927
+ kv_worker_id = rank
924
928
  buffers = KVCacheBuffers(
925
929
  groups=tensor_groups,
926
930
  device=None if use_gpu else "cpu",
927
931
  block_size=self._block_size,
932
+ tp_replicas=self._tp_replicas,
928
933
  )
929
934
  kv_caches = buffers.kv_caches
930
935
  self._log(
@@ -183,6 +183,12 @@ def run_server_bench(
183
183
  args: Parsed CLI arguments for ``lmcache bench server``.
184
184
  """
185
185
  config = parse_args_to_config(args)
186
+ # The IPC policy is process-wide and the CUDA event backend is cached on
187
+ # first resolution, so set it before any client starts.
188
+ # First Party
189
+ from lmcache.v1.platform.ipc_policy import set_isolated_ipc
190
+
191
+ set_isolated_ipc(config.isolated_ipc)
186
192
  stop = threading.Event()
187
193
  cases = _build_cases(config, args, stop)
188
194
 
@@ -266,6 +272,7 @@ def _emit_server_bench_metrics(
266
272
  cfg_section.add("num_tokens", "Tokens / request", args.num_tokens)
267
273
  cfg_section.add("interval", "Interval (s)", args.interval)
268
274
  cfg_section.add("concurrency", "Concurrency", getattr(args, "concurrency", 1))
275
+ cfg_section.add("isolated_ipc", "Isolated IPC", args.isolated_ipc)
269
276
 
270
277
  result_section = metrics.add_section("results", "Results")
271
278
  result_section.add("total_requests", "Total requests", result.completed_runs)
@@ -34,6 +34,7 @@ class BenchConfig:
34
34
  num_blocks: Fallback number of paged KV blocks.
35
35
  block_size: Fallback number of tokens per paged KV block.
36
36
  concurrency: Number of clients sending requests at the same time.
37
+ isolated_ipc: Whether clients use the isolated IPC policy.
37
38
  block_allocation: Allocate the lowest free IDs or sample free IDs randomly.
38
39
  transfer_timeout_s: Positive, finite shared wait budget per transfer call.
39
40
  """
@@ -49,6 +50,7 @@ class BenchConfig:
49
50
  num_blocks: int
50
51
  block_size: int
51
52
  concurrency: int = 1
53
+ isolated_ipc: bool = False
52
54
  block_allocation: Literal["sequential", "random"] = "sequential"
53
55
  transfer_timeout_s: float = 10.0
54
56
 
@@ -63,6 +65,8 @@ class BenchConfig:
63
65
  raise ValueError(f"unsupported transfer mode: {self.transfer_mode}")
64
66
  if self.tp_size < 1:
65
67
  raise ValueError(f"tp_size must be positive, got {self.tp_size}")
68
+ if self.isolated_ipc and self.mode != "gpu":
69
+ raise ValueError("--isolated-ipc only applies to --mode gpu")
66
70
  if self.concurrency < 1:
67
71
  raise ValueError(f"concurrency must be positive, got {self.concurrency}")
68
72
 
@@ -151,6 +155,7 @@ def parse_args_to_config(args: argparse.Namespace) -> BenchConfig:
151
155
  num_blocks=args.num_blocks,
152
156
  block_size=args.block_size,
153
157
  concurrency=int(getattr(args, "concurrency", 1)),
158
+ isolated_ipc=args.isolated_ipc,
154
159
  block_allocation=getattr(args, "block_allocation", "sequential"),
155
160
  transfer_timeout_s=float(getattr(args, "transfer_timeout", 10.0)),
156
161
  )
@@ -12,9 +12,9 @@ import urllib.error
12
12
  import urllib.request
13
13
 
14
14
  # First Party
15
- from lmcache.v1.multiprocess.custom_types import IPCCacheServerKey
16
- from lmcache.v1.multiprocess.futures import DeviceMessagingFuture, MessagingFuture
15
+ from lmcache.v1.common.custom_types import IPCCacheServerKey
17
16
  from lmcache.v1.multiprocess.transport.base import RequestClient
17
+ from lmcache.v1.transport.futures import DeviceMessagingFuture, MessagingFuture
18
18
 
19
19
  # ------------------------------------------------------------------ #
20
20
  # Constants #
@@ -92,13 +92,11 @@ def _make_key(
92
92
  end: int = 0,
93
93
  worker_id: int | None = None,
94
94
  world_size: int = _WORLD_SIZE,
95
- num_kv_readers: int = 1,
96
95
  ) -> IPCCacheServerKey:
97
96
  """Build an IPCCacheServerKey."""
98
97
  return IPCCacheServerKey.from_token_ids(
99
98
  model_name=_MODEL_NAME,
100
99
  world_size=world_size,
101
- num_kv_readers=num_kv_readers,
102
100
  worker_id=worker_id,
103
101
  token_ids=token_ids,
104
102
  start=start,
@@ -114,10 +112,9 @@ def _send_lookup(
114
112
  ) -> bool:
115
113
  """LOOKUP — submit a prefix lookup.
116
114
 
117
- The server reserves ``key.num_kv_readers`` read locks per chunk
118
- (each reader's RETRIEVE releases one; see
119
- ``IPCCacheServerKey.require_num_kv_readers``). ``tp_size`` is
120
- a legacy wire field the server ignores.
115
+ The server reserves one read lock per chunk per rank that shares the
116
+ object (``EngineGroupInfo.tp_replicas``); each reader's RETRIEVE
117
+ releases one. ``tp_size`` is a legacy wire field the server ignores.
121
118
 
122
119
  The server-side handler returns ``None`` (void) on success, so
123
120
  we only distinguish RPC timeout from a completed call.
@@ -134,7 +131,7 @@ def _poll_prefetch_status(
134
131
  ) -> int | None:
135
132
  """QUERY_PREFETCH_STATUS — poll until done.
136
133
 
137
- Returns the hit chunk count, or ``None`` if the polling budget
134
+ Returns the hit token count, or ``None`` if the polling budget
138
135
  is exhausted. The server keys prefetch jobs by ``request_id``
139
136
  (str), not an integer job handle.
140
137
  """
@@ -18,6 +18,7 @@ from __future__ import annotations
18
18
  from collections.abc import Callable
19
19
  from dataclasses import dataclass, field
20
20
  from typing import Any
21
+ from urllib.parse import quote
21
22
  import json
22
23
  import sys
23
24
  import urllib.error
@@ -25,6 +26,8 @@ import urllib.request
25
26
 
26
27
  # First Party
27
28
  from lmcache.cli.commands.describe import fmt_bytes
29
+ from lmcache.cli.commands.quota._helpers import escape_salt
30
+ from lmcache.cli.http import normalize_url as normalize_url
28
31
  from lmcache.cli.metrics import Metrics
29
32
  from lmcache.logging import init_logger
30
33
 
@@ -33,13 +36,6 @@ logger = init_logger(__name__)
33
36
  _TIMEOUT = 10
34
37
 
35
38
 
36
- def normalize_url(url: str) -> str:
37
- """Ensure *url* has a scheme and no trailing slash."""
38
- if not url.startswith(("http://", "https://")):
39
- url = f"http://{url}"
40
- return url.rstrip("/")
41
-
42
-
43
39
  def _fetch(url: str, timeout: int = _TIMEOUT) -> str:
44
40
  """GET *url* and return the body as text.
45
41
 
@@ -317,7 +313,9 @@ APIS: dict[str, CoordinatorApi] = {
317
313
  "quota": CoordinatorApi(
318
314
  summary="per-salt usage against quota",
319
315
  path=lambda a: (
320
- f"/quota/{a.cache_salt}" if a.cache_salt is not None else "/quota"
316
+ f"/quota/{quote(escape_salt(a.cache_salt), safe='')}"
317
+ if a.cache_salt is not None
318
+ else "/quota"
321
319
  ),
322
320
  render=_render_quota,
323
321
  ),