lmcache-cli 0.5.9.dev0__py3-none-any.whl → 0.5.9rc2.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.
- lmcache/__init__.py +1 -1
- lmcache/_version.py +3 -3
- lmcache/cli/commands/__init__.py +1 -1
- lmcache/cli/commands/base.py +2 -2
- lmcache/cli/commands/bench/engine_bench/command.py +1 -1
- lmcache/cli/commands/bench/engine_bench/config.py +1 -1
- lmcache/cli/commands/bench/engine_bench/quality/alignment.py +1 -1
- lmcache/cli/commands/bench/engine_bench/quality/dataset.py +1 -1
- lmcache/cli/commands/bench/engine_bench/quality/scoring.py +1 -1
- lmcache/cli/commands/bench/engine_bench/request_sender.py +1 -1
- lmcache/cli/commands/bench/engine_bench/stats.py +1 -1
- lmcache/cli/commands/bench/engine_bench/tokenizers.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/__init__.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/base.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/kv_tier_pressure.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/long_doc_permutator.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/long_doc_qa.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/multi_round_chat.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/prefix_suffix_tuner.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/rag_qa_quality.py +1 -1
- lmcache/cli/commands/bench/engine_bench/workloads/random_prefill.py +1 -1
- lmcache/cli/commands/bench/l2_adapter_bench/runner.py +9 -6
- lmcache/cli/commands/bench/quality_bench/core/analyze_stage.py +1 -1
- lmcache/cli/commands/bench/quality_bench/core/blend_counters.py +1 -1
- lmcache/cli/commands/bench/quality_bench/core/judge.py +1 -1
- lmcache/cli/commands/bench/quality_bench/core/report.py +1 -1
- lmcache/cli/commands/bench/quality_bench/core/run_files.py +2 -2
- lmcache/cli/commands/bench/quality_bench/core/run_stage.py +1 -1
- lmcache/cli/commands/bench/quality_bench/core/runner.py +1 -1
- lmcache/cli/commands/bench/server_bench/arguments.py +3 -3
- lmcache/cli/commands/bench/server_bench/buffers.py +1 -1
- lmcache/cli/commands/bench/server_bench/client.py +4 -3
- lmcache/cli/commands/bench/server_bench/command.py +3 -3
- lmcache/cli/commands/coordinator.py +55 -2
- lmcache/cli/commands/kvcache.py +1 -1
- lmcache/cli/commands/memory.py +1 -1
- lmcache/cli/commands/query/_coordinator.py +1 -1
- lmcache/cli/commands/query/coordinator_command.py +1 -1
- lmcache/cli/commands/quota/_helpers.py +1 -1
- lmcache/cli/commands/server.py +1 -1
- lmcache/cli/commands/trace/_dispatch.py +1 -1
- lmcache/cli/commands/trace/_driver.py +1 -1
- lmcache/cli/commands/trace/_stats.py +1 -1
- lmcache/cli/commands/trace/replay_command.py +1 -1
- lmcache/cli/commands/trace/replay_events_command.py +1 -1
- lmcache/cli/main.py +2 -2
- lmcache/integration/atom/__init__.py +4 -0
- lmcache/integration/atom/multi_process_adapter.py +173 -11
- lmcache/integration/request_telemetry/fastapi.py +1 -1
- lmcache/integration/sglang/unified_lmcache_mp_connector.py +2 -2
- lmcache/integration/tensorrt_llm/__init__.py +9 -56
- lmcache/integration/tensorrt_llm/tensorrt_mp_adapter.py +5 -4
- lmcache/integration/vllm/experimental/__init__.py +10 -1
- lmcache/integration/vllm/experimental/dispatcher.py +22 -9
- lmcache/integration/vllm/experimental/q_metadata.py +142 -0
- lmcache/{sdk → integration/vllm/experimental}/qringbuffer.py +288 -92
- lmcache/integration/vllm/kv_cache_group_edits.py +7 -6
- lmcache/integration/vllm/kv_cache_groups.py +81 -8
- lmcache/integration/vllm/lazy_offload_manager.py +1 -1
- lmcache/integration/vllm/lazy_offload_policy/__init__.py +1 -1
- lmcache/integration/vllm/lazy_offload_policy/eviction_aware.py +1 -1
- lmcache/integration/vllm/lazy_offload_policy/fifo.py +1 -1
- lmcache/integration/vllm/lmcache_mp_connector.py +61 -24
- lmcache/integration/vllm/lmcache_mp_metadata.py +7 -0
- lmcache/integration/vllm/mp_lookup_state.py +1 -1
- lmcache/integration/vllm/mp_server_launcher.py +49 -22
- lmcache/integration/vllm/utils.py +6 -2
- lmcache/integration/vllm/vllm_multi_process_adapter.py +116 -29
- lmcache/lmcache_frontend/app.py +3 -3
- lmcache/sdk/__init__.py +1 -1
- lmcache/sdk/context.py +122 -22
- lmcache/sdk/kvcache.py +1 -1
- lmcache/sdk/qcache.py +1 -1
- lmcache/sdk/request.py +176 -19
- lmcache/sdk/wrapper/ring_mapping.py +4 -3
- lmcache/sdk/wrapper/ring_transfer.py +5 -3
- lmcache/security/__init__.py +4 -1
- lmcache/security/http.py +2 -2
- lmcache/tools/transfer_channel_benchmark/benchmark.py +1 -1
- lmcache/usage_telemetry/base.py +1 -1
- lmcache/usage_telemetry/flush.py +3 -3
- lmcache/usage_telemetry/guard.py +1 -1
- lmcache/usage_telemetry/identity.py +1 -1
- lmcache/usage_telemetry/l1_usage.py +1 -1
- lmcache/usage_telemetry/l2_usage.py +1 -1
- lmcache/usage_telemetry/mp.py +1 -1
- lmcache/usage_telemetry/mp_continuous.py +1 -1
- lmcache/usage_telemetry/transport.py +1 -1
- lmcache/utils.py +2 -620
- lmcache/v1/client/async_engine_driven.py +1 -1
- lmcache/v1/client/chunk_hashes.py +117 -0
- lmcache/v1/client/heartbeat.py +6 -2
- lmcache/v1/client/kv_event_subscriber.py +1 -1
- lmcache/v1/client/transfer_context/__init__.py +1 -4
- lmcache/v1/client/transfer_context/base.py +10 -31
- lmcache/v1/client/transfer_context/inline.py +131 -34
- lmcache/v1/client/transfer_context/shm.py +9 -58
- lmcache/v1/client/transport/factory.py +25 -6
- lmcache/v1/client/transport/grpc_impl/client.py +6 -5
- lmcache/v1/client/transport/zmq_impl/mq_client.py +4 -5
- lmcache/v1/client/transport/zmq_impl/polling_loop.py +1 -1
- lmcache/v1/client/worker_transfer.py +30 -10
- lmcache/v1/common/buffer_registration.py +38 -0
- lmcache/{sdk → v1/common}/cache_kind.py +42 -0
- lmcache/v1/common/custom_types.py +149 -10
- lmcache/v1/common/errors.py +12 -0
- lmcache/v1/common/kv_format/contiguity.py +1 -1
- lmcache/v1/common/kv_format/detection.py +2 -2
- lmcache/v1/common/kv_format/detectors/atom.py +1 -1
- lmcache/v1/common/kv_format/detectors/base.py +1 -1
- lmcache/v1/common/kv_format/detectors/registry.py +1 -1
- lmcache/v1/common/kv_format/detectors/sglang.py +1 -1
- lmcache/v1/common/kv_format/detectors/trtllm.py +1 -1
- lmcache/v1/common/kv_format/detectors/vllm.py +6 -13
- lmcache/v1/common/kv_format/specs/nl_x_nb_bs_nh_two_hs.py +1 -1
- lmcache/v1/common/kv_format/specs/nl_x_nb_nh_bs_two_hs.py +1 -1
- lmcache/v1/{kv_layer_groups.py → common/kv_layer_groups.py} +3 -5
- lmcache/{logging.py → v1/common/logging.py} +43 -0
- lmcache/v1/common/memory_management.py +509 -0
- lmcache/v1/common/metrics/metrics.py +1 -1
- lmcache/v1/{platform → common}/ops_types.py +2 -2
- lmcache/v1/{periodic_thread.py → common/periodic_thread.py} +2 -2
- lmcache/v1/common/security/__init__.py +1 -0
- lmcache/v1/{utils → common}/subclass_discovery.py +1 -1
- lmcache/v1/common/token_hasher.py +30 -2
- lmcache/v1/common/transfer_context.py +89 -0
- lmcache/v1/common/utils.py +122 -6
- lmcache/v1/distributed/api.py +47 -5
- lmcache/v1/distributed/config.py +7 -5
- lmcache/v1/distributed/internal_api.py +8 -0
- lmcache/v1/distributed/l1_manager/base.py +50 -1
- lmcache/v1/distributed/l1_manager/devdax.py +1 -1
- lmcache/v1/distributed/l1_manager/gds.py +1 -1
- lmcache/v1/distributed/l2_adapters/aerospike_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/base.py +1 -1
- lmcache/v1/distributed/l2_adapters/bigtable_key_encoder.py +3 -4
- lmcache/v1/distributed/l2_adapters/bigtable_l2_adapter.py +2 -2
- lmcache/v1/distributed/l2_adapters/config.py +1 -1
- lmcache/v1/distributed/l2_adapters/dax/core.py +52 -43
- lmcache/v1/distributed/l2_adapters/dax_l2_adapter.py +39 -11
- lmcache/v1/distributed/l2_adapters/factory.py +1 -1
- lmcache/v1/distributed/l2_adapters/fault_inject_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/fs_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/fs_native_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/hf3fs_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/hfbucket_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/mock_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/mooncake_store_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/native_connector_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/native_plugin_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/nixl_native_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/nixl_store_agents/file_dynamic_nixl_store_agent.py +1 -1
- lmcache/v1/distributed/l2_adapters/nixl_store_dynamic_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/nixl_store_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/p2p_l2_adapter.py +195 -58
- lmcache/v1/distributed/l2_adapters/raw_block/core.py +201 -50
- lmcache/v1/distributed/l2_adapters/raw_block/io_engine.py +40 -2
- lmcache/v1/distributed/l2_adapters/raw_block_l2_adapter.py +19 -2
- lmcache/v1/distributed/l2_adapters/resp_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/s3_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/sagemaker_hyperpod_client.py +1 -1
- lmcache/v1/distributed/l2_adapters/sagemaker_hyperpod_l2_adapter.py +1 -1
- lmcache/v1/distributed/l2_adapters/serde_wrapper.py +1 -1
- lmcache/v1/distributed/l2_adapters/valkey/blob_tcp_worker_pool.py +1 -1
- lmcache/v1/distributed/l2_adapters/valkey/rdma_worker_pool.py +1 -1
- lmcache/v1/distributed/l2_adapters/valkey/worker_pool.py +1 -1
- lmcache/v1/distributed/l2_adapters/valkey_l2_adapter.py +1 -1
- lmcache/v1/distributed/memory_manager/devdax_l1_memory_manager.py +1 -1
- lmcache/v1/distributed/memory_manager/gds_l1_memory_manager.py +2 -2
- lmcache/v1/distributed/memory_manager/l1_memory_manager.py +1 -1
- lmcache/v1/distributed/memory_manager/shared_devdax_region.py +2 -1
- lmcache/v1/distributed/p2p.py +3 -3
- lmcache/v1/distributed/serde/aesgcm.py +1 -1
- lmcache/v1/distributed/serde/async_processor.py +1 -1
- lmcache/v1/distributed/serde/factory.py +1 -1
- lmcache/v1/distributed/storage_controllers/eviction_controller.py +1 -1
- lmcache/v1/distributed/storage_controllers/prefetch_controller.py +52 -21
- lmcache/v1/distributed/storage_controllers/prefetch_policy.py +1 -1
- lmcache/v1/distributed/storage_controllers/store_controller.py +1 -1
- lmcache/v1/distributed/storage_manager.py +34 -19
- lmcache/v1/distributed/transfer_channel/factory.py +1 -1
- lmcache/v1/distributed/transfer_channel/impl/mooncake_te_impl.py +1 -1
- lmcache/v1/distributed/transfer_channel/impl/nixl_impl.py +1 -1
- lmcache/v1/distributed/utils.py +457 -0
- lmcache/v1/gpu_connector/gds_backends/phx.py +1 -1
- lmcache/v1/gpu_connector/gds_backends/ugds.py +1 -1
- lmcache/v1/gpu_connector/gds_context.py +12 -1
- lmcache/v1/gpu_connector/gpu_ops.py +1 -1
- lmcache/v1/memory_allocators/ad_hoc_memory_allocator.py +1 -1
- lmcache/v1/memory_allocators/buffer_allocator.py +1 -1
- lmcache/v1/memory_allocators/devdax_memory_allocator.py +2 -6
- lmcache/v1/memory_allocators/gpu_memory_allocator.py +1 -1
- lmcache/v1/memory_allocators/lazy_memory_allocator.py +1 -1
- lmcache/v1/memory_allocators/mixed_memory_allocator.py +1 -1
- lmcache/v1/memory_allocators/paged_tensor_memory_allocator.py +1 -1
- lmcache/v1/memory_allocators/pin_memory_allocator.py +1 -1
- lmcache/v1/memory_allocators/tensor_memory_allocator.py +1 -1
- lmcache/v1/memory_management.py +9 -500
- lmcache/v1/memory_orchestrator/__init__.py +1 -1
- lmcache/v1/memory_orchestrator/client.py +1 -1
- lmcache/v1/memory_orchestrator/pooling.py +354 -0
- lmcache/v1/memory_orchestrator/server.py +1 -1
- lmcache/v1/memory_orchestrator/service.py +1 -1
- lmcache/v1/memory_orchestrator/state.py +1 -1
- lmcache/v1/mp_coordinator/app.py +7 -2
- lmcache/v1/mp_coordinator/background_loops.py +1 -1
- lmcache/v1/mp_coordinator/blend_client.py +1 -1
- lmcache/v1/mp_coordinator/blend_index.py +1 -1
- lmcache/v1/mp_coordinator/cache_events.py +1 -1
- lmcache/v1/mp_coordinator/config.py +17 -1
- lmcache/v1/mp_coordinator/controllers/__init__.py +1 -1
- lmcache/v1/mp_coordinator/controllers/eviction_controller.py +39 -22
- lmcache/v1/mp_coordinator/controllers/eviction_http_api.py +53 -42
- lmcache/v1/mp_coordinator/controllers/prefetch_manager.py +7 -22
- lmcache/v1/mp_coordinator/events_replay.py +1 -1
- lmcache/v1/mp_coordinator/http_apis/cache_api.py +28 -8
- lmcache/v1/mp_coordinator/http_apis/instances_api.py +1 -1
- lmcache/v1/mp_coordinator/http_auth.py +26 -12
- lmcache/v1/mp_coordinator/ingest/event_broadcaster.py +1 -1
- lmcache/v1/mp_coordinator/ingest/event_gate.py +1 -1
- lmcache/v1/mp_coordinator/ingest/kafka_event_source.py +1 -1
- lmcache/v1/mp_coordinator/persistence/checkpoint.py +1 -1
- lmcache/v1/mp_coordinator/persistence/metadata.py +1 -1
- lmcache/v1/mp_coordinator/persistence/store.py +1 -1
- lmcache/v1/mp_coordinator/registrar.py +3 -3
- lmcache/v1/mp_coordinator/schemas.py +144 -101
- lmcache/v1/mp_coordinator/views/__init__.py +1 -1
- lmcache/v1/mp_coordinator/views/instance_registry.py +2 -2
- lmcache/v1/mp_coordinator/views/key_directory.py +55 -1
- lmcache/v1/mp_coordinator/views/server_config.py +1 -1
- lmcache/v1/mp_coordinator/views/usage_manager.py +1 -1
- lmcache/v1/mp_observability/README.md +2 -2
- lmcache/v1/mp_observability/errors.py +1 -1
- lmcache/v1/mp_observability/event_bus.py +1 -1
- lmcache/v1/mp_observability/gc_monitor.py +1 -1
- lmcache/v1/mp_observability/otel_init.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/cb_server.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/extra_stats.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/l1.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/l2.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/lookup_hash.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/mp_server.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/sm.py +1 -1
- lmcache/v1/mp_observability/subscribers/logging/timeout.py +1 -1
- lmcache/v1/mp_observability/subscribers/metrics/cb_server.py +1 -1
- lmcache/v1/mp_observability/subscribers/metrics/lookup.py +9 -7
- lmcache/v1/mp_observability/subscribers/metrics/phase_timing.py +1 -1
- lmcache/v1/mp_observability/subscribers/tracing/cb_server.py +1 -1
- lmcache/v1/mp_observability/subscribers/tracing/mp_server.py +1 -1
- lmcache/v1/mp_observability/subscribers/tracing/span_registry.py +1 -1
- lmcache/v1/mp_observability/subscribers/tracing/timeout.py +1 -1
- lmcache/v1/mp_observability/subscribers/tracing/transfer_phase.py +2 -2
- lmcache/v1/mp_observability/trace/lifecycle.py +1 -1
- lmcache/v1/mp_observability/trace/reader.py +1 -1
- lmcache/v1/mp_observability/trace/recorder.py +1 -1
- lmcache/v1/multiprocess/affinity_pool.py +1 -40
- lmcache/v1/multiprocess/cache_control/key_resolver.py +163 -21
- lmcache/v1/multiprocess/cache_control/prefetch_service.py +116 -30
- lmcache/v1/multiprocess/config.py +7 -23
- lmcache/v1/multiprocess/engine_context.py +83 -7
- lmcache/v1/multiprocess/engine_module.py +1 -1
- lmcache/v1/multiprocess/ext_server_module.py +13 -2
- lmcache/v1/multiprocess/http_api_registry.py +1 -1
- lmcache/v1/multiprocess/http_apis/cache_api.py +15 -6
- lmcache/v1/multiprocess/http_apis/common/periodic_thread_api.py +1 -1
- lmcache/v1/multiprocess/http_apis/common/run_script_api.py +1 -1
- lmcache/v1/multiprocess/http_apis/info_api.py +1 -1
- lmcache/v1/multiprocess/http_apis/l1_reconfigure_api.py +1 -1
- lmcache/v1/multiprocess/http_apis/schemas.py +31 -6
- lmcache/v1/multiprocess/http_auth.py +3 -3
- lmcache/v1/multiprocess/http_reconfigure.py +66 -0
- lmcache/v1/multiprocess/http_server.py +3 -1
- lmcache/v1/multiprocess/kv_load_policy.py +1 -1
- lmcache/v1/multiprocess/modules/blend/lookup.py +16 -3
- lmcache/v1/multiprocess/modules/blend/matcher.py +1 -1
- lmcache/v1/multiprocess/modules/blend/module.py +1 -1
- lmcache/v1/multiprocess/modules/blend/read_set.py +25 -0
- lmcache/v1/multiprocess/modules/blend/registration.py +1 -1
- lmcache/v1/multiprocess/modules/blend/retrieve.py +27 -6
- lmcache/v1/multiprocess/modules/blend/store.py +26 -7
- lmcache/v1/multiprocess/modules/engine_driven_transfer.py +244 -60
- lmcache/v1/multiprocess/modules/lmcache_driven_transfer.py +170 -113
- lmcache/v1/multiprocess/modules/lookup.py +133 -28
- lmcache/v1/multiprocess/modules/management.py +7 -7
- lmcache/v1/multiprocess/modules/p2p_controller.py +7 -7
- lmcache/v1/multiprocess/modules/server_transfer.py +76 -33
- lmcache/v1/multiprocess/mp_runtime_plugin_launcher.py +1 -1
- lmcache/v1/multiprocess/native_completion.py +2 -2
- lmcache/v1/multiprocess/object_group_transfer/direct_copy.py +1 -1
- lmcache/v1/multiprocess/object_group_transfer/staged.py +1 -1
- lmcache/v1/multiprocess/plugin_modules/qstore.py +59 -29
- lmcache/v1/multiprocess/server.py +12 -1
- lmcache/v1/multiprocess/session.py +37 -6
- lmcache/v1/multiprocess/transport/grpc_impl/aio_server.py +6 -2
- lmcache/v1/multiprocess/transport/grpc_impl/auth.py +2 -2
- lmcache/v1/multiprocess/transport/grpc_impl/native_server.py +7 -6
- lmcache/v1/multiprocess/transport/grpc_impl/server.py +6 -2
- lmcache/v1/multiprocess/transport/grpc_impl/server_base.py +2 -2
- lmcache/v1/multiprocess/transport/grpc_impl/server_builder.py +1 -1
- lmcache/v1/multiprocess/transport/zmq_impl/mq.py +44 -23
- lmcache/v1/multiprocess/warm_prefetch.py +1 -1
- lmcache/v1/platform/__init__.py +1 -1
- lmcache/v1/platform/_device_detect.py +2 -2
- lmcache/v1/platform/base/cache_context.py +32 -16
- lmcache/v1/platform/base/device_ops.py +4 -11
- lmcache/v1/platform/base/ipc_wire.py +21 -0
- lmcache/v1/platform/base/object_group_transfer.py +68 -0
- lmcache/v1/platform/cache_context.py +25 -3
- lmcache/v1/platform/devices/cpu/cache_context.py +12 -3
- lmcache/v1/platform/devices/cpu/shm.py +1 -1
- lmcache/v1/platform/devices/cpu/stub_cpu_device.py +1 -1
- lmcache/v1/platform/devices/cuda/cache_context.py +36 -16
- lmcache/v1/platform/devices/cuda/device_ops.py +1 -1
- lmcache/v1/platform/devices/cuda/ipc_wrapper.py +1 -1
- lmcache/v1/platform/devices/cuda/pin_memory.py +1 -1
- lmcache/v1/platform/devices/cuda/timeline_semaphore_event_ipc.py +1 -1
- lmcache/v1/platform/devices/gcu/__init__.py +124 -0
- lmcache/v1/platform/devices/gcu/cache_context.py +542 -0
- lmcache/v1/platform/devices/gcu/device_ops.py +427 -0
- lmcache/v1/platform/devices/gcu/event_ipc.py +61 -0
- lmcache/v1/platform/devices/gcu/ipc_wrapper.py +212 -0
- lmcache/v1/platform/devices/gcu/pin_memory.py +167 -0
- lmcache/v1/platform/devices/mlu/__init__.py +1 -1
- lmcache/v1/platform/devices/mlu/device_ops.py +1 -1
- lmcache/v1/platform/devices/musa/cache_context.py +32 -19
- lmcache/v1/platform/devices/musa/device_ops.py +2 -2
- lmcache/v1/platform/devices/musa/pin_memory.py +1 -1
- lmcache/v1/platform/devices/neuron/__init__.py +1 -1
- lmcache/v1/platform/devices/neuron/device_ops.py +1 -1
- lmcache/v1/platform/devices/npu/cache_context.py +11 -3
- lmcache/v1/platform/devices/npu/event_ipc.py +1 -1
- lmcache/v1/platform/devices/npu/pin_memory.py +2 -2
- lmcache/v1/platform/devices/rbln/device_ops.py +2 -2
- lmcache/v1/platform/devices/rocm/pin_memory.py +1 -1
- lmcache/v1/platform/devices/xpu/__init__.py +1 -1
- lmcache/v1/platform/devices/xpu/device_ops.py +1 -1
- lmcache/v1/platform/devices/xpu/pin_memory.py +1 -1
- lmcache/v1/platform/fd_channel.py +1 -1
- lmcache/v1/platform/kv_wrap.py +1 -1
- lmcache/v1/platform/native_block_transfer.py +2 -2
- lmcache/v1/platform/torch_ops/mem_alloc.py +1 -1
- lmcache/v1/platform/torch_ops/mem_kernels.py +0 -100
- lmcache/v1/platform/torch_ops/mp_mem_kernels.py +1 -1
- lmcache/v1/plugin/runtime_plugin_launcher.py +1 -1
- lmcache/v1/rpc_utils.py +1 -1
- lmcache/v1/transport/auth.py +2 -2
- lmcache/v1/{client/transport → transport}/errors.py +5 -1
- lmcache/v1/transport/futures.py +1 -2
- lmcache/v1/transport/grpc/_proto_gen/common_pb2.pyi +12 -2
- lmcache/v1/{client/transport/grpc_impl → transport/grpc}/auth.py +1 -1
- lmcache/v1/transport/grpc/protos/common.proto +8 -0
- lmcache/v1/transport/grpc/protos/engine_driven_service.proto +10 -2
- lmcache/v1/transport/grpc/protos/lmcache_driven_service.proto +5 -1
- lmcache/v1/transport/grpc/protos/qstore_service.proto +15 -1
- lmcache/v1/transport/grpc/utils.py +1 -1
- lmcache/v1/transport/request_client.py +32 -5
- lmcache/v1/transport/zmq/__init__.py +4 -0
- lmcache/v1/utils/bloom_filter.py +1 -1
- lmcache/v1/utils/router_discovery.py +1 -1
- {lmcache_cli-0.5.9.dev0.dist-info → lmcache_cli-0.5.9rc2.dev0.dist-info}/METADATA +1 -1
- {lmcache_cli-0.5.9.dev0.dist-info → lmcache_cli-0.5.9rc2.dev0.dist-info}/RECORD +369 -357
- lmcache/integration/tensorrt_llm/tensorrt_adapter.py +0 -17
- lmcache/v1/exceptions/__init__.py +0 -16
- lmcache/v1/memory_allocators/host_memory_allocator.py +0 -135
- lmcache/v1/multiprocess/rocm_host_event_wait.py +0 -386
- /lmcache/{banner.py → v1/common/banner.py} +0 -0
- /lmcache/{security → v1/common/security}/api_key.py +0 -0
- /lmcache/{security → v1/common/security}/bearer.py +0 -0
- /lmcache/v1/{client/transfer_context → transport}/tensor_wire.py +0 -0
- {lmcache_cli-0.5.9.dev0.dist-info → lmcache_cli-0.5.9rc2.dev0.dist-info}/WHEEL +0 -0
- {lmcache_cli-0.5.9.dev0.dist-info → lmcache_cli-0.5.9rc2.dev0.dist-info}/entry_points.txt +0 -0
- {lmcache_cli-0.5.9.dev0.dist-info → lmcache_cli-0.5.9rc2.dev0.dist-info}/licenses/LICENSE +0 -0
- {lmcache_cli-0.5.9.dev0.dist-info → lmcache_cli-0.5.9rc2.dev0.dist-info}/top_level.txt +0 -0
lmcache/__init__.py
CHANGED
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.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 5, 9, 'dev0')
|
|
21
|
+
__version__ = version = '0.5.9rc2.dev0'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 5, 9, 'rc2', 'dev0')
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g51428bcc2'
|
lmcache/cli/commands/__init__.py
CHANGED
|
@@ -18,7 +18,7 @@ import argparse
|
|
|
18
18
|
|
|
19
19
|
# First Party
|
|
20
20
|
from lmcache.cli.commands.base import BaseCommand, CompositeCommand
|
|
21
|
-
from lmcache.v1.
|
|
21
|
+
from lmcache.v1.common.subclass_discovery import discover_subclasses
|
|
22
22
|
|
|
23
23
|
ALL_COMMANDS: list[BaseCommand]
|
|
24
24
|
|
lmcache/cli/commands/base.py
CHANGED
|
@@ -11,7 +11,7 @@ import argparse
|
|
|
11
11
|
import sys
|
|
12
12
|
|
|
13
13
|
# First Party
|
|
14
|
-
from lmcache.logging import init_logger
|
|
14
|
+
from lmcache.v1.common.logging import init_logger
|
|
15
15
|
from lmcache.v1.common.metrics import (
|
|
16
16
|
FileHandler,
|
|
17
17
|
Metrics,
|
|
@@ -305,7 +305,7 @@ class CompositeCommand(BaseCommand):
|
|
|
305
305
|
"""
|
|
306
306
|
# Deferred import to avoid circular dependency
|
|
307
307
|
# First Party
|
|
308
|
-
from lmcache.v1.
|
|
308
|
+
from lmcache.v1.common.subclass_discovery import discover_subclasses
|
|
309
309
|
|
|
310
310
|
package = self.__class__.__module__
|
|
311
311
|
|
|
@@ -43,7 +43,7 @@ from lmcache.cli.commands.bench.engine_bench.workloads import (
|
|
|
43
43
|
validate_max_output_length_supported,
|
|
44
44
|
)
|
|
45
45
|
from lmcache.cli.commands.bench.engine_bench.workloads.base import BaseWorkload
|
|
46
|
-
from lmcache.logging import init_logger
|
|
46
|
+
from lmcache.v1.common.logging import init_logger
|
|
47
47
|
|
|
48
48
|
if TYPE_CHECKING:
|
|
49
49
|
# First Party
|
|
@@ -17,7 +17,7 @@ except ModuleNotFoundError as exc:
|
|
|
17
17
|
|
|
18
18
|
# First Party
|
|
19
19
|
from lmcache.cli.commands.bench.engine_bench.stats import RequestResult
|
|
20
|
-
from lmcache.logging import init_logger
|
|
20
|
+
from lmcache.v1.common.logging import init_logger
|
|
21
21
|
|
|
22
22
|
logger = init_logger(__name__)
|
|
23
23
|
|
|
@@ -53,7 +53,7 @@ from lmcache.cli.commands.bench.engine_bench.workloads.random_prefill import (
|
|
|
53
53
|
RandomPrefillConfig,
|
|
54
54
|
RandomPrefillWorkload,
|
|
55
55
|
)
|
|
56
|
-
from lmcache.logging import init_logger
|
|
56
|
+
from lmcache.v1.common.logging import init_logger
|
|
57
57
|
|
|
58
58
|
__all__ = [
|
|
59
59
|
"DEFAULT_DOC_ALIGN_TOKENS",
|
|
@@ -13,7 +13,7 @@ from lmcache.cli.commands.bench.engine_bench.config import WarmupPolicy
|
|
|
13
13
|
from lmcache.cli.commands.bench.engine_bench.progress import ProgressMonitor
|
|
14
14
|
from lmcache.cli.commands.bench.engine_bench.request_sender import RequestSender
|
|
15
15
|
from lmcache.cli.commands.bench.engine_bench.stats import StatsCollector
|
|
16
|
-
from lmcache.logging import init_logger
|
|
16
|
+
from lmcache.v1.common.logging import init_logger
|
|
17
17
|
|
|
18
18
|
logger = init_logger(__name__)
|
|
19
19
|
|
|
@@ -112,7 +112,7 @@ from lmcache.cli.commands.bench.engine_bench.workloads.base import (
|
|
|
112
112
|
BaseWorkload,
|
|
113
113
|
MetricSection,
|
|
114
114
|
)
|
|
115
|
-
from lmcache.logging import init_logger
|
|
115
|
+
from lmcache.v1.common.logging import init_logger
|
|
116
116
|
|
|
117
117
|
logger = init_logger(__name__)
|
|
118
118
|
|
|
@@ -43,7 +43,7 @@ from lmcache.cli.commands.bench.engine_bench.tokenizers import (
|
|
|
43
43
|
try_load_tokenizer,
|
|
44
44
|
)
|
|
45
45
|
from lmcache.cli.commands.bench.engine_bench.workloads.base import BaseWorkload
|
|
46
|
-
from lmcache.logging import init_logger
|
|
46
|
+
from lmcache.v1.common.logging import init_logger
|
|
47
47
|
|
|
48
48
|
logger = init_logger(__name__)
|
|
49
49
|
|
|
@@ -13,7 +13,7 @@ from lmcache.cli.commands.bench.engine_bench.request_sender import (
|
|
|
13
13
|
)
|
|
14
14
|
from lmcache.cli.commands.bench.engine_bench.stats import StatsCollector
|
|
15
15
|
from lmcache.cli.commands.bench.engine_bench.workloads.base import BaseWorkload
|
|
16
|
-
from lmcache.logging import init_logger
|
|
16
|
+
from lmcache.v1.common.logging import init_logger
|
|
17
17
|
|
|
18
18
|
logger = init_logger(__name__)
|
|
19
19
|
|
|
@@ -12,7 +12,7 @@ from lmcache.cli.commands.bench.engine_bench.request_sender import (
|
|
|
12
12
|
)
|
|
13
13
|
from lmcache.cli.commands.bench.engine_bench.stats import StatsCollector
|
|
14
14
|
from lmcache.cli.commands.bench.engine_bench.workloads.base import BaseWorkload
|
|
15
|
-
from lmcache.logging import init_logger
|
|
15
|
+
from lmcache.v1.common.logging import init_logger
|
|
16
16
|
|
|
17
17
|
logger = init_logger(__name__)
|
|
18
18
|
|
|
@@ -135,7 +135,7 @@ from lmcache.cli.commands.bench.engine_bench.request_sender import RequestSender
|
|
|
135
135
|
from lmcache.cli.commands.bench.engine_bench.stats import StatsCollector
|
|
136
136
|
from lmcache.cli.commands.bench.engine_bench.tokenizers import try_load_tokenizer
|
|
137
137
|
from lmcache.cli.commands.bench.engine_bench.workloads.base import BaseWorkload
|
|
138
|
-
from lmcache.logging import init_logger
|
|
138
|
+
from lmcache.v1.common.logging import init_logger
|
|
139
139
|
|
|
140
140
|
logger = init_logger(__name__)
|
|
141
141
|
|
|
@@ -12,7 +12,7 @@ from lmcache.cli.commands.bench.engine_bench.request_sender import (
|
|
|
12
12
|
)
|
|
13
13
|
from lmcache.cli.commands.bench.engine_bench.stats import StatsCollector
|
|
14
14
|
from lmcache.cli.commands.bench.engine_bench.workloads.base import BaseWorkload
|
|
15
|
-
from lmcache.logging import init_logger
|
|
15
|
+
from lmcache.v1.common.logging import init_logger
|
|
16
16
|
|
|
17
17
|
logger = init_logger(__name__)
|
|
18
18
|
|
|
@@ -22,6 +22,7 @@ import time
|
|
|
22
22
|
from lmcache.lmcache_native import Bitmap
|
|
23
23
|
from lmcache.v1.distributed.api import MemoryLayoutDesc, ObjectKey
|
|
24
24
|
from lmcache.v1.distributed.internal_api import L2StoreResult
|
|
25
|
+
from lmcache.v1.distributed.l2_adapters.base import L2AdapterInterface
|
|
25
26
|
from lmcache.v1.memory_management import MemoryObj
|
|
26
27
|
|
|
27
28
|
# Local
|
|
@@ -50,26 +51,28 @@ def _bitmap_count(bitmap: Bitmap | None) -> int:
|
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
def _wait_store_finished(
|
|
53
|
-
adapter, task_ids: list[int], timeout: float
|
|
54
|
+
adapter: L2AdapterInterface, task_ids: list[int], timeout: float
|
|
54
55
|
) -> dict[int, L2StoreResult]:
|
|
55
56
|
"""Wait for all store tasks to finish.
|
|
56
57
|
|
|
57
58
|
Returns the accumulated ``{task_id: L2StoreResult}`` dict.
|
|
58
59
|
``pop_completed_store_tasks`` consumes the adapter's completion
|
|
59
60
|
dict, so we must accumulate the results here for the caller to
|
|
60
|
-
use.
|
|
61
|
+
use. Only the requested task IDs count: earlier timed-out rounds may
|
|
62
|
+
still complete. On timeout, returns whatever was harvested so far (possibly
|
|
61
63
|
empty or partial); the caller can detect timeout by comparing
|
|
62
64
|
``len(returned_dict)`` against ``len(task_ids)``.
|
|
63
65
|
"""
|
|
64
|
-
|
|
66
|
+
pending = set(task_ids)
|
|
65
67
|
efd = adapter.get_store_event_fd()
|
|
66
68
|
completed: dict[int, L2StoreResult] = {}
|
|
67
|
-
while
|
|
69
|
+
while pending:
|
|
68
70
|
if not wait_eventfd(efd, timeout=timeout):
|
|
69
71
|
return completed
|
|
70
72
|
batch = adapter.pop_completed_store_tasks()
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
for task_id in pending.intersection(batch):
|
|
74
|
+
completed[task_id] = batch[task_id]
|
|
75
|
+
pending.remove(task_id)
|
|
73
76
|
return completed
|
|
74
77
|
|
|
75
78
|
|
|
@@ -30,7 +30,7 @@ from lmcache.cli.commands.bench.quality_bench.core.config import JudgeSettings
|
|
|
30
30
|
from lmcache.cli.commands.bench.quality_bench.core.plan import QualityPlan
|
|
31
31
|
from lmcache.cli.commands.bench.quality_bench.core.runner import ArmRun
|
|
32
32
|
from lmcache.cli.commands.bench.quality_bench.core.verdict import ScoreTable
|
|
33
|
-
from lmcache.logging import init_logger
|
|
33
|
+
from lmcache.v1.common.logging import init_logger
|
|
34
34
|
|
|
35
35
|
logger = init_logger(__name__)
|
|
36
36
|
|
|
@@ -37,7 +37,7 @@ from lmcache.cli.commands.bench.quality_bench.core.blend_counters import (
|
|
|
37
37
|
from lmcache.cli.commands.bench.quality_bench.core.config import ArmRole
|
|
38
38
|
from lmcache.cli.commands.bench.quality_bench.core.plan import QualityPlan
|
|
39
39
|
from lmcache.cli.commands.bench.quality_bench.core.runner import ArmAnswer, ArmRun
|
|
40
|
-
from lmcache.logging import init_logger
|
|
40
|
+
from lmcache.v1.common.logging import init_logger
|
|
41
41
|
|
|
42
42
|
logger = init_logger(__name__)
|
|
43
43
|
|
|
@@ -130,7 +130,7 @@ def lmcache_version() -> str:
|
|
|
130
130
|
"""Return the installed lmcache version, with its commit when known.
|
|
131
131
|
|
|
132
132
|
Read from the build-generated ``lmcache._version`` rather than
|
|
133
|
-
``lmcache.utils``, which imports torch (absent from ``lmcache-cli``).
|
|
133
|
+
``lmcache.v1.distributed.utils``, which imports torch (absent from ``lmcache-cli``).
|
|
134
134
|
"""
|
|
135
135
|
try:
|
|
136
136
|
# First Party
|
|
@@ -64,7 +64,7 @@ from lmcache.cli.commands.bench.quality_bench.core.runner import (
|
|
|
64
64
|
)
|
|
65
65
|
from lmcache.cli.commands.bench.quality_bench.core.task import check_task
|
|
66
66
|
from lmcache.cli.commands.bench.quality_bench.core.verdict import run_problems
|
|
67
|
-
from lmcache.logging import init_logger
|
|
67
|
+
from lmcache.v1.common.logging import init_logger
|
|
68
68
|
|
|
69
69
|
logger = init_logger(__name__)
|
|
70
70
|
|
|
@@ -18,7 +18,7 @@ from lmcache.cli.commands.bench.quality_bench.core.blend_counters import (
|
|
|
18
18
|
)
|
|
19
19
|
from lmcache.cli.commands.bench.quality_bench.core.config import ArmRole
|
|
20
20
|
from lmcache.cli.commands.bench.quality_bench.core.plan import QualityPlan
|
|
21
|
-
from lmcache.logging import init_logger
|
|
21
|
+
from lmcache.v1.common.logging import init_logger
|
|
22
22
|
|
|
23
23
|
logger = init_logger(__name__)
|
|
24
24
|
|
|
@@ -26,8 +26,8 @@ def add_server_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
26
26
|
|
|
27
27
|
parser.add_argument(
|
|
28
28
|
"--rpc-url",
|
|
29
|
-
default="
|
|
30
|
-
help=("MP request endpoint (default:
|
|
29
|
+
default="grpc://localhost:5555",
|
|
30
|
+
help=("MP request endpoint (default: grpc://localhost:5555)"),
|
|
31
31
|
)
|
|
32
32
|
parser.add_argument(
|
|
33
33
|
"--mode",
|
|
@@ -135,7 +135,7 @@ def add_server_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
135
135
|
"'(1,1024,16,1,128):float16:4;"
|
|
136
136
|
"(2,1024,16,8,128):float16:28'. "
|
|
137
137
|
"All groups must share the same NB and BS. "
|
|
138
|
-
"See lmcache.v1.kv_layer_groups.parse_kvcache_shape_spec "
|
|
138
|
+
"See lmcache.v1.common.kv_layer_groups.parse_kvcache_shape_spec "
|
|
139
139
|
"for the authoritative parser. Default: '%s'" % _DEFAULT_SHAPE_SPEC
|
|
140
140
|
),
|
|
141
141
|
)
|
|
@@ -11,7 +11,7 @@ import torch
|
|
|
11
11
|
# First Party
|
|
12
12
|
from lmcache import torch_dev, torch_device_type
|
|
13
13
|
from lmcache.v1.common.group_view import EngineGroupInfo
|
|
14
|
-
from lmcache.v1.kv_layer_groups import KVLayerGroupInfo
|
|
14
|
+
from lmcache.v1.common.kv_layer_groups import KVLayerGroupInfo
|
|
15
15
|
from lmcache.v1.platform import synchronize_device
|
|
16
16
|
|
|
17
17
|
|
|
@@ -43,18 +43,18 @@ from lmcache.cli.commands.bench.server_bench.helpers import (
|
|
|
43
43
|
_send_lookup,
|
|
44
44
|
_wait_for_result,
|
|
45
45
|
)
|
|
46
|
-
from lmcache.utils import EngineType
|
|
47
46
|
from lmcache.v1.client.transport.factory import RequestClientFactory
|
|
48
47
|
from lmcache.v1.client.worker_transfer import (
|
|
49
48
|
EngineDrivenTransferContext,
|
|
50
49
|
create_transfer_context,
|
|
51
50
|
)
|
|
52
|
-
from lmcache.v1.common.
|
|
53
|
-
from lmcache.v1.kv_layer_groups import (
|
|
51
|
+
from lmcache.v1.common.custom_types import EngineType
|
|
52
|
+
from lmcache.v1.common.kv_layer_groups import (
|
|
54
53
|
DTYPE_MAP,
|
|
55
54
|
format_kvcache_shape_spec,
|
|
56
55
|
parse_kvcache_shape_spec,
|
|
57
56
|
)
|
|
57
|
+
from lmcache.v1.common.utils import LayoutHints
|
|
58
58
|
|
|
59
59
|
if TYPE_CHECKING:
|
|
60
60
|
# First Party
|
|
@@ -985,6 +985,7 @@ class ServerBenchClient:
|
|
|
985
985
|
layout_hints=layout_hints,
|
|
986
986
|
engine_group_infos=buffers.engine_group_infos,
|
|
987
987
|
engine_type=EngineType.VLLM,
|
|
988
|
+
lmcache_chunk_tokens=self._chunk_size,
|
|
988
989
|
)
|
|
989
990
|
except TimeoutError:
|
|
990
991
|
raise RuntimeError(
|
|
@@ -17,15 +17,15 @@ The command exercises the full store / retrieve data path:
|
|
|
17
17
|
Usage examples::
|
|
18
18
|
|
|
19
19
|
# GPU mode: real CUDA tensors + IPC
|
|
20
|
-
lmcache bench server --rpc-url
|
|
20
|
+
lmcache bench server --rpc-url grpc://localhost:5555 \\
|
|
21
21
|
--num-tokens 512 --start 0 --end 3
|
|
22
22
|
|
|
23
23
|
# Custom KV cache shape (multi-group spec)
|
|
24
|
-
lmcache bench server --rpc-url
|
|
24
|
+
lmcache bench server --rpc-url grpc://localhost:5555 \\
|
|
25
25
|
--kvcache-shape-spec '(2,32,1024,8,128):float16:32'
|
|
26
26
|
|
|
27
27
|
# Run forever starting from sequence 0
|
|
28
|
-
lmcache bench server --rpc-url
|
|
28
|
+
lmcache bench server --rpc-url grpc://localhost:5555
|
|
29
29
|
"""
|
|
30
30
|
|
|
31
31
|
# Future
|
|
@@ -12,8 +12,8 @@ import json
|
|
|
12
12
|
|
|
13
13
|
# First Party
|
|
14
14
|
from lmcache.cli.commands.base import BaseCommand
|
|
15
|
-
from lmcache.logging import init_logger
|
|
16
|
-
from lmcache.security.api_key import add_api_key_args
|
|
15
|
+
from lmcache.v1.common.logging import init_logger
|
|
16
|
+
from lmcache.v1.common.security.api_key import add_api_key_args
|
|
17
17
|
|
|
18
18
|
logger = init_logger(__name__)
|
|
19
19
|
|
|
@@ -249,6 +249,30 @@ class CoordinatorCommand(BaseCommand):
|
|
|
249
249
|
# unset flag leaves the coordinator open; supplying a key closes every
|
|
250
250
|
# route except /healthz.
|
|
251
251
|
add_api_key_args(parser)
|
|
252
|
+
parser.add_argument(
|
|
253
|
+
"--public-endpoint",
|
|
254
|
+
dest="public_endpoint",
|
|
255
|
+
action="append",
|
|
256
|
+
default=None,
|
|
257
|
+
metavar="PATH",
|
|
258
|
+
help=(
|
|
259
|
+
"Serve PATH without credentials when API-key authentication is "
|
|
260
|
+
"on. Repeat for several paths. Replaces the default list, which "
|
|
261
|
+
"is /healthz alone, instead of extending it; /metrics and every "
|
|
262
|
+
"other path require the key. Repeat this flag for each path you "
|
|
263
|
+
"want public. Matching is exact."
|
|
264
|
+
),
|
|
265
|
+
)
|
|
266
|
+
parser.add_argument(
|
|
267
|
+
"--no-public-endpoints",
|
|
268
|
+
dest="no_public_endpoints",
|
|
269
|
+
action="store_true",
|
|
270
|
+
default=False,
|
|
271
|
+
help=(
|
|
272
|
+
"Require a valid API key for every HTTP path, including "
|
|
273
|
+
"/healthz. Cannot be combined with --public-endpoint."
|
|
274
|
+
),
|
|
275
|
+
)
|
|
252
276
|
|
|
253
277
|
def execute(self, args: argparse.Namespace) -> None:
|
|
254
278
|
"""Build the coordinator config and serve the app with uvicorn.
|
|
@@ -326,6 +350,9 @@ class CoordinatorCommand(BaseCommand):
|
|
|
326
350
|
fields["event_source_config"] = KafkaCacheEventSourceConfig(**kafka_fields)
|
|
327
351
|
if args.disable_metrics is not None:
|
|
328
352
|
fields["metrics_enabled"] = not args.disable_metrics
|
|
353
|
+
public_endpoints = _resolve_public_endpoints(args)
|
|
354
|
+
if public_endpoints is not None:
|
|
355
|
+
fields["public_endpoints"] = public_endpoints
|
|
329
356
|
extra_config = _parse_extra_config(args.extra_config)
|
|
330
357
|
if extra_config is not None:
|
|
331
358
|
fields["extra_config"] = extra_config
|
|
@@ -346,6 +373,32 @@ class CoordinatorCommand(BaseCommand):
|
|
|
346
373
|
)
|
|
347
374
|
|
|
348
375
|
|
|
376
|
+
def _resolve_public_endpoints(args: argparse.Namespace) -> tuple[str, ...] | None:
|
|
377
|
+
"""Resolve the credential-free coordinator paths.
|
|
378
|
+
|
|
379
|
+
Args:
|
|
380
|
+
args: Parsed coordinator arguments.
|
|
381
|
+
|
|
382
|
+
Returns:
|
|
383
|
+
``None`` when neither flag is set, so the config default (``/healthz``
|
|
384
|
+
and ``/metrics``) applies; an empty tuple for
|
|
385
|
+
``--no-public-endpoints``; otherwise the given paths in order.
|
|
386
|
+
|
|
387
|
+
Raises:
|
|
388
|
+
ValueError: If both flags are used, or a path is not absolute.
|
|
389
|
+
"""
|
|
390
|
+
paths = getattr(args, "public_endpoint", None) or []
|
|
391
|
+
if getattr(args, "no_public_endpoints", False):
|
|
392
|
+
if paths:
|
|
393
|
+
raise ValueError(
|
|
394
|
+
"--no-public-endpoints cannot be combined with --public-endpoint"
|
|
395
|
+
)
|
|
396
|
+
return ()
|
|
397
|
+
if not paths:
|
|
398
|
+
return None
|
|
399
|
+
return tuple(paths)
|
|
400
|
+
|
|
401
|
+
|
|
349
402
|
def _parse_extra_config(raw: str | None) -> dict[str, object] | None:
|
|
350
403
|
"""Parse ``--extra-config``.
|
|
351
404
|
|
lmcache/cli/commands/kvcache.py
CHANGED
lmcache/cli/commands/memory.py
CHANGED
|
@@ -28,7 +28,7 @@ import urllib.request
|
|
|
28
28
|
from lmcache.cli.commands.describe import fmt_bytes
|
|
29
29
|
from lmcache.cli.commands.quota._helpers import escape_salt
|
|
30
30
|
from lmcache.cli.http import normalize_url as normalize_url
|
|
31
|
-
from lmcache.logging import init_logger
|
|
31
|
+
from lmcache.v1.common.logging import init_logger
|
|
32
32
|
from lmcache.v1.common.metrics import Metrics
|
|
33
33
|
|
|
34
34
|
logger = init_logger(__name__)
|
lmcache/cli/commands/server.py
CHANGED
|
@@ -22,7 +22,7 @@ from dataclasses import dataclass, field
|
|
|
22
22
|
from typing import Any, Callable
|
|
23
23
|
|
|
24
24
|
# First Party
|
|
25
|
-
from lmcache.logging import init_logger
|
|
25
|
+
from lmcache.v1.common.logging import init_logger
|
|
26
26
|
from lmcache.v1.distributed.api import ObjectKey
|
|
27
27
|
from lmcache.v1.distributed.storage_manager import StorageManager, l1_owners_of
|
|
28
28
|
|
|
@@ -51,7 +51,7 @@ from lmcache.cli.commands.trace._dispatch import (
|
|
|
51
51
|
build_default_dispatcher,
|
|
52
52
|
)
|
|
53
53
|
from lmcache.cli.commands.trace._stats import ReplayStatsCollector
|
|
54
|
-
from lmcache.logging import init_logger
|
|
54
|
+
from lmcache.v1.common.logging import init_logger
|
|
55
55
|
from lmcache.v1.distributed.config import StorageManagerConfig
|
|
56
56
|
from lmcache.v1.distributed.storage_manager import StorageManager
|
|
57
57
|
from lmcache.v1.mp_observability.config import (
|
|
@@ -13,7 +13,7 @@ import sys
|
|
|
13
13
|
|
|
14
14
|
# First Party
|
|
15
15
|
from lmcache.cli.commands.base import BaseCommand
|
|
16
|
-
from lmcache.logging import init_logger
|
|
16
|
+
from lmcache.v1.common.logging import init_logger
|
|
17
17
|
from lmcache.v1.common.metrics import Metrics, StreamHandler, get_formatter
|
|
18
18
|
|
|
19
19
|
logger = init_logger(__name__)
|
|
@@ -12,7 +12,7 @@ import sys
|
|
|
12
12
|
|
|
13
13
|
# First Party
|
|
14
14
|
from lmcache.cli.commands.base import BaseCommand
|
|
15
|
-
from lmcache.logging import init_logger
|
|
15
|
+
from lmcache.v1.common.logging import init_logger
|
|
16
16
|
from lmcache.v1.common.metrics import Metrics, StreamHandler, get_formatter
|
|
17
17
|
|
|
18
18
|
logger = init_logger(__name__)
|
lmcache/cli/main.py
CHANGED
|
@@ -14,9 +14,9 @@ import argparse
|
|
|
14
14
|
import sys
|
|
15
15
|
|
|
16
16
|
# First Party
|
|
17
|
-
from lmcache.banner import print_banner_once
|
|
18
17
|
from lmcache.cli.commands import register_commands
|
|
19
|
-
from lmcache.
|
|
18
|
+
from lmcache.v1.common.banner import print_banner_once
|
|
19
|
+
from lmcache.v1.common.logging import init_logger
|
|
20
20
|
|
|
21
21
|
logger = init_logger(__name__)
|
|
22
22
|
|