debug ar model runner
This commit is contained in:
1 parent
6a7a27801b
commit
3c2ad1bf12
1 file changed
+5
-1
@@ -65,6 +65,7 @@ class GPUARModelRunner(OmniGPUModelRunner):
|
|||||||
torch.Tensor,
|
torch.Tensor,
|
||||||
Optional[IntermediateTensors],
|
Optional[IntermediateTensors],
|
||||||
dict[str, Any],
|
dict[str, Any],
|
||||||
|
Optional[dict[str, dict]],
|
||||||
]:
|
]:
|
||||||
|
|
||||||
num_scheduled_tokens = scheduler_output.total_num_scheduled_tokens
|
num_scheduled_tokens = scheduler_output.total_num_scheduled_tokens
|
||||||
@@ -79,6 +80,7 @@ class GPUARModelRunner(OmniGPUModelRunner):
|
|||||||
|
|
||||||
# _prepare_inputs may reorder the batch, so we must gather multi
|
# _prepare_inputs may reorder the batch, so we must gather multi
|
||||||
# modal outputs after that to ensure the correct order
|
# modal outputs after that to ensure the correct order
|
||||||
|
per_req_additional_information: Optional[dict[str, dict]] = None
|
||||||
if (
|
if (
|
||||||
self.supports_mm_inputs
|
self.supports_mm_inputs
|
||||||
and get_pp_group().is_first_rank
|
and get_pp_group().is_first_rank
|
||||||
@@ -103,7 +105,7 @@ class GPUARModelRunner(OmniGPUModelRunner):
|
|||||||
if hasattr(self, "_forward_additional_information"):
|
if hasattr(self, "_forward_additional_information"):
|
||||||
self._forward_additional_information = None
|
self._forward_additional_information = None
|
||||||
# New: per-request additional information for this step
|
# New: per-request additional information for this step
|
||||||
per_req_additional_information: dict[str, dict] = {}
|
per_req_additional_information = {}
|
||||||
|
|
||||||
# Overlay custom prompt_embeds per request for the prompt portion;
|
# Overlay custom prompt_embeds per request for the prompt portion;
|
||||||
# collect additional_information (tensor/list) for prefill portion only
|
# collect additional_information (tensor/list) for prefill portion only
|
||||||
@@ -219,6 +221,7 @@ class GPUARModelRunner(OmniGPUModelRunner):
|
|||||||
positions,
|
positions,
|
||||||
intermediate_tensors,
|
intermediate_tensors,
|
||||||
model_kwargs,
|
model_kwargs,
|
||||||
|
per_req_additional_information,
|
||||||
)
|
)
|
||||||
|
|
||||||
@torch.inference_mode()
|
@torch.inference_mode()
|
||||||
@@ -334,6 +337,7 @@ class GPUARModelRunner(OmniGPUModelRunner):
|
|||||||
positions,
|
positions,
|
||||||
intermediate_tensors,
|
intermediate_tensors,
|
||||||
model_kwargs,
|
model_kwargs,
|
||||||
|
per_req_additional_information,
|
||||||
) = self._preprocess(
|
) = self._preprocess(
|
||||||
scheduler_output,
|
scheduler_output,
|
||||||
num_scheduled_tokens_np,
|
num_scheduled_tokens_np,
|
||||||
|
|||||||
Reference in new issue
Block a user