@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 66d433b94f
Fork 0

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 15, 16:00 UTC

[V1] Revert the default `max_num_seqs` to V0 values for most hardware (#16158)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>

Cyrus Leung committed Apr 8, 2025 at 01:54 UTC 66d433b94ffd215820c6c90d97ca0d511dc12143
3 files changed +6 -10
docs/source/getting_started/v1_user_guide.md
-7
@@ -156,10 +156,3 @@ vLLM V1 is currently optimized for decoder-only transformers. Models requiring
156 cross-attention between separate encoder and decoder are not yet supported (e.g., `BartForConditionalGeneration`, `MllamaForConditionalGeneration`).
157
158 For a complete list of supported models, see the [list of supported models](https://docs.vllm.ai/en/latest/models/supported_models.html).
159 -
160 -## Frequently Asked Questions
161 -
162 -**I'm using vLLM V1 and I'm getting CUDA OOM errors. What should I do?**
163 -The default `max_num_seqs` has been raised from `256` in V0 to `1024` in V1. If you encounter CUDA OOM only when using V1 engine, try setting a lower value of `max_num_seqs` or `gpu_memory_utilization`.
164 -
165 -On the other hand, if you get an error about insufficient memory for the cache blocks, you should increase `gpu_memory_utilization` as this indicates that your GPU has sufficient memory but you're not allocating enough to vLLM for KV cache blocks.
tests/v1/engine/test_engine_args.py
+4 -2
@@ -64,15 +64,17 @@ def test_defaults_with_usage_context():
64 # For H100 and H200, we use larger default values.
65 default_llm_tokens = 16384
66 default_server_tokens = 8192
67 + default_max_num_seqs = 1024
68 else:
69 default_llm_tokens = 8192
70 default_server_tokens = 2048
71 + default_max_num_seqs = 256
72
71 - assert vllm_config.scheduler_config.max_num_seqs == 1024
73 + assert vllm_config.scheduler_config.max_num_seqs == default_max_num_seqs
74 assert vllm_config.scheduler_config.max_num_batched_tokens == default_llm_tokens # noqa: E501
75
76 engine_args = EngineArgs(model="facebook/opt-125m")
77 vllm_config = engine_args.create_engine_config(
78 UsageContext.OPENAI_API_SERVER)
77 - assert vllm_config.scheduler_config.max_num_seqs == 1024
79 + assert vllm_config.scheduler_config.max_num_seqs == default_max_num_seqs
80 assert vllm_config.scheduler_config.max_num_batched_tokens == default_server_tokens # noqa: E501
vllm/engine/arg_utils.py
+2 -1
@@ -1666,12 +1666,14 @@ class EngineArgs:
1666 UsageContext.LLM_CLASS: 16384,
1667 UsageContext.OPENAI_API_SERVER: 8192,
1668 }
1669 + default_max_num_seqs = 1024
1670 else:
1671 # TODO(woosuk): Tune the default values for other hardware.
1672 default_max_num_batched_tokens = {
1673 UsageContext.LLM_CLASS: 8192,
1674 UsageContext.OPENAI_API_SERVER: 2048,
1675 }
1676 + default_max_num_seqs = 256
1677
1678 use_context_value = usage_context.value if usage_context else None
1679 if (self.max_num_batched_tokens is None
@@ -1682,7 +1684,6 @@ class EngineArgs:
1684 "Setting max_num_batched_tokens to %d for %s usage context.",
1685 self.max_num_batched_tokens, use_context_value)
1686
1685 - default_max_num_seqs = 1024
1687 if self.max_num_seqs is None:
1688 self.max_num_seqs = default_max_num_seqs
1689