[Frontend][Core] Standardize request error handling with VLLMError hierarchy (#49665)
Signed-off-by: Zach Zhu <zzqshu@126.com>
This commit is contained in:
@@ -21,6 +21,7 @@ from vllm.distributed.weight_transfer.base import (
|
||||
from vllm.engine.arg_utils import AsyncEngineArgs
|
||||
from vllm.engine.protocol import EngineClient, StreamingInput
|
||||
from vllm.entrypoints.serve.elastic_ep.middleware import set_scaling_elastic_ep
|
||||
from vllm.exceptions import VLLMClientError, VLLMValidationError
|
||||
from vllm.inputs import EngineInput, PromptType
|
||||
from vllm.logger import init_logger
|
||||
from vllm.lora.request import LoRARequest
|
||||
@@ -309,7 +310,7 @@ class AsyncLLM(EngineClient):
|
||||
and not is_pooling
|
||||
and params.prompt_logprobs
|
||||
):
|
||||
raise ValueError(
|
||||
raise VLLMValidationError(
|
||||
"--kv-sharing-fast-prefill produces incorrect logprobs for "
|
||||
"prompt tokens, please disable it when the requests need "
|
||||
"prompt logprobs"
|
||||
@@ -476,7 +477,7 @@ class AsyncLLM(EngineClient):
|
||||
)
|
||||
req.external_req_id = request_id
|
||||
if req.prompt_embeds is not None:
|
||||
raise ValueError(
|
||||
raise VLLMValidationError(
|
||||
"prompt_embeds not supported for streaming inputs"
|
||||
)
|
||||
prompt_text, _, _ = extract_prompt_components(
|
||||
@@ -512,7 +513,7 @@ class AsyncLLM(EngineClient):
|
||||
or params.output_kind == RequestOutputKind.FINAL_ONLY
|
||||
or params.stop
|
||||
):
|
||||
raise ValueError(
|
||||
raise VLLMValidationError(
|
||||
"Input streaming not currently supported "
|
||||
"for pooling models, n > 1, request_kind = FINAL_ONLY "
|
||||
"or with stop strings."
|
||||
@@ -604,7 +605,7 @@ class AsyncLLM(EngineClient):
|
||||
raise
|
||||
|
||||
# Request validation error.
|
||||
except ValueError as e:
|
||||
except VLLMClientError as e:
|
||||
if self.log_requests:
|
||||
logger.info("Request %s failed (bad request): %s.", request_id, e)
|
||||
raise
|
||||
@@ -869,7 +870,7 @@ class AsyncLLM(EngineClient):
|
||||
raise
|
||||
|
||||
# Request validation error.
|
||||
except ValueError:
|
||||
except VLLMClientError:
|
||||
if self.log_requests:
|
||||
logger.info("Request %s failed (bad request).", request_id)
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user