mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-21 19:25:44 +08:00
[Docs] Fix warnings in mkdocs build (continued) (#25042)
Signed-off-by: wwl2755 <wangwenlong2755@gmail.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
parent
c2fdc71c91
commit
dad5f4d16d
@ -15,7 +15,7 @@ is used by model runners to dispatch data processing according to the target
|
||||
model.
|
||||
|
||||
Info:
|
||||
[mm_processing](../../../design/mm_processing.html)
|
||||
[mm_processing](../../../design/mm_processing.md)
|
||||
"""
|
||||
|
||||
__all__ = [
|
||||
|
||||
@ -3273,7 +3273,7 @@ def check_use_alibi(model_config: ModelConfig) -> bool:
|
||||
and getattr(cfg.attn_config, "alibi", False)))))
|
||||
|
||||
|
||||
def sha256(input) -> bytes:
|
||||
def sha256(input: Any) -> bytes:
|
||||
"""Hash any picklable Python object using SHA-256.
|
||||
|
||||
The input is serialized using pickle before hashing, which allows
|
||||
@ -3290,7 +3290,7 @@ def sha256(input) -> bytes:
|
||||
return hashlib.sha256(input_bytes).digest()
|
||||
|
||||
|
||||
def sha256_cbor(input) -> bytes:
|
||||
def sha256_cbor(input: Any) -> bytes:
|
||||
"""
|
||||
Hash objects using CBOR serialization and SHA-256.
|
||||
|
||||
|
||||
@ -205,7 +205,8 @@ def gather_mm_placeholders(
|
||||
"""
|
||||
Reconstructs the embeddings from the placeholder tokens.
|
||||
|
||||
This is the operation of [scatter_mm_placeholders][].
|
||||
This is the operation of [`scatter_mm_placeholders`]
|
||||
[vllm.v1.worker.utils.scatter_mm_placeholders].
|
||||
"""
|
||||
if is_embed is None:
|
||||
return placeholders
|
||||
|
||||
@ -1810,7 +1810,8 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
|
||||
|
||||
return [output]
|
||||
|
||||
def need_recv_kv(self, model_input, kv_caches) -> bool:
|
||||
def need_recv_kv(self, model_input: ModelInputForGPUWithSamplingMetadata,
|
||||
kv_caches: List[torch.Tensor]) -> bool:
|
||||
"""Check if we need to receive kv-cache from the other worker.
|
||||
We need to receive KV when
|
||||
1. current vLLM instance is KV cache consumer/decode vLLM instance
|
||||
@ -1825,6 +1826,9 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
|
||||
if self.vllm_config.kv_transfer_config is None:
|
||||
return False
|
||||
|
||||
if model_input.attn_metadata is None:
|
||||
raise ValueError("model_input.attn_metadata cannot be None")
|
||||
|
||||
prefill_meta = model_input.attn_metadata.prefill_metadata
|
||||
|
||||
# check if the current run is profiling
|
||||
@ -1835,7 +1839,8 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
|
||||
return self.vllm_config.kv_transfer_config.is_kv_consumer and (
|
||||
not is_profile_run) and is_prefill_run
|
||||
|
||||
def need_send_kv(self, model_input, kv_caches) -> bool:
|
||||
def need_send_kv(self, model_input: ModelInputForGPUWithSamplingMetadata,
|
||||
kv_caches: List[torch.Tensor]) -> bool:
|
||||
"""Check if we need to send kv-cache to the other worker.
|
||||
We need to send KV when
|
||||
1. current vLLM instance is KV cache producer/prefill vLLM instance
|
||||
@ -1850,6 +1855,9 @@ class ModelRunner(GPUModelRunnerBase[ModelInputForGPUWithSamplingMetadata]):
|
||||
if self.vllm_config.kv_transfer_config is None:
|
||||
return False
|
||||
|
||||
if model_input.attn_metadata is None:
|
||||
raise ValueError("model_input.attn_metadata cannot be None")
|
||||
|
||||
prefill_meta = model_input.attn_metadata.prefill_metadata
|
||||
|
||||
# check if the current run is profiling
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user