@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / d7e1e59972
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 14, 05:30 UTC

[Doc]: fix typos in Python comments (#24093)

Signed-off-by: Didier Durand <durand.didier@gmail.com>

Didier Durand committed Sep 3, 2025 at 06:05 UTC d7e1e599724ea82e12f40bd2b9320b5c27b23a32
15 files changed +23 -23
tests/core/test_scheduler.py
+1 -1
@@ -641,7 +641,7 @@ def test_schedule_decode_blocks_to_copy_update():
641 # Nothing is preempted.
642 assert output.blocks_to_swap_out == []
643 # Since append_slot returns the source -> dist mapping, it should
644 - # applied.
644 + # be applied.
645 assert output.blocks_to_copy == [(2, 3)]
646
647
tests/entrypoints/openai/correctness/test_transcription_api_correctness.py
+1 -1
@@ -32,7 +32,7 @@ def to_bytes(y, sr):
32
33 async def transcribe_audio(client, tokenizer, y, sr):
34 # Send loaded audio directly instead of loading from disk,
35 - # dont account for that time though
35 + # don't account for that time though
36 with to_bytes(y, sr) as f:
37 start_time = time.perf_counter()
38 transcription = await client.audio.transcriptions.create(
tests/entrypoints/openai/test_return_token_ids.py
+1 -1
@@ -224,7 +224,7 @@ async def test_comparison_with_prompt_logprobs_and_logprobs(server):
224 logprobs_token_ids.append(token_id)
225
226 # When echo=True, the logprobs include both prompt and response tokens
227 - # The token_ids field should match the the suffix of response portion
227 + # The token_ids field should match the suffix of response portion
228 # The prompt_token_ids should match the prompt portion
229 assert len(completion.choices[0].token_ids) < len(logprobs_token_ids)
230 response_token_ids_length = len(completion.choices[0].token_ids)
tests/entrypoints/openai/test_serving_chat.py
+1 -1
@@ -313,7 +313,7 @@ async def test_serving_chat_did_set_correct_cache_salt(model_type):
313 }],
314 )
315
316 - # By default cache_salt in the engine prompt is not set
316 + # By default, cache_salt in the engine prompt is not set
317 with suppress(Exception):
318 await serving_chat.create_chat_completion(req)
319 assert "cache_salt" not in mock_engine.generate.call_args.args[0]
tests/kernels/utils.py
+1 -1
@@ -1236,7 +1236,7 @@ def baseline_scaled_mm(a: torch.Tensor,
1236 bias: Optional[torch.Tensor] = None) -> torch.Tensor:
1237
1238 # We treat N-dimensional group scaling as extended numpy-style broadcasting
1239 - # in numpy simply stretches dimensions with an extent of 1 to match the
1239 + # in numpy simply stretches dimensions with an extent of 1 to match
1240 # the target shape by repeating the data along that dimension (broadcasting)
1241 # , we extend these semantics to say if the extent of a dimension in the
1242 # source shape is not 1 and does not match the target shape we repeat each
tests/multimodal/test_utils.py
+2 -2
@@ -458,7 +458,7 @@ def run_dp_sharded_vision_model_vs_direct(local_rank: int, world_size: int,
458 with torch.inference_mode():
459 sharded_output = run_dp_sharded_vision_model(image_input, vision_model)
460
461 - # Check that the world size is setup correctly
461 + # Check that the world size is set up correctly
462 assert get_tensor_model_parallel_world_size() == world_size
463
464 # Check that the outputs have the same shape
@@ -642,7 +642,7 @@ def run_dp_sharded_mrope_vision_model_vs_direct(local_rank: int,
642 rope_type="rope_3d")
643 sharded_output = torch.cat(sharded_output, dim=0)
644
645 - # Check that the world size is setup correctly
645 + # Check that the world size is set up correctly
646 assert get_tensor_model_parallel_world_size() == world_size
647
648 # Compare outputs (only on rank 0)
tests/v1/e2e/test_spec_decode.py
+1 -1
@@ -83,7 +83,7 @@ def test_ngram_correctness(
83 model_name: str,
84 ):
85 '''
86 - Compare the outputs of a original LLM and a speculative LLM
86 + Compare the outputs of an original LLM and a speculative LLM
87 should be the same when using ngram speculative decoding.
88 '''
89 with monkeypatch.context() as m:
tests/v1/kv_connector/unit/test_remote_decode_lifecycle.py
+2 -2
@@ -42,7 +42,7 @@ def test_basic_lifecycle():
42 engine_core_outputs = scheduler.update_from_output(scheduler_output,
43 model_runner_output)
44
45 - # Ensure the request is finished after 1 tokens.
45 + # Ensure the request is finished after 1 token.
46 assert request.is_finished()
47 assert request.status == RequestStatus.FINISHED_LENGTH_CAPPED
48 output = engine_core_outputs[0].outputs[0]
@@ -141,7 +141,7 @@ def test_short_prompt_lifecycle():
141
142
143 def test_prefix_cache_lifecycle():
144 - """Test that remote decode params still works with a prefix cache hit."""
144 + """Test that remote decode params still work with a prefix cache hit."""
145
146 vllm_config = create_vllm_config()
147 scheduler = create_scheduler(vllm_config)
tests/v1/spec_decode/test_tree_attention.py
+2 -2
@@ -187,7 +187,7 @@ def test_tree_attn_correctness() -> None:
187 dtype=torch.bfloat16,
188 )
189
190 - # Setup the block table and KV cache for paged KV.
190 + # Set up the block table and KV cache for paged KV.
191 assert max_sequence_length % block_size == 0
192 max_blocks_per_batch = max_sequence_length // block_size
193 kv_cache = torch.randn(
@@ -222,7 +222,7 @@ def test_tree_attn_correctness() -> None:
222 num_alloc_blocks_per_batch] = block_ids.view(
223 -1, num_alloc_blocks_per_batch)
224
225 - # Setup the slot mapping for the input KVs.
225 + # Set up the slot mapping for the input KVs.
226 tree_positions = sequence_position + torch.arange(
227 0,
228 tree_size_q,
vllm/lora/utils.py
+1 -1
@@ -239,7 +239,7 @@ def get_adapter_absolute_path(lora_path: str) -> str:
239 except (HfHubHTTPError, RepositoryNotFoundError, EntryNotFoundError,
240 HFValidationError):
241 # Handle errors that may occur during the download
242 - # Return original path instead instead of throwing error here
242 + # Return original path instead of throwing error here
243 logger.exception("Error downloading the HuggingFace model")
244 return lora_path
245
vllm/model_executor/layers/quantization/compressed_tensors/utils.py
+1 -1
@@ -94,7 +94,7 @@ def find_matched_target(
94 config that a layer corresponds to.
95
96 Recall that a compressed-tensors configs has a concept of
97 - config_groups, where each layer can be quantized with with a different
97 + config_groups, where each layer can be quantized with a different
98 scheme.
99
100 targets in each config_group will be a list of either layer names
vllm/multimodal/utils.py
+5 -5
@@ -213,7 +213,7 @@ class MediaConnector:
213 image_mode: str = "RGB",
214 ) -> Image.Image:
215 """
216 - Load a PIL image from a HTTP or base64 data URL.
216 + Load a PIL image from an HTTP or base64 data URL.
217
218 By default, the image is converted into RGB format.
219 """
@@ -237,7 +237,7 @@ class MediaConnector:
237 image_mode: str = "RGB",
238 ) -> Image.Image:
239 """
240 - Asynchronously load a PIL image from a HTTP or base64 data URL.
240 + Asynchronously load a PIL image from an HTTP or base64 data URL.
241
242 By default, the image is converted into RGB format.
243 """
@@ -261,7 +261,7 @@ class MediaConnector:
261 image_mode: str = "RGB",
262 ) -> tuple[npt.NDArray, dict[str, Any]]:
263 """
264 - Load video from a HTTP or base64 data URL.
264 + Load video from an HTTP or base64 data URL.
265 """
266 image_io = ImageMediaIO(image_mode=image_mode,
267 **self.media_io_kwargs.get("image", {}))
@@ -281,7 +281,7 @@ class MediaConnector:
281 image_mode: str = "RGB",
282 ) -> tuple[npt.NDArray, dict[str, Any]]:
283 """
284 - Asynchronously load video from a HTTP or base64 data URL.
284 + Asynchronously load video from an HTTP or base64 data URL.
285
286 By default, the image is converted into RGB format.
287 """
@@ -370,7 +370,7 @@ def group_mm_inputs_by_modality(
370
371 def modality_group_func(
372 mm_input: MultiModalKwargsItems) -> Union[str, int]:
373 - # If the input has multiple modalities, return a id as the unique key
373 + # If the input has multiple modalities, return an id as the unique key
374 # for the mm_input input.
375 if len(mm_input) > 1:
376 return id(mm_input)
vllm/v1/attention/backends/utils.py
+1 -1
@@ -709,7 +709,7 @@ def reorder_batch_to_split_decodes_and_prefills(
709
710 for i, req_id in enumerate(input_batch.req_ids):
711 num_tokens = scheduler_output.num_scheduled_tokens[req_id]
712 - # for now treat 1 scheduled token as "decode" even if its not,
712 + # for now treat 1 scheduled token as "decode" even if it's not,
713 # we should update this to something like < 8 in the future but
714 # currently the TritonMLA._forward_decode only supports
715 # num_tokens = 1
vllm/v1/structured_output/utils.py
+2 -2
@@ -65,9 +65,9 @@ def get_outlines_cache_path() -> str:
65 elif xdg_cache_home:
66 return os.path.join(xdg_cache_home, ".cache", "outlines")
67 # If homedir is "/", we may be inside a container, and thus writing to
68 - # root would be problematic, so we fallback to using a tempfile.
68 + # root would be problematic, so we fall back to using a tempfile.
69 # Also validate the path exists, since os.path.expanduser does
70 - # not garuntee existence.
70 + # not guarantee existence.
71 elif os.path.isdir(home_dir) and home_dir != "/":
72 # Default Unix fallback: ~/.cache/outlines
73 return os.path.join(home_dir, ".cache", "outlines")
vllm/v1/worker/tpu_worker.py
+1 -1
@@ -250,7 +250,7 @@ class TPUWorker:
250 scheduler_output: "SchedulerOutput",
251 ) -> Optional[ModelRunnerOutput]:
252 output = self.model_runner.execute_model(scheduler_output)
253 - # every worker's output is needed when kv_transfer_group is setup
253 + # every worker's output is needed when kv_transfer_group is set up
254 return output if self.is_driver_worker or has_kv_transfer_group(
255 ) else None
256