Skip to content

Commit e041662

Browse files
move strip_for_generation
Signed-off-by: yechank <[email protected]>
1 parent 8663065 commit e041662

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tensorrt_llm/_torch/pyexecutor/model_engine.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,9 +1262,12 @@ def _prepare_tp_inputs(
12621262
# Multimodal
12631263
multimodal_params = MultimodalParams(
12641264
multimodal_data=request.py_multimodal_data)
1265+
multimodal_params.strip_for_generation()
12651266
if multimodal_params.has_content():
1266-
multimodal_params.strip_for_generation()
1267-
# re-assign the multimodal_data to the request after strip_for_generation for another generation request
1267+
multimodal_params.to_device("multimodal_data",
1268+
"cuda",
1269+
pin_memory=True)
1270+
# re-assign the multimodal_data to the request after strip_for_generation for another generation request,
12681271
request.py_multimodal_data = multimodal_params.multimodal_data
12691272
multimodal_params_list.append(multimodal_params)
12701273
extend_requests += extend_dummy_requests

0 commit comments

Comments
 (0)