vllm.v1.engine.parallel_sampling
ParentRequest
¶
Info, state & processing for parallel sampling request.
Store parent request ID and sampling params. Facilitate generating child request sampling params.
Source code in vllm/v1/engine/parallel_sampling.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
cached_child_sampling_params
instance-attribute
¶
cached_child_sampling_params: Optional[SamplingParams] = (
None
)
output_aggregator
instance-attribute
¶
output_aggregator: list[CompletionOutput] = (
[None] * n if output_kind == FINAL_ONLY else []
)
__init__
¶
__init__(
request_id: str, sampling_params: SamplingParams
) -> None
Source code in vllm/v1/engine/parallel_sampling.py
_get_child_sampling_params
¶
_get_child_sampling_params(index: int) -> SamplingParams
Efficiently obtain child sampling_params
If sampling_params.seed
is not None
then
each child request requires a unique clone of
parent sampling_params
with a unique seed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
index within |
required |
Returns:
Type | Description |
---|---|
SamplingParams
|
Child |
Source code in vllm/v1/engine/parallel_sampling.py
get_child_info
¶
get_child_info(index: int) -> tuple[str, SamplingParams]
Get child request ID and sampling params.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
index within |
required |
Returns:
Type | Description |
---|---|
tuple[str, SamplingParams]
|
(request ID, sampling_params) tuple |
Source code in vllm/v1/engine/parallel_sampling.py
get_outputs
¶
get_outputs(
child_request_id: str,
completion_output: CompletionOutput,
) -> tuple[str, list[CompletionOutput], bool]
Source code in vllm/v1/engine/parallel_sampling.py
observe_finished_request
staticmethod
¶
observe_finished_request(
parent_req: Optional[ParentRequest],
iteration_stats: IterationStats,
num_generation_tokens: int,
)