vllm-project / vllm-project/aibrix

[KVCache (Vineyard)]Are there 3 or more replicas's deployment distributed KV test cases?

Open
#1,012 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
5.1k
Forks
694
Avg merge
1d 20h
Merged PRs (30d)
98

Description

### 🚀 Feature Description and Motivation

@Jeffwan I hope to have 3 or more replicas's deployment distributed KV test cases, and how I watch kv cache imporve.This [case](https://aibrix.readthedocs.io/latest/features/distributed-kv-cache.html) only have one kv cache pod.I change KVCache's replicas to 2, it happend the error `Unhandled exception:
std::exception:what(): the UNIX-domain socket '/var/run/vineyard.sock' is already inuse and has been listened on,

- please use another IPC socket path to start vineyardd,

e.g., vineyardd --socket=/tmp/vineyard.sock

for more vineyardd options, see also: vineyard --help`

### Use Case
```
apiVersion: apps/v1
kind: Deployment
metadata:
name: deepseek-coder-7b-instruct
namespace: prdsafe
labels:
model.aibrix.ai/name: deepseek-coder-7b-instruct
model.aibrix.ai/port: "8000"
spec:
replicas: 2
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
model.aibrix.ai/name: deepseek-coder-7b-instruct
template:
metadata:
namespace: prdsafe
labels:
model.aibrix.ai/name: deepseek-coder-7b-instruct
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: model.aibrix.ai/name
operator: In
values:
- deepseek-coder-7b-instruct
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- name: vllm-openai
image: aibrix-vllm-openai:v0.6.1-edb07092-20250118
imagePullPolicy: Always
command:
- python3
- -m
- vllm.entrypoints.openai.api_server
- --port
- "8000"
- --uvicorn-log-level
- warning
- --model
- deepseek-ai/DeepSeek-R1-Distill-Llama-8B
- --served-model-name
- deepseek-coder-7b-instruct
- --max-model-len
- "8192" # please modify this field if your gpu has more room
- --enable-prefix-caching
- --dtype
- half
- --disable-fastapi-docs
env:
- name: VLLM_USE_VINEYARD_CACHE
value: "1"
- name: VINEYARD_CACHE_CPU_MEM_LIMIT_GB
value: "10"
- name: AIBRIX_LLM_KV_CACHE
value: "1"
- name: AIBRIX_LLM_KV_CACHE_KV_CACHE_NS
value: "aibrix"
- name: AIBRIX_LLM_KV_CACHE_CHUNK_SIZE
value: "16"
- name: AIBRIX_LLM_KV_CACHE_SOCKET
value: /var/run/vineyard.sock
- name: AIBRIX_LLM_KV_CACHE_RPC_ENDPOINT
value: "deepseek-coder-7b-kvcache-rpc:9600"
- name: VINEYARD_CACHE_ENABLE_ASYNC_UPDATE
value: "1"
- name: "VINEYARD_CACHE_METRICS_ENABLED"
value: "1"
volumeMounts:
- mountPath: /var/run
name: kvcache-socket
resources:
limits:
nvidia.com/gpu: "1"
requests:
nvidia.com/gpu: "1"
volumes:
- name: kvcache-socket
hostPath:
path: /var/run/vineyard-kubernetes/prdsafe/deepseek-coder-7b-kvcache
---
apiVersion: v1
kind: Service
metadata:
labels:
model.aibrix.ai/name: deepseek-coder-7b-instruct
prometheus-discovery: "true"
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
name: deepseek-coder-7b-instruct # Note: The Service name must match the label value `model.aibrix.ai/name` in the Deployment
namespace: prdsafe
spec:
ports:
- name: serve
port: 8000
protocol: TCP
targetPort: 8000
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
model.aibrix.ai/name: deepseek-coder-7b-instruct
type: ClusterIP
---
apiVersion: orchestration.aibrix.ai/v1alpha1
kind: KVCache
metadata:
name: deepseek-coder-7b-kvcache
namespace: prdsafe
annotations:
kvcache.orchestration.aibrix.ai/pod-affinity-workload: deepseek-coder-7b-instruct
spec:
replicas: 1
service:
type: ClusterIP
port: 9600
cacheSpec:
image: aibrix-vineyardd:20241120
imagePullPolicy: IfNotPresent
cpu: 4000m
memory: 10Gi
```
```
##One pod is running, and another is crash
INFO 04-27 05:04:15 model_runner.py:1041] Loading model weights took 14.9888 GB
INFO 04-27 05:04:15 vineyard_llm_cache.py:296] VineyardLLMCache async update: {'enable_async_update': True, 'min_inflight_tasks': 1, 'max_inflight_tasks': 32}
INFO 04-27 05:04:15 vineyard_llm_cache.py:306] VineyardLLMCache from_envs None
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 10 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 9 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 8 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 7 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 6 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 5 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 4 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 3 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 2 more times.
[info] Connection to IPC socket failed for pathname /var/run/vineyard.sock with ret = IOError: Cannot connect to /var/run/vineyard.sock: No such file or directory, retrying 1 more times.
Process SpawnProcess-1:
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/vllm/entrypoints/openai/rpc/server.py", line 236, in run_rpc_server
server = AsyncEngineRPCServer(async_engine_args, usage_context, rpc_path)
File "/usr/local/lib/python3.10/dist-packages/vllm/entrypoints/openai/rpc/server.py", line 34, in __init__
self.engine = AsyncLLMEngine.from_engine_args(
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/async_llm_engine.py", line 735, in from_engine_args
engine = cls(
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/async_llm_engine.py", line 615, in __init__
self.engine = self._init_engine(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/async_llm_engine.py", line 835, in _init_engine
return engine_class(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/async_llm_engine.py", line 262, in __init__
super().__init__(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/vllm/engine/llm_engine.py", line 326, in __init__
self.model_executor = executor_class(
File "/usr/local/lib/python3.10/dist-packages/vllm/executor/executor_base.py", line 47, in __init__
self._init_executor()
File "/usr/local/lib/python3.10/dist-packages/vllm/executor/gpu_executor.py", line 41, in _init_executor
self.driver_worker.load_model()
File "/usr/local/lib/python3.10/dist-packages/vllm/worker/worker.py", line 184, in load_model
self.model_runner.load_model()
File "/usr/local/lib/python3.10/dist-packages/vllm/worker/model_runner.py", line 1104, in load_model
self._init_vineyard_cache(self.cache_service_metrics)
File "/usr/local/lib/python3.10/dist-packages/vllm/worker/model_runner.py", line 1010, in _init_vineyard_cache
self.vineyard_llm_cache: VineyardLLMCache = VineyardLLMCache.from_envs(
File "/usr/local/lib/python3.10/dist-packages/vllm/worker/vineyard_llm_cache.py", line 307, in from_envs
return VineyardLLMCache(
File "/usr/local/lib/python3.10/dist-packages/vllm/worker/vineyard_llm_cache.py", line 136, in __init__
self.cache = VineyardKVCache(
File "/usr/local/lib/python3.10/dist-packages/vineyard/llm/cache.py", line 380, in __init__
cache_config = AIBrixCacheConfig(**config)
File "/usr/local/lib/python3.10/dist-packages/vineyard/llm/cache.py", line 252, in __init__
self.ipc_client = vineyard.connect(socket).ipc_client
File "/usr/local/lib/python3.10/dist-packages/vineyard/__init__.py", line 418, in connect
return Client(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/vineyard/core/client.py", line 283, in __init__
self._ipc_client = _connect(socket, **kwargs)
vineyard._C.ConnectionFailedException: Connection failed: Failed to connect to vineyardd: Failed to connect to IPC socket: /var/run/vineyard.sock
ERROR 04-27 05:04:27 api_server.py:188] RPCServer process died before responding to readiness probe
```

### Proposed Solution

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.