Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tensorrt_llm/executor/rpc_worker_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,16 @@ def fetch_responses(self, timeout: Optional[float] = None) -> list:

all_responses = []
for _ in range(qsize):
# The queue contains batches of responses, so extend the list
all_responses.extend(self._response_queue.get())
# The queue normally contains batches of responses, but the
# classic _send_rsp path (exercised when postprocess workers are
# enabled) legitimately enqueues bare responses; extend() on a
# bare LlmResponse raises "'LlmResponse' object is not iterable".
# Tolerate both shapes.
item = self._response_queue.get()
if isinstance(item, list):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the crash go away, but it does not stop the case from happening — and I think that case is the actual bug. The else: append(item) branch is only reachable when num_postprocess_workers > 0: with 0 workers, handle_for_ipc_batched passes rsp_batch=[] and _send_rsp always ends at result_queue.put(rsp_batch), i.e. a list. In the > 0 case, _send_rsp returns at the elif worker.result_queue is not None branch (base_worker.py:1414) and never reaches the postproc branch, so postproc_batches stays empty — and GenerationExecutorRpcProxy never creates a PostprocWorker or calls set_postproc_queues in the first place. So postprocess parallelism does not actually run on the RPC path, and on top of that executor.py:255-258 forces drop_context_logits/drop_generation_logits on because it believes the PostProcess flow is active. Tolerating the bare response converts a loud "unsupported configuration" failure into a silent one: no parallel postprocessing, and silently dropped logits, with no warning.

I would prefer we prevent the case rather than absorb it — either reject num_postprocess_workers > 0 at construction time in GenerationExecutorRpcProxy, the way RayExecutor.enable_postprocess_parallel already does for the same configuration, or wire the postproc queues up for real if the intent is to support it. If this fix is urgent, landing it as a mitigation and doing that as a follow-up is acceptable, but my recommendation is to fix it properly in this PR — the mitigation on its own leaves users with a config that looks supported and silently is not.

all_responses.extend(item)
else:
all_responses.append(item)
return all_responses

async def fetch_responses_async(self, timeout: Optional[float] = None) -> list:
Expand Down
Loading