mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-09 22:44:54 +08:00
[Misc] Make handling of SamplingParams clearer in n>1 case (#26032)
Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
parent
0b018d8baf
commit
169313b9f8
@ -289,13 +289,19 @@ class AsyncLLM(EngineClient):
|
||||
await self._add_request(request, prompt_str, None, 0, queue)
|
||||
return queue
|
||||
|
||||
# Get the updated SamplingParams from the request, which
|
||||
# were cloned/updated in processor.process_inputs above.
|
||||
parent_params = request.sampling_params
|
||||
assert parent_params is not None
|
||||
|
||||
# Fan out child requests (for n>1).
|
||||
parent_request = ParentRequest(request_id, request.sampling_params)
|
||||
for idx in range(params.n):
|
||||
request_id, params = parent_request.get_child_info(idx)
|
||||
child_request = request if idx == params.n - 1 else copy(request)
|
||||
parent_request = ParentRequest(request_id, parent_params)
|
||||
for idx in range(parent_params.n):
|
||||
request_id, child_params = parent_request.get_child_info(idx)
|
||||
child_request = request if idx == parent_params.n - 1 else copy(
|
||||
request)
|
||||
child_request.request_id = request_id
|
||||
child_request.sampling_params = params
|
||||
child_request.sampling_params = child_params
|
||||
await self._add_request(child_request, prompt_str, parent_request,
|
||||
idx, queue)
|
||||
return queue
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user