[AuxOutput] Add block-keyed storage for routed-expert outputs (#45635)
Signed-off-by: aoshen02 <aoshen@inferact.ai> Signed-off-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: aoshen02 <aoshen@inferact.ai> Co-authored-by: OpenAI Codex <codex@openai.com> Co-authored-by: Roger Wang <hey@rogerw.io> Co-authored-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
aoshen02
OpenAI Codex
Roger Wang
Nick Hill
Codex
parent
0aee727ff6
commit
0b7f11a1ee
@@ -233,14 +233,10 @@ def detach_zero_copy_from_model_runner_output(output: "ModelRunnerOutput") -> No
|
||||
token_ids_c, logprobs_c, ranks_c, cu_num_generated_tokens
|
||||
)
|
||||
|
||||
if output.routed_experts is not None:
|
||||
routing_data, slot_mapping = output.routed_experts
|
||||
routing_data_c = _copy_if_readonly(routing_data)
|
||||
slot_mapping_c = _copy_if_readonly(slot_mapping)
|
||||
if routing_data_c is not routing_data or slot_mapping_c is not slot_mapping:
|
||||
output.routed_experts = type(output.routed_experts)(
|
||||
routing_data_c, slot_mapping_c
|
||||
)
|
||||
aux_output = output.aux_output_connector_output
|
||||
if aux_output is not None:
|
||||
for request_output in aux_output.values():
|
||||
request_output.rows = _copy_if_readonly(request_output.rows)
|
||||
|
||||
|
||||
class FutureWrapper(Future):
|
||||
|
||||
Reference in New Issue
Block a user