From 2504aa552efdd85dc486cf23e78611b01f1dc8db Mon Sep 17 00:00:00 2001 From: ruodil <200874449+ruodil@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:53:15 +0800 Subject: [PATCH 001/178] test: add recursive updating pytorch config and change MOE backend format in perf test (#6046) Signed-off-by: ruodil <200874449+ruodil@users.noreply.github.com> --- .../integration/defs/perf/pytorch_model_config.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/integration/defs/perf/pytorch_model_config.py b/tests/integration/defs/perf/pytorch_model_config.py index d2ef5f8b5360..40b2b9f96823 100644 --- a/tests/integration/defs/perf/pytorch_model_config.py +++ b/tests/integration/defs/perf/pytorch_model_config.py @@ -18,6 +18,15 @@ """ +def recursive_update(d, u): + for k, v in u.items(): + if isinstance(v, dict) and isinstance(d.get(k), dict): + recursive_update(d[k], v) + else: + d[k] = v + return d + + def get_model_yaml_config(model_label: str, lora_dirs: list[str] = None) -> dict: """ @@ -130,7 +139,9 @@ def get_model_yaml_config(model_label: str, ], 'config': { 'enable_attention_dp': False, - 'moe_backend': 'TRTLLM' + 'moe_config': { + 'backend': 'TRTLLM' + } } } ] @@ -142,7 +153,7 @@ def get_model_yaml_config(model_label: str, patterns = [patterns] for pattern in patterns: if pattern in model_label.lower(): - base_config.update(pattern_config['config']) + recursive_update(base_config, pattern_config['config']) break # Stop checking other patterns for this config once we find a match # lora-specific change for pytorch From 2a147c4d01d0b73ee73c193c0d709f8d4c29f462 Mon Sep 17 00:00:00 2001 From: ruodil <200874449+ruodil@users.noreply.github.com> Date: Tue, 15 Jul 2025 15:53:59 +0800 Subject: [PATCH 002/178] test: add llama_v3.3_70b_cases in perf test (#6035) Signed-off-by: ruodil <200874449+ruodil@users.noreply.github.com> --- .../defs/perf/pytorch_model_config.py | 20 +++++++++++++++++++ tests/integration/defs/perf/test_perf.py | 1 + .../qa/trt_llm_release_perf_sanity_test.yml | 2 ++ .../qa/trt_llm_release_perf_test.yml | 7 +++++++ 4 files changed, 30 insertions(+) diff --git a/tests/integration/defs/perf/pytorch_model_config.py b/tests/integration/defs/perf/pytorch_model_config.py index 40b2b9f96823..4c0ef1840931 100644 --- a/tests/integration/defs/perf/pytorch_model_config.py +++ b/tests/integration/defs/perf/pytorch_model_config.py @@ -143,6 +143,26 @@ def get_model_yaml_config(model_label: str, 'backend': 'TRTLLM' } } + }, + # Llama-v3.3 models with fp8 quantization + { + 'patterns': [ + 'llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-maxbs:512-maxnt:2048-input_output_len:500,2000-gpus:4', + 'llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-maxbs:512-maxnt:2048-input_output_len:1000,1000-gpus:4', + 'llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-maxbs:512-maxnt:2048-input_output_len:2000,500-gpus:4', + 'llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-maxbs:512-maxnt:2048-input_output_len:128,128-gpus:4', + 'llama_v3.3_70b_instruct_fp8-bench-pytorch-bfloat16-maxbs:512-maxnt:2048-input_output_len:512,32-gpus:4', + ], + 'config': { + 'use_cuda_graph': + True, + 'cuda_graph_padding_enabled': + True, + 'cuda_graph_batch_sizes': [ + 1, 2, 4, 8, 16, 32, 64, 128, 256, 384, 512, 1024, 2048, + 4096, 8192 + ] + } } ] diff --git a/tests/integration/defs/perf/test_perf.py b/tests/integration/defs/perf/test_perf.py index eb8af3d593e6..759ff9273f89 100644 --- a/tests/integration/defs/perf/test_perf.py +++ b/tests/integration/defs/perf/test_perf.py @@ -54,6 +54,7 @@ "modelopt-hf-model-hub/Llama-3.3-70B-Instruct-fp8", "llama_v3.3_70b_instruct_fp4": "modelopt-hf-model-hub/Llama-3.3-70B-Instruct-fp4", + "llama_v3.3_70b_instruct": "llama-3.3-models/Llama-3.3-70B-Instruct", "llama_v3.1_405b_instruct_fp4": "modelopt-hf-model-hub/Llama-3.1-405B-Instruct-fp4", "llama_v3.1_70b_instruct": "llama-3.1-model/Meta-Llama-3.1-70B-Instruct", diff --git a/tests/integration/test_lists/qa/trt_llm_release_perf_sanity_test.yml b/tests/integration/test_lists/qa/trt_llm_release_perf_sanity_test.yml index f5013e1b5b1f..e7369bac1cda 100644 --- a/tests/integration/test_lists/qa/trt_llm_release_perf_sanity_test.yml +++ b/tests/integration/test_lists/qa/trt_llm_release_perf_sanity_test.yml @@ -202,6 +202,8 @@ trt_llm_release_perf_sanity_test: - perf/test_perf.py::test_perf[llama_v3.1_70b-bench-pytorch-bfloat16-maxbs:1-input_output_len:2000,200-reqs:10-gpus:8] - perf/test_perf.py::test_perf[llama_v3.1_70b-bench-bfloat16-maxbs:1-input_output_len:200,2000-reqs:10-gpus:8] - perf/test_perf.py::test_perf[llama_v3.1_70b-bench-pytorch-bfloat16-maxbs:1-input_output_len:200,2000-reqs:10-gpus:8] + - perf/test_perf.py::test_perf[llama_v3.3_70b-bench-pytorch-bfloat16-input_output_len:500,2000-gpus:8] + - perf/test_perf.py::test_perf[llama_v3.3_70b-bench-pytorch-bfloat16-input_output_len:2000,500-gpus:8] - perf/test_perf.py::test_perf[gpt_20b-bench-float16-maxbs:1-input_output_len:128,128-reqs:10-gpus:8] diff --git a/tests/integration/test_lists/qa/trt_llm_release_perf_test.yml b/tests/integration/test_lists/qa/trt_llm_release_perf_test.yml index 6c9f6bcb261b..1b3b539fd3e7 100644 --- a/tests/integration/test_lists/qa/trt_llm_release_perf_test.yml +++ b/tests/integration/test_lists/qa/trt_llm_release_perf_test.yml @@ -295,6 +295,11 @@ trt_llm_release_perf_test: - perf/test_perf.py::test_perf[qwen_14b_chat-cppmanager-ootb_except_mha-float16-input_output_len:128,128+512,32-gpus:4] - perf/test_perf.py::test_perf[starcoder_15.5b-cppmanager-exe-plugin_ifb-float16-maxbs:1-input_output_len:512,200-reqs:10-gpus:4] - perf/test_perf.py::test_perf[starcoder_15.5b-cppmanager-ootb_except_mha-float16-maxbs:1-input_output_len:512,200-reqs:10-gpus:4] + - perf/test_perf.py::test_perf[llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-input_output_len:500,2000-gpus:4] + - perf/test_perf.py::test_perf[llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-input_output_len:1000,1000-gpus:4] + - perf/test_perf.py::test_perf[llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-input_output_len:2000,500-gpus:4] + - perf/test_perf.py::test_perf[llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-input_output_len:128,128-gpus:4] + - perf/test_perf.py::test_perf[llama_v3.3_70b_instruct_fp8-bench-pytorch-float8-input_output_len:512,32-gpus:4] # FP8 specific tests - condition: @@ -357,6 +362,8 @@ trt_llm_release_perf_test: - perf/test_perf.py::test_perf[llama_v3.1_70b_instruct-bench-pytorch-streaming-bfloat16-input_output_len:2000,200-reqs:64-gpus:8] - perf/test_perf.py::test_perf[llama_v3.3_70b_instruct-bench-bfloat16-input_output_len:128,128-gpus:8] - perf/test_perf.py::test_perf[llama_v3.3_70b_instruct-bench-bfloat16-maxbs:16-maxnt:5000-input_output_len:5000,500-reqs:64-con:250-gpus:8] + - perf/test_perf.py::test_perf[llama_v3.3_70b-bench-pytorch-bfloat16-input_output_len:500,2000-gpus:8] + - perf/test_perf.py::test_perf[llama_v3.3_70b-bench-pytorch-bfloat16-input_output_len:2000,500-gpus:8] - perf/test_perf.py::test_perf[gpt_20b-bench-float16-maxbs:8-input_output_len:128,128-reqs:80-gpus:8] - perf/test_perf.py::test_perf[gpt_20b-bench-float16-maxbs:8-input_output_len:512,32-reqs:80-gpus:8] From 9e871ca582e7867686398e3a9377f2e029944020 Mon Sep 17 00:00:00 2001 From: Yiteng Niu <6831097+niukuo@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:18:38 +0800 Subject: [PATCH 003/178] [infra] add more log on reuse-uploading (#6036) Signed-off-by: Yiteng Niu <6831097+niukuo@users.noreply.github.com> Co-authored-by: Yanchao Lu --- jenkins/Build.groovy | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jenkins/Build.groovy b/jenkins/Build.groovy index 51cd760425a6..81193d2ddd50 100644 --- a/jenkins/Build.groovy +++ b/jenkins/Build.groovy @@ -306,18 +306,19 @@ def uploadArtifacts(artifacts, prefix = UPLOAD_PATH, retryTimes = 2, serverId = for (it in artifacts) { def uploadpath = it.key def filepath = it.value - echo "uploading ${filepath} as ${uploadpath}" - trtllm_utils.llmRetry(retryTimes, "uploadArtifacts", { - rtUpload ( - serverId: serverId, - spec: """{ + def spec = """{ "files": [ { "pattern": "${filepath}", "target": "${prefix}/${uploadpath}" } ] - }""", + }""" + echo "Uploading ${filepath} as ${uploadpath}. Spec: ${spec}" + trtllm_utils.llmRetry(retryTimes, "uploadArtifacts", { + rtUpload ( + serverId: serverId, + spec: spec, ) }) } From ab1c54709d42452bfe194517745094f36dbc751b Mon Sep 17 00:00:00 2001 From: Jaedeok Kim <110799725+jaedeok-nvidia@users.noreply.github.com> Date: Tue, 15 Jul 2025 18:41:54 +0900 Subject: [PATCH 004/178] fix: adjust window sizes of VSWA at torch backend (#5880) Signed-off-by: Jaedeok Kim --- .../_torch/pyexecutor/resource_manager.py | 132 ++++++++++++++++-- tensorrt_llm/_utils.py | 16 +++ .../unittest/_torch/test_resource_manager.py | 116 ++++++++++++++- 3 files changed, 251 insertions(+), 13 deletions(-) diff --git a/tensorrt_llm/_torch/pyexecutor/resource_manager.py b/tensorrt_llm/_torch/pyexecutor/resource_manager.py index e52096727c6b..ffa8ce4bdae8 100644 --- a/tensorrt_llm/_torch/pyexecutor/resource_manager.py +++ b/tensorrt_llm/_torch/pyexecutor/resource_manager.py @@ -1,8 +1,9 @@ +import copy import enum import math from abc import ABC, abstractmethod from collections import OrderedDict, defaultdict -from typing import Dict, List, Optional, Tuple, Union +from typing import Dict, List, Optional, Set, Tuple, Union import torch @@ -11,7 +12,7 @@ from tensorrt_llm.bindings.BuildInfo import ENABLE_MULTI_DEVICE from tensorrt_llm.sampling_params import SamplingParams -from ..._utils import nvtx_range +from ..._utils import binding_dtype_size, nvtx_range from ...logger import logger from ...mapping import Mapping from .llm_request import LlmRequest, LlmRequestState, SamplingConfig @@ -437,14 +438,10 @@ def calculate_max_num_blocks(self, cache_size_per_token = kv_factor * sum( self.num_kv_heads_per_layer) * head_dim - if dtype == DataType.FP8: - kv_cache_dtype_bytes = 1 - elif dtype in (DataType.HALF, DataType.BF16): - kv_cache_dtype_bytes = 2 - elif dtype == DataType.FLOAT: - kv_cache_dtype_bytes = 4 - else: + if dtype not in (DataType.FP8, DataType.HALF, DataType.BF16, + DataType.FLOAT): raise ValueError(f'Cannot support {dtype} KV cache.') + kv_cache_dtype_bytes = binding_dtype_size(dtype) cache_size_bytes_per_token = cache_size_per_token * kv_cache_dtype_bytes free_mem, total_mem = torch.cuda.mem_get_info() @@ -603,6 +600,102 @@ def _get_window_size_to_layers(self) -> dict[int, list[int]]: window_size_to_layers_map[window_size].append(local_layer_idx) return window_size_to_layers_map + @staticmethod + def adjust_window_sizes_for_vswa( + window_size_to_layers: Dict[int, List[int]], + kv_cache_config: KvCacheConfigCpp, + model_config: ModelConfig, + pool_memory_bytes: int, + kv_factor: int, + dtype: DataType, + is_cross_attention: bool = False, + ) -> Dict[int, List[int]]: + + assert is_cross_attention is False, 'Cross attention is not supported' + + max_tokens_from_config = kv_cache_config.max_tokens + + def calculate_cache_size_per_token(layers: Set[int]) -> int: + # Same as BaseKVCacheManager::calculateCacheSizePerTokenForSingleWindowSize + total_kv_heads = sum(model_config.num_kv_heads_per_layer[i] + for i in layers) + return total_kv_heads * kv_factor * model_config.head_size + + # Calculate the required memory bytes per sequence. + required_mem_bytes_per_seq = 0 + for window_size in sorted(window_size_to_layers): + layers = window_size_to_layers[window_size] + cache_size_per_token = calculate_cache_size_per_token(layers) + cache_size_bytes_per_token = cache_size_per_token * binding_dtype_size( + dtype) + required_mem_bytes_per_seq += window_size * cache_size_bytes_per_token + logger.debug( + f'Required memory per sequence: {required_mem_bytes_per_seq} bytes') + + if required_mem_bytes_per_seq < pool_memory_bytes: + # No need to adjust the window sizes. + return copy.deepcopy(window_size_to_layers) + + logger.debug( + f'Adjusting the window sizes {list(window_size_to_layers)} to fit ' + f'the memory {pool_memory_bytes} bytes.') + adjusted_window_size_to_layers = {} + + remaining_mem_bytes = pool_memory_bytes + remaining_layers = set(i for layers in window_size_to_layers.values() + for i in layers) + + accum_max_tokens = 0 + prev_window_size = 0 + + for window_size in sorted(window_size_to_layers): + layers = window_size_to_layers[window_size] + if remaining_mem_bytes > 0 and remaining_layers: + # Calculate cache size per token for remaining layers only + cache_size_per_token = calculate_cache_size_per_token( + remaining_layers) + cache_size_bytes_per_token = cache_size_per_token * binding_dtype_size( + dtype) + logger.debug( + f'Cache size per token for {len(remaining_layers)} layers: ' + f'{cache_size_bytes_per_token} bytes') + # Calculate max tokens that can fit in this window with remaining memory. + max_tokens_in_window = min( + remaining_mem_bytes // cache_size_bytes_per_token, + window_size - prev_window_size) + remaining_mem_bytes -= max_tokens_in_window * cache_size_bytes_per_token + accum_max_tokens += max_tokens_in_window + logger.debug(f'Remaining memory: {remaining_mem_bytes} bytes') + logger.debug( + f'Max token of window {window_size}: {accum_max_tokens}') + + if accum_max_tokens < window_size: + logger.debug( + f'Max tokens ({accum_max_tokens}) cannot fill the current window ({window_size}). ' + f'The larger windows will have the same max tokens.') + remaining_mem_bytes = 0 + + # Clamp the sequence length if provided explicitly. + if max_tokens_from_config is not None: + accum_max_tokens = min(max_tokens_from_config, + accum_max_tokens) + # If max tokens from config is reached, stop allocating + # more memory. Since the maximum number of tokens is + # already reached, for the remaining windows maxTokens + # will be set by the current value of accumMaxTokens. + if accum_max_tokens == max_tokens_from_config: + remaining_mem_bytes = 0 + + if accum_max_tokens not in adjusted_window_size_to_layers: + adjusted_window_size_to_layers[accum_max_tokens] = layers.copy() + else: + adjusted_window_size_to_layers[accum_max_tokens].extend(layers) + + remaining_layers -= set(layers) + prev_window_size = window_size + + return adjusted_window_size_to_layers + def calculate_max_num_blocks_from_cpp( self, kv_cache_config: KvCacheConfigCpp, @@ -622,6 +715,9 @@ def calculate_max_num_blocks_from_cpp( A dict of (max_attention_window, (blocks_in_primary_pool, blocks_in_secondary_pool)). """ + # VSWA on Torch backend has not supported the cross attention. + is_cross_attention = False + # Construct WorldConfig from self.mapping world_config_cpp = WorldConfig( tensor_parallelism=self.mapping.tp_size, @@ -636,12 +732,26 @@ def calculate_max_num_blocks_from_cpp( primary_pool_memory_bytes = free_mem secondary_pool_memory_bytes = 0 logger.debug( - f"primary_pool_memory_bytes is set to {primary_pool_memory_bytes/1024**3}GB, \nsecondary_pool_memory_bytes is set to {secondary_pool_memory_bytes/1024**3}GB" + f"primary_pool_memory_bytes is set to {primary_pool_memory_bytes/1024**3}GB, \n" + f"secondary_pool_memory_bytes is set to {secondary_pool_memory_bytes/1024**3}GB" + ) + + # Adjust the window sizes to fit the memory if even a single sequence + # cannot fit in the memory. + window_size_to_layers = self.adjust_window_sizes_for_vswa( + window_size_to_layers=window_size_to_layers, + model_config=model_config, + kv_cache_config=kv_cache_config, + pool_memory_bytes=primary_pool_memory_bytes, + kv_factor=self.kv_factor, + dtype=self.dtype, + is_cross_attention=is_cross_attention, ) blocks_per_window = KVCacheManagerCpp.calculate_max_num_blocks( config=kv_cache_config, - is_cross_attention=False, #TODO: support cross attention + # TODO: support cross attention + is_cross_attention=is_cross_attention, dtype=self.dtype, model_config=model_config, world_config=world_config_cpp, diff --git a/tensorrt_llm/_utils.py b/tensorrt_llm/_utils.py index 9c3197e7c93c..87144cb85c4e 100644 --- a/tensorrt_llm/_utils.py +++ b/tensorrt_llm/_utils.py @@ -180,6 +180,22 @@ def str_dtype_to_torch(dtype): fp8=DataType.FP8, ) +_binding_dtype_size = { + DataType.INT64: 8, + DataType.FLOAT: 4, + DataType.INT32: 4, + DataType.BF16: 2, + DataType.HALF: 2, + DataType.BOOL: 1, + DataType.FP8: 1, + DataType.INT8: 1, + DataType.UINT8: 1, +} + + +def binding_dtype_size(dtype: DataType): + return _binding_dtype_size[dtype] + def str_dtype_to_binding(dtype): ret = _str_to_binding_dtype_dict.get(dtype) diff --git a/tests/unittest/_torch/test_resource_manager.py b/tests/unittest/_torch/test_resource_manager.py index 0632834e4e6e..da1dae84ba1d 100644 --- a/tests/unittest/_torch/test_resource_manager.py +++ b/tests/unittest/_torch/test_resource_manager.py @@ -10,13 +10,15 @@ import tensorrt_llm import tensorrt_llm.bindings -from tensorrt_llm._torch.pyexecutor.resource_manager import (PeftCacheConfig, +from tensorrt_llm._torch.pyexecutor.resource_manager import (KVCacheManager, + PeftCacheConfig, PeftCacheManager) from tensorrt_llm.bindings import ModelConfig as ModelConfigCpp from tensorrt_llm.bindings import executor as tllm from tensorrt_llm.bindings.internal.batch_manager import \ PeftTaskNotCachedException +DataType = tensorrt_llm.bindings.DataType LoraModule = tensorrt_llm.bindings.LoraModule LoraModuleType = tensorrt_llm.bindings.LoraModuleType current_dir = pathlib.Path(__file__).parent.resolve() @@ -66,7 +68,15 @@ def __init__(self): self.num_rnn_layers = 0 self.num_attention_heads = 1 self.hidden_size = 16 - self.data_type = tensorrt_llm.bindings.DataType.HALF + self.data_type = DataType.HALF + + @property + def num_kv_heads_per_layer(self): + return [self.num_attention_heads] * self.num_attention_layers + + @property + def head_size(self): + return self.hidden_size // self.num_attention_heads class MockPeftCacheManagerConfig: """ @@ -416,3 +426,105 @@ def test_put_get(self): self.assertEqual(entry.layer_id, expected_values[i][5]) self.assertEqual(entry.adapter_size, expected_values[i][6]) self.assertEqual(entry.num_slots, expected_values[i][7]) + + def test_adjust_window_sizes_for_vswa(self): + window_size_to_layers = { + 100: [0, 1, 2, 3], + 200: [4, 5, 6], + 7000: [7, 8], + } + + model_config = self.MockModelConfig() + model_config.num_attention_heads = 2 + model_config.hidden_size = 2 + model_config.data_type = DataType.HALF + + total_layers = [ + i for layers in window_size_to_layers.values() for i in layers + ] + + model_config.num_hidden_layers = len(total_layers) + model_config.num_attention_layers = len(total_layers) + + kv_factor = 2 + cache_bytes_per_token_per_layer = 8 + + # Define test cases: + # (memory_bytes, expected_window_sizes, max_tokens, description) + # If max_tokens is None, then it will use the default value of KvCacheConfig. + test_cases = [ + ( + # Case 1: Limited memory - windows get clamped + cache_bytes_per_token_per_layer * (100 * 9 + 30 * 5) + 4, + { + 100: [0, 1, 2, 3], + 130: [4, 5, 6, 7, 8], + }, + None, + "limited_memory_clamped_windows"), + ( + # Case 2: Less limited memory - the largest window get clamped + cache_bytes_per_token_per_layer * + (100 * 9 + 100 * 5 + 817 * 2) + 4, + { + 100: [0, 1, 2, 3], + 200: [4, 5, 6], + 1017: [7, 8], + }, + None, + "less_limited_memory_clamped_windows"), + ( + # Case 3: Sufficient memory - no clamping needed + cache_bytes_per_token_per_layer * + (100 * 4 + 200 * 3 + 7000 * 2) + 9402, + { + 100: [0, 1, 2, 3], + 200: [4, 5, 6], + 7000: [7, 8], + }, + None, + "sufficient_memory_no_clamping"), + ( + # Case 4: Very limited memory - all windows get small values + cache_bytes_per_token_per_layer * (51 * 9) + 1, + { + 51: [0, 1, 2, 3, 4, 5, 6, 7, 8], + }, + None, + "very_limited_memory_all_clamped"), + ( + # Case 5: Less limited memory but max_tokens is given. + # memory is enough for 1017 tokens, it will be clamped by max_tokens=134. + cache_bytes_per_token_per_layer * + (100 * 9 + 100 * 5 + 817 * 2) + 4, + { + 100: [0, 1, 2, 3], + 134: [4, 5, 6, 7, 8], + }, + 134, + "less_limited_memory_but_clamped_by_max_tokens"), + ] + + for memory_bytes, expected_window_sizes, max_tokens, description in test_cases: + with self.subTest(case=description, memory_bytes=memory_bytes): + kv_cache_config = tllm.KvCacheConfig(max_tokens=max_tokens) + adjusted = KVCacheManager.adjust_window_sizes_for_vswa( + window_size_to_layers=window_size_to_layers, + model_config=model_config, + kv_cache_config=kv_cache_config, + pool_memory_bytes=memory_bytes, + kv_factor=kv_factor, + dtype=model_config.data_type, + is_cross_attention=False, + ) + + self.assertEqual( + adjusted, expected_window_sizes, + f"Test case '{description}' failed.\n" + f"Memory bytes: {memory_bytes}\n" + f"Actual: {adjusted}\n" + f"Expected: {expected_window_sizes}") + + +if __name__ == "__main__": + unittest.main() From 9ebc3ab9c421c64e951daab535c27f4e7d99ce68 Mon Sep 17 00:00:00 2001 From: MinaHuai <121143971+MinaHuai@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:01:35 +0800 Subject: [PATCH 005/178] [nvbugs/5385972][nvbugs/5387423][Fix] Minor fix for llava_next/llava_onevision (#5998) Signed-off-by: Mina Huai <121143971+MinaHuai@users.noreply.github.com> --- tensorrt_llm/runtime/multimodal_model_runner.py | 4 ++-- tensorrt_llm/tools/multimodal_builder.py | 4 ++-- tests/integration/test_lists/waives.txt | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tensorrt_llm/runtime/multimodal_model_runner.py b/tensorrt_llm/runtime/multimodal_model_runner.py index 9d6be2bddad8..bb3a5480fcb6 100644 --- a/tensorrt_llm/runtime/multimodal_model_runner.py +++ b/tensorrt_llm/runtime/multimodal_model_runner.py @@ -2647,7 +2647,7 @@ def setup_inputs(self, input_text, raw_image, raw_audio=None): ) image = None elif self.model_type in ['llava_onevision']: - pre_prompt = "<|im_start|>user " + pre_prompt = "<|im_start|>user " + "