-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
[ROCm][CI] Stabilize 400 error return code for invalid schema inputs #43016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
53223f2
f5b07f2
7128304
01e5eac
26d4c22
41abe07
de4e34b
d596a9f
1082646
80e73ce
fccb373
d86dfd2
0f205a9
9269a1e
ef7bea3
5f13356
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| from http import HTTPStatus | ||
| from typing import Any, ClassVar, Generic, Protocol, TypeAlias, TypeVar | ||
|
|
||
| import msgspec | ||
| from fastapi import Request | ||
| from openai.types.responses import ToolChoiceFunction | ||
| from pydantic import ConfigDict, TypeAdapter, ValidationError | ||
|
|
@@ -426,6 +427,15 @@ async def _with_kv_transfer_rejection_cleanup( | |
| """Wrap a `create_*` coroutine so that, if it raises or returns an | ||
| ErrorResponse (i.e. the request never reached the engine), the KV | ||
| connector is notified to free any pinned remote-prefill blocks.""" | ||
| if request.kv_transfer_params is not None: | ||
| try: | ||
| msgspec.msgpack.encode(request.kv_transfer_params) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't this cause additional overhead? From my understanding this is called even if no error occurs in the request
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed it. The cleanup wrapper now only handles the KV rejection cleanup path again. So, initially, the "eager" msgpack encode was meant as a quick validation guard, but indeed it is not the right place for that check cause it also runs on successful requests. |
||
| except (OverflowError, TypeError, ValueError) as e: | ||
| close = getattr(awaitable, "close", None) | ||
| if close is not None: | ||
| close() | ||
| return self.create_error_response(e) # type: ignore[return-value] | ||
|
|
||
| kv_transfer_params = self.has_kv_connector and request.kv_transfer_params | ||
| if not kv_transfer_params or not kv_transfer_params.get("do_remote_prefill"): | ||
| return await awaitable | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.