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
[Docs] Fix warnings in mkdocs build (continued) (#25042)
Signed-off-by: wwl2755 <wangwenlong2755@gmail.com>
Wenlong Wang committed
Sep 20, 2025 at 04:45 UTC
032d661d27db873ddd71ffb609c79c581b3f27b9
7 files changed
+24
-15
vllm/multimodal/__init__.py
+1
-1
@@ -15,7 +15,7 @@ is used by model runners to dispatch data processing according to the target
15
model.
16
17
Info:
18
- [mm_processing](../../../design/mm_processing.html)
18
+ [mm_processing](../../../design/mm_processing.md)
19
"""
20
21
__all__ = [
vllm/utils/__init__.py
+3
-3
@@ -3216,7 +3216,7 @@ def cprofile_context(save_file: Optional[str] = None):
3216
3217
Args:
3218
save_file: path to save the profile result. "1" or
3219
- None will result in printing to stdout.
3219
+ None will result in printing to stdout.
3220
"""
3221
import cProfile
3222
@@ -3273,7 +3273,7 @@ def check_use_alibi(model_config: ModelConfig) -> bool:
3273
and getattr(cfg.attn_config, "alibi", False)))))
3274
3275
3276
-def sha256(input) -> bytes:
3276
+def sha256(input: Any) -> bytes:
3277
"""Hash any picklable Python object using SHA-256.
3278
3279
The input is serialized using pickle before hashing, which allows
@@ -3290,7 +3290,7 @@ def sha256(input) -> bytes:
3290
return hashlib.sha256(input_bytes).digest()
3291
3292
3293
-def sha256_cbor(input) -> bytes:
3293
+def sha256_cbor(input: Any) -> bytes:
3294
"""
3295
Hash objects using CBOR serialization and SHA-256.
3296
vllm/v1/core/kv_cache_utils.py
+2
-2
@@ -1229,8 +1229,8 @@ def get_kv_cache_configs(vllm_config: VllmConfig,
1229
Args:
1230
vllm_config: The global VllmConfig
1231
kv_cache_specs: List of dict[layer_name, KVCacheSpec] for each worker.
1232
- available_memory: Memory available for KV cache in bytes for each
1233
- worker.
1232
+ available_memory: Memory available for KV cache in bytes for each
1233
+ worker.
1234
1235
Returns:
1236
The generated KVCacheConfigs for each worker.
vllm/v1/sample/rejection_sampler.py
+5
-5
@@ -351,17 +351,17 @@ def generate_uniform_probs(
351
without a seed.
352
353
Args:
354
- num_tokens : int
354
+ num_tokens: int
355
Total number of tokens.
356
- num_draft_tokens : List[List[int]]
356
+ num_draft_tokens: List[List[int]]
357
Number of draft tokens per request.
358
- generators : Optional[Dict[int, torch.Generator]]
358
+ generators: Optional[Dict[int, torch.Generator]]
359
A dictionary mapping indices in the batch to
360
`torch.Generator` objects.
361
- device : torch.device
361
+ device: torch.device
362
The device on which to allocate the tensor.
363
Returns:
364
- uniform_rand : torch.Tensor
364
+ uniform_rand: torch.Tensor
365
A tensor of shape `(num_tokens, )` containing uniform
366
random values in the range [0, 1).
367
"""
vllm/v1/worker/gpu_model_runner.py
+1
-1
@@ -1479,7 +1479,7 @@ class GPUModelRunner(LoRAModelRunnerMixin, KVConnectorModelRunnerMixin):
1479
1480
Args:
1481
scheduler_output: The scheduler output containing scheduled encoder
1482
- inputs.
1482
+ inputs.
1483
1484
Returns:
1485
A tuple of (mm_kwargs, req_ids_pos) where:
vllm/v1/worker/utils.py
+2
-1
@@ -205,7 +205,8 @@ def gather_mm_placeholders(
205
"""
206
Reconstructs the embeddings from the placeholder tokens.
207
208
- This is the operation of [scatter_mm_placeholders][].
208
+ This is the operation of [`scatter_mm_placeholders`]
209
+ [vllm.v1.worker.utils.scatter_mm_placeholders].
210
"""
211
if is_embed is None:
212
return placeholders
vllm/worker/model_runner.py
+10
-2
@@ -1810,7 +1810,8 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
1810
1811
return [output]
1812
1813
- def need_recv_kv(self, model_input, kv_caches) -> bool:
1813
+ def need_recv_kv(self, model_input: ModelInputForGPUWithSamplingMetadata,
1814
+ kv_caches: List[torch.Tensor]) -> bool:
1815
"""Check if we need to receive kv-cache from the other worker.
1816
We need to receive KV when
1817
1. current vLLM instance is KV cache consumer/decode vLLM instance
@@ -1825,6 +1826,9 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
1826
if self.vllm_config.kv_transfer_config is None:
1827
return False
1828
1829
+ if model_input.attn_metadata is None:
1830
+ raise ValueError("model_input.attn_metadata cannot be None")
1831
+
1832
prefill_meta = model_input.attn_metadata.prefill_metadata
1833
1834
# check if the current run is profiling
@@ -1835,7 +1839,8 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
1839
return self.vllm_config.kv_transfer_config.is_kv_consumer and (
1840
not is_profile_run) and is_prefill_run
1841
1838
- def need_send_kv(self, model_input, kv_caches) -> bool:
1842
+ def need_send_kv(self, model_input: ModelInputForGPUWithSamplingMetadata,
1843
+ kv_caches: List[torch.Tensor]) -> bool:
1844
"""Check if we need to send kv-cache to the other worker.
1845
We need to send KV when
1846
1. current vLLM instance is KV cache producer/prefill vLLM instance
@@ -1850,6 +1855,9 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
1855
if self.vllm_config.kv_transfer_config is None:
1856
return False
1857
1858
+ if model_input.attn_metadata is None:
1859
+ raise ValueError("model_input.attn_metadata cannot be None")
1860
+
1861
prefill_meta = model_input.attn_metadata.prefill_metadata
1862
1863
# check if the current run is profiling