[Refactor] Rename WAITING_FOR_FSM to WAITING_FOR_STRUCTURED_OUTPUT_GRAMMAR (#38048)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
@@ -1550,7 +1550,7 @@ class Scheduler(SchedulerInterface):
|
||||
@staticmethod
|
||||
def _is_blocked_waiting_status(status: RequestStatus) -> bool:
|
||||
return status in (
|
||||
RequestStatus.WAITING_FOR_FSM,
|
||||
RequestStatus.WAITING_FOR_STRUCTURED_OUTPUT_GRAMMAR,
|
||||
RequestStatus.WAITING_FOR_REMOTE_KVS,
|
||||
RequestStatus.WAITING_FOR_STREAMING_REQ,
|
||||
)
|
||||
@@ -2084,7 +2084,7 @@ class Scheduler(SchedulerInterface):
|
||||
request.status = RequestStatus.WAITING
|
||||
return True
|
||||
|
||||
if request.status == RequestStatus.WAITING_FOR_FSM:
|
||||
if request.status == RequestStatus.WAITING_FOR_STRUCTURED_OUTPUT_GRAMMAR:
|
||||
structured_output_req = request.structured_output_request
|
||||
if not (structured_output_req and structured_output_req.grammar):
|
||||
return False
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ class Request:
|
||||
assert sampling_params.max_tokens is not None
|
||||
self.max_tokens = sampling_params.max_tokens
|
||||
if self.structured_output_request is not None:
|
||||
self.status = RequestStatus.WAITING_FOR_FSM
|
||||
self.status = RequestStatus.WAITING_FOR_STRUCTURED_OUTPUT_GRAMMAR
|
||||
|
||||
if sampling_params.extra_args is not None:
|
||||
self.kv_transfer_params = sampling_params.extra_args.get(
|
||||
@@ -296,7 +296,7 @@ class RequestStatus(enum.IntEnum):
|
||||
"""Status of a request."""
|
||||
|
||||
WAITING = enum.auto()
|
||||
WAITING_FOR_FSM = enum.auto()
|
||||
WAITING_FOR_STRUCTURED_OUTPUT_GRAMMAR = enum.auto()
|
||||
WAITING_FOR_REMOTE_KVS = enum.auto()
|
||||
WAITING_FOR_STREAMING_REQ = enum.auto()
|
||||
RUNNING = enum.auto()
|
||||
|
||||
@@ -42,7 +42,8 @@ class StructuredOutputManager:
|
||||
|
||||
# When in external_launcher mode, async grammar compilation causes deadlocks
|
||||
# due to external_launcher mode having a scheduler for each TP rank.
|
||||
# Async grammar compilation causes the WAITING_FOR_FSM → WAITING transition to
|
||||
# Async grammar compilation causes the
|
||||
# WAITING_FOR_STRUCTURED_OUTPUT_GRAMMAR → WAITING transition to
|
||||
# happen at different times on different TP ranks,
|
||||
# breaking the determinism assumption that external_launcher relies on.
|
||||
self._use_async_grammar_compilation = (
|
||||
|
||||
Reference in New Issue
Block a user