Aggressive retry mechanism causing VLLM shared memory exhaustion during streaming
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by locating the Python client implementation containing DEFAULT_MAX_RETRIES, INITIAL_RETRY_DELAY, and _should_retry, then trace how options.stream is handled. Reproduce or test a streaming request with retries enabled and determine the intended configuration behavior. Done means streaming retries no longer create redundant requests or exhaust VLLM shared memory, with coverage for the selected retry policy.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Issue Description
When using the LlamaStack Python client with VLLM backend, the retry mechanism during streaming responses can lead to VLLM shared memory exhaustion.
System Architecture
VLLM <= LlamaStack <= Client Application
Observed Behavior
- Initial streaming request is made and starts receiving chunks
- While waiting for VLLM response chunks, LlamaStack client automatically retries the request
- Multiple identical requests accumulate, eventually causing VLLM to run out of shared memory
Logs Evidence
First attempt:
DEBUG 10-10 05:27:15 [client.py:193] Waiting for output from MQLLMEngine.
DEBUG 10-10 05:27:16 [metrics.py:386] Avg prompt throughput: 0.0 tokens/s
Second attempt (automatic retry):
INFO 10-10 05:27:20 [logger.py:41] Received request chatcmpl-912e2a2b68f44d46a991b3b37cf7895a
Third attempt (another retry):
INFO 10-10 05:27:51 [logger.py:41] Received request chatcmpl-ea4023145df84ba183683a38983e5977
Final error:
ERROR 10-10 05:28:03 [serving_chat.py:932] vllm.engine.multiprocessing.MQEngineDeadError: Engine loop is not running. Inspect the stacktrace to find the original error: OutOfResources(98304, 65536, 'shared memory').
Current Implementation
The client currently has the following retry behavior:
- Default configuration:
DEFAULT_MAX_RETRIES = 2
MAX_RETRY_DELAY = 8 # seconds
INITIAL_RETRY_DELAY = 0.5 # seconds
- Retry conditions (from
_should_retry):
# Retry on request timeouts (408)
# Retry on lock timeouts (409)
# Retry on rate limits (429)
# Retry on server errors (502, 503, 504)
Impact
- VLLM crashes due to shared memory exhaustion
- Multiple redundant requests consume resources
- Potential cascading failures in the system
Suggested Solutions
- Add streaming-specific retry configuration:
class StreamingConfig:
max_retries: int = 0
retry_on_timeout: bool = False
retry_on_server_error: bool = False
- Add a header to indicate streaming requests that should bypass retries:
X-LlamaStack-Streaming: true
- Or simply detect streaming requests and disable retries automatically:
if options.stream:
options.max_retries = 0
The third option might be the safest as it would prevent any potential memory exhaustion issues by default while still allowing users to explicitly enable retries if needed.
Questions
- Is there a way to configure retry behavior specifically for streaming requests in the current version?
- Are there plans to add more granular retry control?
- Is there a recommended way to handle streaming retries differently from regular requests?
Environment
- LlamaStack Python Client (latest version)
- VLLM backend
- Python 3.x
- Lenguaje dominante
- Python
- Estrellas
- 198
- Forks
- 102
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ogx-ai/ogx-client-python
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 15/100
ogx-ai/ogx-client-python#348 · 1 comentario ·
-
Mad APIAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
ogx-ai/ogx-client-python#347 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
ogx-ai/ogx-client-python#307 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
ogx-ai/ogx-client-python#287 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
ogx-ai/ogx-client-python#272 ·
Todos los issues de ogx-ai/ogx-client-python
Issues similares
-
Context/namespace resources fail in-cluster: "Invalid kube-config file. No configuration found."Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
awslabs/visual-asset-management-system#880 ·
Los mantenedores suelen responder en 1 día
-
netbox status: needs owner type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
netbox-community/netbox#23533 ·
Los mantenedores suelen responder en 1 día
-
app: scripts status: backlog type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
netbox-community/netbox-scripts#68 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
marin-community/marin#10765 ·
Los mantenedores suelen responder en 1 día