[Hardware] add platform-specific request validation api (#16291)
Signed-off-by: Joe Runde <Joseph.Runde@ibm.com>
This commit is contained in:
@@ -141,11 +141,6 @@ class Processor:
|
||||
else:
|
||||
params.guided_decoding.backend = engine_level_backend
|
||||
|
||||
from vllm.platforms import current_platform
|
||||
if not current_platform.supports_structured_output():
|
||||
raise ValueError("Structured output is not supported on "
|
||||
f"{current_platform.device_name}.")
|
||||
|
||||
# Request content validation
|
||||
if engine_level_backend.startswith("xgrammar"):
|
||||
# xgrammar with no fallback
|
||||
@@ -187,6 +182,11 @@ class Processor:
|
||||
# TODO(woosuk): Support pooling models.
|
||||
# TODO(woosuk): Support encoder-decoder models.
|
||||
|
||||
from vllm.platforms import current_platform
|
||||
current_platform.validate_request(
|
||||
prompt=prompt,
|
||||
params=params,
|
||||
)
|
||||
self._validate_lora(lora_request)
|
||||
self._validate_params(params)
|
||||
if priority != 0:
|
||||
|
||||
Reference in New Issue
Block a user