A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 8, 07:30 UTC
[bug] Make sure get_modality_with_max_tokens is deterministic (#34533)
Signed-off-by: Shiyan Deng <dsy842974287@meta.com>
Shiyan Deng committed
Feb 13, 2026 at 20:02 UTC
ed242652d7f9cb4222e8840311b5229295b5d266
1 file changed
+1
-1
vllm/multimodal/encoder_budget.py
+1
-1
@@ -181,7 +181,7 @@ class MultiModalBudget:
181
182
def get_modality_with_max_tokens(self) -> str:
183
mm_max_toks_per_item = self.mm_max_toks_per_item
184
- modality, _ = max(mm_max_toks_per_item.items(), key=lambda x: x[1])
184
+ modality, _ = max(mm_max_toks_per_item.items(), key=lambda x: (x[1], x[0]))
185
186
return modality
187