Skip to content

Commit bce06ad

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 391d0f9 commit bce06ad

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
@@ -148,6 +148,9 @@ def main():
148148
models_module = importlib.import_module('tensorrt_llm._torch.models')
149149
model_class = getattr(models_module, args.auto_model_name)
150150
lora_config = model_class.lora_config(args.model_dir)
151+
# For stability - explicitly set the LoRA GPU cache & CPU cache to have space for 2 adapters
152+
lora_config.max_loras = 2
153+
lora_config.max_cpu_loras = 2
151154

152155
llm, sampling_params = setup_llm(args, lora_config=lora_config)
153156

tensorrt_llm/_torch/models/modeling_phi4mm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,16 @@ def lora_request(num_requests: int, modality: str, base_model_dir: str):
271271
if modality == "image" or modality == "image_audio":
272272
lora_request = [
273273
LoRARequest(
274-
lora_name=f"vision-lora-{i}",
275-
lora_int_id=i,
274+
lora_name="vision-lora",
275+
lora_int_id=0,
276276
lora_path=f"{base_model_dir}/vision-lora",
277277
) for i in range(num_requests)
278278
]
279279
elif modality == "audio":
280280
lora_request = [
281281
LoRARequest(
282-
lora_name=f"speech-lora-{i}",
283-
lora_int_id=i,
282+
lora_name="speech-lora",
283+
lora_int_id=1,
284284
lora_path=f"{base_model_dir}/speech-lora",
285285
) for i in range(num_requests)
286286
]

0 commit comments

Comments
 (0)