Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lmcache/v1/distributed/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ def add_storage_manager_args(
default=4096,
help="The alignment size in bytes. Default is 4KB (4096 bytes).",
)
memory_group.add_argument(
"--shm-name",
type=str,
default=None,
help="POSIX shared-memory segment name for L1 pool. "
"Default (not specified): auto-allocate pid-based name. "
'Set to "" to disable SHM. '
"Set to a name to use that specific SHM segment.",
)

# L1 Manager Config (TTL settings)
ttl_group = parser.add_argument_group(
Expand Down Expand Up @@ -291,11 +300,13 @@ def parse_args_to_config(
Returns:
StorageManagerConfig: The configuration object.
"""
shm_name = getattr(args, "shm_name", None)
memory_config = L1MemoryManagerConfig(
size_in_bytes=int(args.l1_size_gb * (1 << 30)),
use_lazy=args.l1_use_lazy,
init_size_in_bytes=int(args.l1_init_size_gb * (1 << 30)),
align_bytes=args.l1_align_bytes,
**({"shm_name": shm_name} if shm_name is not None else {}),
)

l1_manager_config = L1ManagerConfig(
Expand Down
14 changes: 0 additions & 14 deletions lmcache/v1/multiprocess/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ class MPServerConfig:
)
"""Runtime plugin configuration (locations + extra config)."""

shm_name: str | None = None
"""SHM segment name for non-GPU KV transfer.
None: auto-allocate (default). "": force pickle. Other: use that name."""


@dataclass
class RuntimePluginConfig:
Expand Down Expand Up @@ -183,15 +179,6 @@ def add_mp_server_args(
'Example: \'{"plugin.frontend.heartbeat_url": '
'"http://localhost:5000/heartbeat"}\'',
)
mp_group.add_argument(
"--shm-name",
type=str,
default=None,
help="SHM segment name for non-GPU KV transfer. "
"Default (not specified): auto-allocate. "
'Set to "" to force pickle path (disable SHM). '
"Set to a name to use that specific SHM segment.",
)
return parser


Expand Down Expand Up @@ -228,7 +215,6 @@ def parse_args_to_mp_server_config(
locations=(args.runtime_plugin_locations or []),
extra_config=plugin_extra,
),
shm_name=args.shm_name,
)


Expand Down