Pipeline Parallel: Guard for KeyErrors at request abort (#6587)
Signed-off-by: Travis Johnson <tsjohnso@us.ibm.com>
This commit is contained in:
parent
7bd82002ae
commit
3f8d42c81f
@ -131,7 +131,10 @@ class RequestTracker:
|
|||||||
"""Process a request output from the engine."""
|
"""Process a request output from the engine."""
|
||||||
request_id = request_output.request_id
|
request_id = request_output.request_id
|
||||||
|
|
||||||
self._request_streams[request_id].put(request_output)
|
# Guard against a KeyError which can occur if the request was aborted
|
||||||
|
# while the output was generated
|
||||||
|
if (stream := self._request_streams.get(request_id)) is not None:
|
||||||
|
stream.put(request_output)
|
||||||
if request_output.finished:
|
if request_output.finished:
|
||||||
if verbose:
|
if verbose:
|
||||||
logger.info("Finished request %s.", request_id)
|
logger.info("Finished request %s.", request_id)
|
||||||
|
|||||||
@ -90,7 +90,11 @@ class SingleStepOutputProcessor(SequenceGroupOutputProcessor):
|
|||||||
for parent_seq in parent_seqs
|
for parent_seq in parent_seqs
|
||||||
}
|
}
|
||||||
for sample in samples:
|
for sample in samples:
|
||||||
parent_child_dict[sample.parent_seq_id].append(sample)
|
# Guard against a KeyError which can occur if the request was
|
||||||
|
# aborted while the output was generated
|
||||||
|
if (child_list :=
|
||||||
|
parent_child_dict.get(sample.parent_seq_id)) is not None:
|
||||||
|
child_list.append(sample)
|
||||||
# List of (child, parent)
|
# List of (child, parent)
|
||||||
child_seqs: List[Tuple[Sequence, Sequence]] = []
|
child_seqs: List[Tuple[Sequence, Sequence]] = []
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user