Skip to content

Commit 50e940e

Browse files
committed
Fix test_ptp_quickstart_multimodal_phi4mm - for stability set lora cache sizes, fix incorrect lora request creation
Signed-off-by: Amit Zuker <[email protected]>
1 parent 6232596 commit 50e940e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

examples/llm-api/quickstart_multimodal.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ def main():
127127
models_module = importlib.import_module('tensorrt_llm._torch.models')
128128
model_class = getattr(models_module, args.auto_model_name)
129129
lora_config = model_class.lora_config(args.model_dir)
130+
# For stability - explicitly set the LoRA GPU cache & CPU cache to have space for 2 adapters
131+
lora_config.max_loras = 2
132+
lora_config.max_cpu_loras = 2
130133

131134
llm, sampling_params = setup_llm(args, lora_config=lora_config)
132135

tensorrt_llm/_torch/models/modeling_phi4mm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,16 @@ def lora_request(num_requests: int, modality: str, base_model_dir: str):
269269
if modality == "image" or modality == "image_audio":
270270
lora_request = [
271271
LoRARequest(
272-
lora_name=f"vision-lora-{i}",
273-
lora_int_id=i,
272+
lora_name="vision-lora",
273+
lora_int_id=0,
274274
lora_path=f"{base_model_dir}/vision-lora",
275275
) for i in range(num_requests)
276276
]
277277
elif modality == "audio":
278278
lora_request = [
279279
LoRARequest(
280-
lora_name=f"speech-lora-{i}",
281-
lora_int_id=i,
280+
lora_name="speech-lora",
281+
lora_int_id=1,
282282
lora_path=f"{base_model_dir}/speech-lora",
283283
) for i in range(num_requests)
284284
]

0 commit comments

Comments
 (0)