add
This commit is contained in:
parent
6a19781133
commit
3201151255
147
20251011.md
Normal file
147
20251011.md
Normal file
@ -0,0 +1,147 @@
|
||||
## 崩溃原因
|
||||
|
||||
- 一个请求被发送到 vLLM 服务,该请求包含了结构化输出的意图
|
||||
- vLLM 在处理请求时,进入 structured_output_request.structured_output_key 的逻辑,最终调用 get_structured_output_key(sampling_params)函数。
|
||||
- 该函数遍历 sampling_params 中的各种参数(如 grammar, json_schema, regex 等),但没有找到任何一个有效的结构化输出参数。
|
||||
- 因此抛出异常:raise ValueError("No valid structured output parameter found")
|
||||
- 这个 ValueError 在后台线程中抛出,但未被捕获,导致 EngineCore 进程(PID 2738693)崩溃
|
||||
- 主 API 服务(APIServer)检测到 EngineCore 崩溃,抛出 EngineDeadError,最终整个服务终止。
|
||||
|
||||
## 解决方案一
|
||||
|
||||
确保请求进入vllm的时候,提供有效的结构化输出参数。例如:
|
||||
|
||||
```json
|
||||
{
|
||||
"prompt": "生成一个用户信息",
|
||||
"structured_output": {
|
||||
"type": "json",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"age": {"type": "integer"}
|
||||
},
|
||||
"required": ["name", "age"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### 错误示例
|
||||
|
||||
```json
|
||||
{
|
||||
"prompt": "生成一个JSON",
|
||||
"structured_output": {}
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"prompt": "生成一个JSON",
|
||||
"json_schema": null
|
||||
}
|
||||
```
|
||||
|
||||
## 解决方案二
|
||||
|
||||
升级vllm的版本到最新稳定版,官方已做出大量优化和改进。
|
||||
|
||||
## 崩溃日志片段
|
||||
|
||||
```text
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] EngineCore encountered a fatal error.
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] Traceback (most recent call last):
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 701, in run_engine_core
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] engine_core.run_busy_loop()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 728, in run_busy_loop
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] self._process_engine_step()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 754, in _process_engine_step
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] outputs, model_executed = self.step_fn()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 283, in step
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] scheduler_output = self.scheduler.schedule()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/core/sched/scheduler.py", line 359, in schedule
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] if structured_output_req and structured_output_req.grammar:
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 45, in grammar
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] completed = self._check_grammar_completion()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 33, in _check_grammar_completion
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] self._grammar = self._grammar.result(timeout=0.0001)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/concurrent/futures/_base.py", line 458, in result
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] return self.__get_result()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] raise self._exception
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/concurrent/futures/thread.py", line 58, in run
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] result = self.fn(*self.args, **self.kwargs)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/__init__.py", line 128, in _async_create_grammar
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] key = request.structured_output_request.structured_output_key # type: ignore[union-attr]
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/functools.py", line 981, in __get__
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] val = self.func(instance)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 58, in structured_output_key
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] return get_structured_output_key(self.sampling_params)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 86, in get_structured_output_key
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] raise ValueError("No valid structured output parameter found")
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ERROR 10-10 10:43:10 [core.py:710] ValueError: No valid structured output parameter found
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m Process EngineCore_DP0:
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m Traceback (most recent call last):
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [async_llm.py:480] AsyncLLM output_handler failed.
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [async_llm.py:480] Traceback (most recent call last):
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [async_llm.py:480] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/async_llm.py", line 439, in output_handler
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [async_llm.py:480] outputs = await engine_core.get_output_async()
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [async_llm.py:480] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core_client.py", line 846, in get_output_async
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [async_llm.py:480] raise self._format_exception(outputs) from None
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [async_llm.py:480] vllm.v1.engine.exceptions.EngineDeadError: EngineCore encountered an issue. See stack trace (above) for the root cause.
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m self.run()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/multiprocessing/process.py", line 108, in run
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m self._target(*self._args, **self._kwargs)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 712, in run_engine_core
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m raise e
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 701, in run_engine_core
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m engine_core.run_busy_loop()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 728, in run_busy_loop
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m self._process_engine_step()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 754, in _process_engine_step
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m outputs, model_executed = self.step_fn()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core.py", line 283, in step
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m scheduler_output = self.scheduler.schedule()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/core/sched/scheduler.py", line 359, in schedule
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m if structured_output_req and structured_output_req.grammar:
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 45, in grammar
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m completed = self._check_grammar_completion()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 33, in _check_grammar_completion
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m self._grammar = self._grammar.result(timeout=0.0001)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/concurrent/futures/_base.py", line 458, in result
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m return self.__get_result()
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m raise self._exception
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/concurrent/futures/thread.py", line 58, in run
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m result = self.fn(*self.args, **self.kwargs)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/__init__.py", line 128, in _async_create_grammar
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m key = request.structured_output_request.structured_output_key # type: ignore[union-attr]
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/functools.py", line 981, in __get__
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m val = self.func(instance)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 58, in structured_output_key
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m return get_structured_output_key(self.sampling_params)
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/structured_output/request.py", line 86, in get_structured_output_key
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m raise ValueError("No valid structured output parameter found")
|
||||
[1;36m(EngineCore_DP0 pid=2738693)[0;0m ValueError: No valid structured output parameter found
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] Error in chat completion stream generator.
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] Traceback (most recent call last):
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/entrypoints/openai/serving_chat.py", line 574, in chat_completion_stream_generator
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] async for res in result_generator:
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/async_llm.py", line 387, in generate
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] out = q.get_nowait() or await q.get()
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/output_processor.py", line 59, in get
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] raise output
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/async_llm.py", line 439, in output_handler
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] outputs = await engine_core.get_output_async()
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] File "/aisoft/conda/env/vllm2/lib/python3.10/site-packages/vllm/v1/engine/core_client.py", line 846, in get_output_async
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] raise self._format_exception(outputs) from None
|
||||
[1;36m(APIServer pid=2738423)[0;0m ERROR 10-10 10:43:10 [serving_chat.py:1145] vllm.v1.engine.exceptions.EngineDeadError: EngineCore encountered an issue. See stack trace (above) for the root cause.
|
||||
[rank0]:[W1010 10:43:10.666166970 ProcessGroupNCCL.cpp:1538] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())
|
||||
[1;36m(APIServer pid=2738423)[0;0m INFO: Shutting down
|
||||
[1;36m(APIServer pid=2738423)[0;0m INFO: Waiting for application shutdown.
|
||||
[1;36m(APIServer pid=2738423)[0;0m INFO: Application shutdown complete.
|
||||
[1;36m(APIServer pid=2738423)[0;0m INFO: Finished server process [2738423]
|
||||
```
|
||||
Loading…
Reference in New Issue
Block a user