@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 619d3de8bd
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, 17:15 UTC

[TPU] [V1] fix cases when max_num_reqs is set smaller than MIN_NUM_SEQS (#15583)

Signed-off-by: Chengji Yao <chengjiyao@google.com>

Chengji Yao committed Mar 26, 2025 at 22:46 UTC 619d3de8bd54be017d8d8211259ea6ad4865ecbe
2 files changed +2 -5
examples/offline_inference/tpu.py
+1 -4
@@ -14,10 +14,7 @@ answers = [
14 ]
15 N = 1
16 # Currently, top-p sampling is disabled. `top_p` should be 1.0.
17 -sampling_params = SamplingParams(temperature=0.7,
18 - top_p=1.0,
19 - n=N,
20 - max_tokens=16)
17 +sampling_params = SamplingParams(temperature=0, top_p=1.0, n=N, max_tokens=16)
18
19 # Set `enforce_eager=True` to avoid ahead-of-time compilation.
20 # In real workloads, `enforace_eager` should be `False`.
vllm/v1/worker/tpu_model_runner.py
+1 -1
@@ -88,7 +88,7 @@ class TPUModelRunner:
88 self.max_model_len = model_config.max_model_len
89 self.max_num_blocks_per_req = cdiv(self.max_model_len, self.block_size)
90 self.max_num_tokens = scheduler_config.max_num_batched_tokens
91 - self.max_num_reqs = scheduler_config.max_num_seqs
91 + self.max_num_reqs = max(scheduler_config.max_num_seqs, MIN_NUM_SEQS)
92
93 # Model-related.
94 self.num_attn_layers = model_config.get_num_layers_by_block_type(