@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 2eb673a088
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 9, 12:30 UTC

Add flake8-implicit-str-concat rules to Ruff (#33191)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

Harry Mellor committed Jan 28, 2026 at 04:56 UTC 2eb673a088a107f2ea4ea792593038462874a5f7
16 files changed +34 -33
.buildkite/performance-benchmarks/scripts/convert-results-json-to-markdown.py
+1 -1
@@ -393,7 +393,7 @@ if __name__ == "__main__":
393 with open(results_folder / md_file, "w") as f:
394 results = read_markdown(
395 "../.buildkite/performance-benchmarks/"
396 - + "performance-benchmarks-descriptions.md"
396 + "performance-benchmarks-descriptions.md"
397 )
398 results = results.format(
399 latency_tests_markdown_table=latency_md_table,
csrc/quantization/machete/generate.py
+3 -3
@@ -288,8 +288,8 @@ def generate_sch_sig(schedule_config: ScheduleConfig) -> str:
288 )
289 cluster_shape = (
290 f"{schedule_config.cluster_shape_mnk[0]}"
291 - + f"x{schedule_config.cluster_shape_mnk[1]}"
292 - + f"x{schedule_config.cluster_shape_mnk[2]}"
291 + f"x{schedule_config.cluster_shape_mnk[1]}"
292 + f"x{schedule_config.cluster_shape_mnk[2]}"
293 )
294 kernel_schedule = VLLMKernelScheduleTag[schedule_config.kernel_schedule].split(
295 "::"
@@ -301,7 +301,7 @@ def generate_sch_sig(schedule_config: ScheduleConfig) -> str:
301
302 return (
303 f"{tile_shape}_{cluster_shape}_{kernel_schedule}"
304 - + f"_{epilogue_schedule}_{tile_scheduler}"
304 + f"_{epilogue_schedule}_{tile_scheduler}"
305 )
306
307
examples/offline_inference/automatic_prefix_caching.py
+1 -1
@@ -26,7 +26,7 @@ from vllm import LLM, SamplingParams
26 # A prompt containing a large markdown table. The table is randomly generated by GPT-4.
27 LONG_PROMPT = (
28 "You are a helpful assistant in recognizes the content of tables in markdown format. Here is a table as follows.\n# Table\n"
29 - + """
29 + """
30 | ID | Name | Age | Occupation | Country | Email | Phone Number | Address |
31 |-----|---------------|-----|---------------|---------------|------------------------|----------------|------------------------------|
32 | 1 | John Doe | 29 | Engineer | USA | john.doe@example.com | 555-1234 | 123 Elm St, Springfield, IL |
examples/others/lmcache/disagg_prefill_lmcache_v1/disagg_proxy_server.py
+4 -4
@@ -69,10 +69,10 @@ class StatsCalculator:
69 np_arr = np.array(self._stats)
70 output_str = (
71 f"\nNum requests: {len(self._stats)}"
72 - + "\nPrefill node TTFT stats:"
73 - + f"\n - Average (ms): {np.mean(np_arr)}"
74 - + f"\n - Median (ms): {np.median(np_arr)}"
75 - + f"\n - 99th Percentile (ms): {np.percentile(np_arr, 99)}\n"
72 + "\nPrefill node TTFT stats:"
73 + f"\n - Average (ms): {np.mean(np_arr)}"
74 + f"\n - Median (ms): {np.median(np_arr)}"
75 + f"\n - 99th Percentile (ms): {np.percentile(np_arr, 99)}\n"
76 )
77 print(
78 "===============================",
pyproject.toml
+2
@@ -72,6 +72,8 @@ select = [
72 "UP",
73 # flake8-bugbear
74 "B",
75 + # flake8-implicit-str-concat
76 + "ISC",
77 # flake8-simplify
78 "SIM",
79 # isort
tests/entrypoints/openai/tool_parsers/test_llama4_pythonic_tool_parser.py
+1 -1
@@ -193,7 +193,7 @@ TEST_CASES = [
193 pytest.param(
194 False,
195 "<|python_start|>[get_weather(city='LA', metric='C'), "
196 - + "register_user(name='Doe', age=9)]",
196 + "register_user(name='Doe', age=9)]",
197 [
198 SIMPLE_FUNCTION_CALL,
199 FunctionCall(name="register_user", arguments='{"name": "Doe", "age": 9}'),
tests/tool_parsers/test_deepseekv31_tool_parser.py
+8 -8
@@ -24,9 +24,9 @@ def parser(deepseekv31_tokenizer):
24 def test_extract_tool_calls_with_tool(parser):
25 model_output = (
26 "normal text"
27 - + "<|tool▁calls▁begin|>"
28 - + '<|tool▁call▁begin|>foo<|tool▁sep|>{"x":1}<|tool▁call▁end|>'
29 - + "<|tool▁calls▁end|>"
27 + "<|tool▁calls▁begin|>"
28 + '<|tool▁call▁begin|>foo<|tool▁sep|>{"x":1}<|tool▁call▁end|>'
29 + "<|tool▁calls▁end|>"
30 )
31 result = parser.extract_tool_calls(model_output, None)
32 assert result.tools_called
@@ -39,11 +39,11 @@ def test_extract_tool_calls_with_tool(parser):
39 def test_extract_tool_calls_with_multiple_tools(parser):
40 model_output = (
41 "some prefix text"
42 - + "<|tool▁calls▁begin|>"
43 - + '<|tool▁call▁begin|>foo<|tool▁sep|>{"x":1}<|tool▁call▁end|>'
44 - + '<|tool▁call▁begin|>bar<|tool▁sep|>{"y":2}<|tool▁call▁end|>'
45 - + "<|tool▁calls▁end|>"
46 - + " some suffix text"
42 + "<|tool▁calls▁begin|>"
43 + '<|tool▁call▁begin|>foo<|tool▁sep|>{"x":1}<|tool▁call▁end|>'
44 + '<|tool▁call▁begin|>bar<|tool▁sep|>{"y":2}<|tool▁call▁end|>'
45 + "<|tool▁calls▁end|>"
46 + " some suffix text"
47 )
48
49 result = parser.extract_tool_calls(model_output, None)
tests/utils.py
+1 -1
@@ -1302,7 +1302,7 @@ def prep_prompts(batch_size: int, ln_range: tuple[int, int] = (800, 1100)):
1302 indices.append(idx)
1303 prompt = (
1304 "```python\n# We set a number of variables, "
1305 - + f"x{idx} will be important later\n"
1305 + f"x{idx} will be important later\n"
1306 )
1307 ln = random.randint(*ln_range)
1308 for k in range(30, ln):
vllm/benchmarks/datasets.py
+1 -2
@@ -134,8 +134,7 @@ class BenchmarkDataset(ABC):
134 content.append(mm_content)
135 else:
136 raise TypeError(
137 - "Could not process multimodal content of type: "
138 - + f"{type(mm_content)}"
137 + f"Could not process multimodal content of type: {type(mm_content)}"
138 )
139 return [{"role": "user", "content": content}]
140
vllm/compilation/wrapper.py
+2 -2
@@ -208,8 +208,8 @@ class TorchCompileWithNoGuardsWrapper:
208 if not hasattr(self._compiled_callable, "aot_compile"):
209 raise RuntimeError(
210 "aot_compile is not supported by the current configuration. "
211 - + "Please make sure torch.compile is enabled with the latest "
212 - + f"version of PyTorch (current using torch: {torch.__version__})"
211 + "Please make sure torch.compile is enabled with the latest "
212 + f"version of PyTorch (current using torch: {torch.__version__})"
213 )
214 return self._compiled_callable.aot_compile((args, kwargs))
215
vllm/entrypoints/openai/translations/speech_to_text.py
+2 -2
@@ -406,8 +406,8 @@ class OpenAISpeechToText(OpenAIServing):
406
407 if request.response_format not in ["text", "json", "verbose_json"]:
408 return self.create_error_response(
409 - ("Currently only support response_format")
410 - + ("`text`, `json` or `verbose_json`")
409 + "Currently only support response_format: "
410 + "`text`, `json` or `verbose_json`"
411 )
412
413 if (
vllm/model_executor/layers/quantization/kernels/scaled_mm/aiter.py
+4 -4
@@ -32,8 +32,8 @@ class AiterInt8ScaledMMLinearKernel(CutlassInt8ScaledMMLinearKernel):
32 return (
33 False,
34 "requires setting `VLLM_ROCM_USE_AITER=1` "
35 - + "and `VLLM_ROCM_USE_AITER_LINEAR=1`. "
36 - + "`VLLM_ROCM_USE_AITER_LINEAR` default is True.",
35 + "and `VLLM_ROCM_USE_AITER_LINEAR=1`. "
36 + "`VLLM_ROCM_USE_AITER_LINEAR` default is True.",
37 )
38 return True, None
39
@@ -97,9 +97,9 @@ class AiterInt8ScaledMMLinearKernel(CutlassInt8ScaledMMLinearKernel):
97 per_token_scale_a and per_channel_scale_b
98 ), (
99 "Currently only support per-tensor-per-tensor GEMM "
100 - + " and per-token-per-channel GEMM through AITER"
100 + " and per-token-per-channel GEMM through AITER"
101 " w8a8 scaled gemm. `AiterInt8ScaledMMLinearKernel` "
102 - + "does not support AITER block scaled GEMM."
102 + "does not support AITER block scaled GEMM."
103 )
104
105 # gemm_a8w8_CK(a, b, scale_a, scale_b, bias) expects
vllm/reasoning/olmo3_reasoning_parser.py
+1 -1
@@ -234,7 +234,7 @@ class Olmo3ReasoningParser(ReasoningParser):
234 # reasoning template.
235 reasoning_expr = (
236 rf"^(?:{self.think_start})?(?P<reasoning>.*?)"
237 - + rf"{self.think_end}(?P<content>.*)$"
237 + rf"{self.think_end}(?P<content>.*)$"
238 )
239 self.reasoning_regex = re.compile(reasoning_expr, re.DOTALL)
240
vllm/v1/attention/backends/mla/flashattn_mla.py
+1 -1
@@ -216,7 +216,7 @@ class FlashAttnMLAMetadataBuilder(MLACommonMetadataBuilder[FlashAttnMLAMetadata]
216 # Ensure the persistent buffer is large enough
217 assert n <= self.scheduler_metadata.shape[0], (
218 f"Scheduler metadata size {n} exceeds buffer size "
219 - + f"{self.scheduler_metadata.shape[0]}"
219 + f"{self.scheduler_metadata.shape[0]}"
220 )
221 self.scheduler_metadata[:n] = scheduler_metadata
222 # NOTE(woosuk): We should zero out the rest of the scheduler
vllm/v1/core/single_type_kv_cache_manager.py
+1 -1
@@ -646,7 +646,7 @@ class ChunkedLocalAttentionManager(SingleTypeKVCacheManager):
646 """
647 assert isinstance(kv_cache_spec, ChunkedLocalAttentionSpec), (
648 "ChunkedLocalAttentionManager can only be used for "
649 - + "chunked local attention groups"
649 + "chunked local attention groups"
650 )
651 assert use_eagle is False, (
652 "Hybrid KV cache is not supported for " + "eagle + chunked local attention."
vllm/v1/engine/async_llm.py
+1 -1
@@ -618,7 +618,7 @@ class AsyncLLM(EngineClient):
618 except Exception as e2:
619 s = (
620 f"{e.__class__.__name__}: "
621 - + "error during printing an exception of class"
621 + "error during printing an exception of class"
622 + e2.__class__.__name__
623 )
624 logger.info("Request %s failed due to %s.", request_id, s)