Skip to content

Commit

Permalink
[Bugfix] PicklingError on RayTaskError (#9934)
Browse files Browse the repository at this point in the history
Signed-off-by: Gene Su <[email protected]>
  • Loading branch information
GeneDer authored Nov 1, 2024
1 parent 18bd758 commit 27cd36e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vllm/engine/multiprocessing/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import cloudpickle
import zmq
from ray.exceptions import RayTaskError

from vllm import AsyncEngineArgs, SamplingParams
# yapf conflicts with isort for this block
Expand Down Expand Up @@ -305,6 +306,11 @@ def _health_check(self):
def _send_outputs(self, outputs: REQUEST_OUTPUTS_T):
"""Send List of RequestOutput to RPCClient."""
if outputs:
# RayTaskError might not pickelable here. We need to unpack the
# underlying exception as the real exception in the output.
if (isinstance(outputs, RPCError)
and isinstance(outputs.exception, RayTaskError)):
outputs.exception = outputs.exception.cause
output_bytes = pickle.dumps(outputs)
self.output_socket.send_multipart((output_bytes, ), copy=False)

Expand Down

0 comments on commit 27cd36e

Please sign in to comment.