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

[Misc] set single whitespace between log sentences (#13771)

Signed-off-by: cjackal <44624812+cjackal@users.noreply.github.com>

cjackal committed Feb 25, 2025 at 11:26 UTC 51010a1807e180df211542196b77a4fd66e94a7e
36 files changed +54 -54
vllm/attention/backends/flashinfer.py
+1 -1
@@ -438,7 +438,7 @@ class FlashInferMetadata(AttentionMetadata):
438 not in supported_head_sizes:
439 raise ValueError(
440 f"Only {supported_head_sizes} are supported for head_dim,",
441 - f"received {self.head_dim}.")
441 + f" received {self.head_dim}.")
442
443 def begin_forward(self):
444 if self.num_prefill_tokens > 0:
vllm/attention/backends/mla/common.py
+1 -1
@@ -533,7 +533,7 @@ class MLACommonMetadata(AttentionMetadata):
533 not in supported_head_sizes:
534 raise ValueError(
535 f"Only {supported_head_sizes} are supported for head_dim,",
536 - f"received {self.head_dim}.")
536 + f" received {self.head_dim}.")
537
538 @property
539 def prefill_metadata(self) -> Optional["MLACommonMetadata"]:
vllm/attention/backends/rocm_flash_attn.py
+2 -2
@@ -497,7 +497,7 @@ class ROCmFlashAttentionImpl(AttentionImpl):
497 if logits_soft_cap is not None:
498 raise ValueError(
499 "ROCm Triton FlashAttention does not support attention"
500 - "logits soft capping."
500 + " logits soft capping."
501 " please try using the ROCm CK "
502 "FA backend instead by setting the env var "
503 "`VLLM_USE_TRITON_FLASH_ATTN=0`")
@@ -528,7 +528,7 @@ class ROCmFlashAttentionImpl(AttentionImpl):
528 if self.use_naive_attn:
529 if logits_soft_cap is not None:
530 raise ValueError(
531 - "ROCm Naive FlashAttention does not support"
531 + "ROCm Naive FlashAttention does not support "
532 "attention logits soft capping.")
533
534 self.attn_func = _sdpa_attention
vllm/config.py
+6 -6
@@ -924,8 +924,8 @@ class ModelConfig:
924 layers_block_type_value = getattr(self.hf_config,
925 "layers_block_type", None)
926 if layers_block_type_value is None:
927 - raise ValueError("The model is an hybrid without a"
928 - "layers_block_type in the hf_config,"
927 + raise ValueError("The model is an hybrid without a "
928 + "layers_block_type in the hf_config, "
929 "cannot determine the num of "
930 f"{block_type.value} layers")
931
@@ -2516,7 +2516,7 @@ def _get_and_verify_dtype(
2516
2517 if current_platform.is_hpu() and config_dtype == torch.float16:
2518 logger.info(
2519 - "For HPU, we cast models to bfloat16 instead of"
2519 + "For HPU, we cast models to bfloat16 instead of "
2520 "using float16 by default. Please specify `dtype` if you "
2521 "want to use float16.")
2522 torch_dtype = torch.bfloat16
@@ -2732,7 +2732,7 @@ class DecodingConfig:
2732 backend=self.guided_decoding_backend).backend_name
2733 if backend not in valid_guided_backends:
2734 raise ValueError(f"Invalid guided_decoding_backend '{backend},"
2735 - f"must be one of {valid_guided_backends}")
2735 + f" must be one of {valid_guided_backends}")
2736
2737
2738 @dataclass
@@ -3008,7 +3008,7 @@ class CompilationConfig(BaseModel):
3008 def model_post_init(self, __context: Any) -> None:
3009 if not self.enable_reshape and self.enable_fusion:
3010 logger.warning_once(
3011 - "Fusion enabled but reshape elimination disabled."
3011 + "Fusion enabled but reshape elimination disabled. "
3012 "RMSNorm + quant (fp8) fusion might not work")
3013
3014 pass_config: PassConfig = Field(default_factory=PassConfig)
@@ -3563,7 +3563,7 @@ def set_current_vllm_config(vllm_config: VllmConfig, check_compile=False):
3563 logger.warning(
3564 "`torch.compile` is turned on, but the model %s"
3565 " does not support it. Please open an issue on GitHub"
3566 - "if you want it to be supported.",
3566 + " if you want it to be supported.",
3567 vllm_config.model_config.model)
3568 _current_vllm_config = old_vllm_config
3569
vllm/distributed/device_communicators/pynccl_wrapper.py
+2 -2
@@ -227,10 +227,10 @@ class NCCLLibrary:
227 self.lib = NCCLLibrary.path_to_library_cache[so_file]
228 except Exception as e:
229 logger.error(
230 - "Failed to load NCCL library from %s ."
230 + "Failed to load NCCL library from %s. "
231 "It is expected if you are not running on NVIDIA/AMD GPUs."
232 "Otherwise, the nccl library might not exist, be corrupted "
233 - "or it does not support the current platform %s."
233 + "or it does not support the current platform %s. "
234 "If you already have the library, please set the "
235 "environment variable VLLM_NCCL_SO_PATH"
236 " to point to the correct nccl library path.", so_file,
vllm/distributed/kv_transfer/kv_pipe/mooncake_pipe.py
+1 -1
@@ -137,7 +137,7 @@ class MooncakeTransferEngine:
137 if metadata_backend not in supported_backend:
138 raise ValueError(
139 "Mooncake Configuration error. `metadata_backend`"
140 - f"should be one of {supported_backend}.")
140 + f" should be one of {supported_backend}.")
141
142 self.engine.initializeExt(local_hostname, metadata_server,
143 protocol, device_name, metadata_backend)
vllm/entrypoints/chat_utils.py
+1 -1
@@ -823,7 +823,7 @@ def _parse_chat_message_content_part(
823 # content is empty, log a warning and skip
824 if part_type in VALID_MESSAGE_CONTENT_MM_PART_TYPES and not content:
825 logger.warning(
826 - "Skipping multimodal part (type: '%s')"
826 + "Skipping multimodal part (type: '%s') "
827 "with empty / unparsable content.", part_type)
828 return None
829
vllm/entrypoints/llm.py
+1 -1
@@ -1342,7 +1342,7 @@ class LLM:
1342 return params
1343
1344 if params.guided_decoding is not None:
1345 - raise ValueError("Cannot set both guided_options_request and"
1345 + raise ValueError("Cannot set both guided_options_request and "
1346 "params.guided_decoding.")
1347
1348 params.guided_decoding = GuidedDecodingParams(
vllm/entrypoints/openai/api_server.py
+1 -1
@@ -575,7 +575,7 @@ async def do_rerank(request: RerankRequest, raw_request: Request):
575 async def do_rerank_v1(request: RerankRequest, raw_request: Request):
576 logger.warning_once(
577 "To indicate that the rerank API is not part of the standard OpenAI"
578 - " API, we have located it at `/rerank`. Please update your client"
578 + " API, we have located it at `/rerank`. Please update your client "
579 "accordingly. (Note: Conforms to JinaAI rerank API)")
580
581 return await do_rerank(request, raw_request)
vllm/executor/ray_distributed_executor.py
+1 -1
@@ -513,7 +513,7 @@ class RayDistributedExecutor(DistributedExecutorBase):
513 if cupy_spec is None and envs.VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL:
514 raise ValueError(
515 "cupy is not installed but required since "
516 - "VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL is set."
516 + "VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL is set. "
517 "Run `pip install ray[adag]` and check cupy installation.")
518
519 def _compiled_ray_dag(self, enable_asyncio: bool):
vllm/executor/ray_utils.py
+1 -1
@@ -317,7 +317,7 @@ def initialize_ray_cluster(
317 if parallel_config.world_size > device_bundles:
318 raise ValueError(
319 f"The number of required {device_str}s exceeds the total "
320 - f"number of available {device_str}s in the placement group."
320 + f"number of available {device_str}s in the placement group. "
321 f"Required number of devices: {parallel_config.world_size}. "
322 f"Total number of devices: {device_bundles}.")
323 else:
vllm/lora/models.py
+1 -1
@@ -437,7 +437,7 @@ class LoRAModelManager(AdapterModelManager):
437 def pin_adapter(self, lora_id: int) -> bool:
438 """Pin a LoRAModel in the manager cache."""
439 raise NotImplementedError(
440 - "Pinning is not supported in LoRAModelManager."
440 + "Pinning is not supported in LoRAModelManager. "
441 "Use LRUCacheLoRAModelManager for pinning") # type: ignore
442
443 def _set_adapter_mapping(self, mapping: LoRAMapping) -> None:
vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe.py
+1 -1
@@ -71,7 +71,7 @@ class CompressedTensorsW8A8Fp8MoEMethod(CompressedTensorsMoEMethod):
71 if not (self.weight_quant.strategy == QuantizationStrategy.TENSOR
72 and self.input_quant.strategy == QuantizationStrategy.TENSOR):
73 raise ValueError(
74 - "For FP8 Fused MoE layers, only per-tensor scales"
74 + "For FP8 Fused MoE layers, only per-tensor scales "
75 "for weights and activations are supported. Found "
76 f"{self.weight_quant}, {self.input_quant}")
77
vllm/model_executor/layers/quantization/gptq.py
+1 -1
@@ -74,7 +74,7 @@ class GPTQConfig(QuantizationConfig):
74 def __repr__(self) -> str:
75 return (f"GPTQConfig(weight_bits={self.weight_bits}, "
76 f"group_size={self.group_size}, "
77 - f"desc_act={self.desc_act}),"
77 + f"desc_act={self.desc_act}), "
78 f"lm_head_quantized={self.lm_head_quantized}), "
79 f"dynamic={self.dynamic}")
80
vllm/model_executor/layers/quantization/modelopt.py
+1 -1
@@ -56,7 +56,7 @@ class ModelOptFp8Config(QuantizationConfig):
56 quant_method = quant_config["quant_algo"]
57 is_checkpoint_fp8_serialized = ("FP8" in quant_method)
58 if not is_checkpoint_fp8_serialized:
59 - raise ValueError("ModelOpt currently only supports static FP8"
59 + raise ValueError("ModelOpt currently only supports static FP8 "
60 "quantization in vLLM. Please check the "
61 "`hf_quant_config.json` file for your model's "
62 "quant configuration.")
vllm/model_executor/layers/quantization/neuron_quant.py
+2 -2
@@ -25,8 +25,8 @@ class NeuronQuantConfig(QuantizationConfig):
25 if self.quant_dtype not in SUPPORTED_QUANT_DTYPE_LIST:
26 raise ValueError(
27 f"Neuron quantization datatype {self.quant_dtype} is not valid,"
28 - f"the quantization datatype should match one of the below types"
29 - f"{SUPPORTED_QUANT_DTYPE_LIST}")
28 + f" the quantization datatype should match one of the below "
29 + f"types {SUPPORTED_QUANT_DTYPE_LIST}")
30 self.dequant_dtype = dequant_dtype
31 self.quantize_method = quantize_method
32
vllm/model_executor/layers/quantization/quark/quark_moe.py
+1 -1
@@ -55,7 +55,7 @@ class QuarkW8A8Fp8MoEMethod(QuarkMoEMethod):
55 if not (weight_qscheme == "per_tensor"
56 and input_qscheme == "per_tensor"):
57 raise ValueError(
58 - "For FP8 Fused MoE layers, only per-tensor scales"
58 + "For FP8 Fused MoE layers, only per-tensor scales "
59 "for weights and activations are supported. Found "
60 f"{weight_qscheme}, {input_qscheme}") # noqa E501
61
vllm/model_executor/layers/quantization/utils/marlin_utils.py
+1 -1
@@ -118,7 +118,7 @@ def verify_marlin_supports_shape(output_size_per_partition: int,
118 and input_size_per_partition % group_size != 0):
119 raise ValueError(
120 f"Weight input_size_per_partition = {input_size_per_partition}"
121 - f" is not divisible by group_size = {group_size}."
121 + f" is not divisible by group_size = {group_size}. "
122 "Consider reducing tensor_parallel_size or running "
123 "with --quantization gptq.")
124
vllm/model_executor/model_loader/loader.py
+1 -1
@@ -1088,7 +1088,7 @@ class BitsAndBytesModelLoader(BaseModelLoader):
1088 self.model_type = type(model).__name__
1089
1090 logger.info("Loading weights with BitsAndBytes quantization. "
1091 - " May take a while ...")
1091 + "May take a while ...")
1092
1093 quant_config = getattr(model_config.hf_config, "quantization_config",
1094 None)
vllm/model_executor/models/deepseek_vl2.py
+1 -1
@@ -562,7 +562,7 @@ class DeepseekVLV2ForCausalLM(nn.Module, SupportsMultiModal, SupportsPP):
562 # 3D tensor
563 return list(torch.unbind(image_data, dim=0))
564 raise ValueError(
565 - "We expect batched 2D tensors;"
565 + "We expect batched 2D tensors; "
566 "this can be either a list of 2D tensors or a single 3D tensor."
567 )
568
vllm/model_executor/models/fuyu.py
+1 -1
@@ -290,7 +290,7 @@ class FuyuForCausalLM(nn.Module, SupportsMultiModal, SupportsPP):
290 expected_expr = str(expected_dims)
291 raise ValueError(
292 "The expected shape of pixel values per image per batch "
293 - f" per patch is {expected_expr}. "
293 + f"per patch is {expected_expr}. "
294 f"You supplied {tuple(d.shape)}.")
295
296 for d in data:
vllm/model_executor/models/gritlm.py
+4 -4
@@ -90,8 +90,8 @@ class GritLMPooler(nn.Module):
90
91 # Return no instruction in case of missing BOS token.
92 if prompt_token_ids[0] != self.token_ids["<s>"]:
93 - logger.warning("BOS token not found in prompt,"
94 - "thus using empty string for instruction."
93 + logger.warning("BOS token not found in prompt, "
94 + "thus using empty string for instruction. "
95 "GritLM requires BOS token in prompt.")
96 return instruction_len
97
@@ -111,8 +111,8 @@ class GritLMPooler(nn.Module):
111 if found_embed_pattern_idx != -1:
112 instruction_len = found_embed_pattern_idx + len(embed_pattern_ids)
113 else:
114 - logger.warning("Query instruction not found in prompt,"
115 - "thus using BOS token as instruction instead."
114 + logger.warning("Query instruction not found in prompt, "
115 + "thus using BOS token as instruction instead. "
116 "GritLM requires query instruction in prompt.")
117 instruction_len = 1
118
vllm/model_executor/models/minicpmv.py
+1 -1
@@ -673,7 +673,7 @@ class MiniCPMVMultiModalProcessor(BaseMultiModalProcessor[_I]):
673 for modality, count in counts.items():
674 if modality not in inputs or not inputs[modality]:
675 raise ValueError(f"None input data of {modality}."
676 - "But prompt requires.")
676 + " But prompt requires.")
677 counter_key = self.get_modality_num_counter(modality)
678 if len(inputs[modality][counter_key]) != count:
679 raise ValueError(f"The prompt requires {count} "
vllm/model_executor/models/phi3v.py
+1 -1
@@ -639,7 +639,7 @@ class Phi3VForCausalLM(nn.Module, SupportsMultiModal, SupportsPP,
639 # 3D tensor
640 return list(torch.unbind(image_data, dim=0))
641 raise ValueError(
642 - "We expect batched 2D tensors;"
642 + "We expect batched 2D tensors; "
643 "this can be either a list of 2D tensors or a single 3D tensor."
644 )
645
vllm/model_executor/models/prithvi_geospatial_mae.py
+2 -2
@@ -153,8 +153,8 @@ class PrithviGeoSpatialMAE(nn.Module, IsAttentionFree, SupportsMultiModal):
153 vllm_config.model_config.hf_config.to_dict()["pretrained_cfg"])
154 if self.model is None:
155 raise ValueError(
156 - "Unsupported task."
157 - "Only SemanticSegmentationTask is supported for now"
156 + "Unsupported task. "
157 + "Only SemanticSegmentationTask is supported for now "
158 "by PrithviGeospatialMAE.")
159
160 def _parse_and_validate_multimodal_data(
vllm/multimodal/profiling.py
+1 -1
@@ -160,7 +160,7 @@ class MultiModalProfiler(Generic[_I]):
160
161 if mm_counts.keys() != mm_max_tokens_per_item.keys():
162 raise AssertionError(
163 - "The keys returned by `get_supported_mm_limits`"
163 + "The keys returned by `get_supported_mm_limits` "
164 f"({set(mm_counts.keys())}) should be the same as those "
165 "returned by `get_mm_max_tokens_per_item` "
166 f"({set(mm_max_tokens_per_item.keys())})")
vllm/platforms/cuda.py
+1 -1
@@ -190,7 +190,7 @@ class CudaPlatformBase(Platform):
190 "Cannot use FlashAttention-2 backend for FP8 KV cache.")
191 logger.warning(
192 "Please use FlashInfer backend with FP8 KV Cache for "
193 - "better performance by setting environment variable "
193 + "better performance by setting environment variable "
194 "VLLM_ATTENTION_BACKEND=FLASHINFER")
195 target_backend = _Backend.XFORMERS
196 elif block_size % 16 != 0:
vllm/platforms/openvino.py
+1 -1
@@ -97,7 +97,7 @@ class OpenVinoPlatform(Platform):
97
98 if envs.VLLM_OPENVINO_CPU_KV_CACHE_PRECISION == "u8":
99 if not OpenVinoPlatform.is_openvino_cpu():
100 - logger.info("VLLM_OPENVINO_CPU_KV_CACHE_PRECISION is"
100 + logger.info("VLLM_OPENVINO_CPU_KV_CACHE_PRECISION is "
101 "ignored for GPU, f16 data type will be used.")
102 cache_config.cache_dtype = ov.Type.f16
103 else:
vllm/platforms/xpu.py
+1 -1
@@ -73,7 +73,7 @@ class XPUPlatform(Platform):
73 logger.warning(
74 "bfloat16 is only supported on Intel Data Center GPU, "
75 "Intel Arc GPU is not supported yet. Your device is %s,"
76 - "which is not supported. will fallback to float16",
76 + " which is not supported. will fallback to float16",
77 cls.get_device_name())
78 model_config.dtype = torch.float16
79 if not model_config.enforce_eager:
vllm/prompt_adapter/models.py
+1 -1
@@ -226,7 +226,7 @@ class PromptAdapterModelManager(AdapterModelManager):
226 def pin_adapter(self, prompt_adapter_id: int) -> bool:
227 """Pin a PromptAdapterModel in the manager cache."""
228 raise NotImplementedError(
229 - "Pinning is not supported in PromptAdapterModelManager."
229 + "Pinning is not supported in PromptAdapterModelManager. "
230 "Use LRUCachePromptAdapterModelManager for pinning"
231 ) # type: ignore
232
vllm/spec_decode/draft_model_runner.py
+1 -1
@@ -16,7 +16,7 @@ try:
16 ROCmFlashAttentionMetadata as FlashAttentionMetadata)
17 except (ModuleNotFoundError, ImportError) as err:
18 raise RuntimeError(
19 - "Draft model speculative decoding currently only supports"
19 + "Draft model speculative decoding currently only supports "
20 "CUDA and ROCm flash attention backend.") from err
21
22 from vllm.logger import init_logger
vllm/transformers_utils/configs/jais.py
+4 -4
@@ -212,26 +212,26 @@ class JAISConfig(PretrainedConfig):
212 if (not isinstance(self.alibi_scaling, dict)
213 or len(self.alibi_scaling) != 2):
214 raise ValueError(
215 - "`alibi_scaling` must be a dictionary with two fields,"
215 + "`alibi_scaling` must be a dictionary with two fields, "
216 "`type` and `factor` or `type` and `train_seq_len`, "
217 f"got {self.alibi_scaling}")
218 alibi_scaling_type = self.alibi_scaling.get("type", None)
219 alibi_scaling_factor = self.alibi_scaling.get("factor", None)
220 alibi_dynamic_scaling = self.alibi_scaling.get("train_seq_len", None)
221 if alibi_scaling_type is None or alibi_scaling_type != "linear":
222 - raise ValueError(f"`alibi_scaling`'s type field must be 'linear',"
222 + raise ValueError(f"`alibi_scaling`'s type field must be 'linear', "
223 f"got {alibi_scaling_type}")
224 if (alibi_scaling_factor is not None
225 and not isinstance(alibi_scaling_factor, float)
226 or (alibi_scaling_factor is not None
227 and alibi_scaling_factor <= 1.0)):
228 raise ValueError(
229 - f"`alibi_scaling`'s factor field must be a float > 1.0,"
229 + f"`alibi_scaling`'s factor field must be a float > 1.0, "
230 f"got {alibi_scaling_factor}")
231 if (alibi_dynamic_scaling is not None
232 and not isinstance(alibi_dynamic_scaling, int)
233 or (alibi_dynamic_scaling is not None
234 and alibi_dynamic_scaling <= 1)):
235 raise ValueError(
236 - f"`alibi_scaling`'s `train_seq_len` field must be an"
236 + f"`alibi_scaling`'s `train_seq_len` field must be an "
237 f"integer > 1, got {alibi_dynamic_scaling}")
vllm/utils.py
+3 -3
@@ -447,7 +447,7 @@ def get_ip() -> str:
447 logger.warning(
448 "The environment variable HOST_IP is deprecated and ignored, as"
449 " it is often used by Docker and other software to"
450 - "interact with the container's network stack. Please "
450 + " interact with the container's network stack. Please "
451 "use VLLM_HOST_IP instead to set the IP address for vLLM processes"
452 " to communicate with each other.")
453 if host_ip:
@@ -2091,8 +2091,8 @@ def set_ulimit(target_soft_limit=65535):
2091 (target_soft_limit, current_hard))
2092 except ValueError as e:
2093 logger.warning(
2094 - "Found ulimit of %s and failed to automatically increase"
2095 - "with error %s. This can cause fd limit errors like"
2094 + "Found ulimit of %s and failed to automatically increase "
2095 + "with error %s. This can cause fd limit errors like "
2096 "`OSError: [Errno 24] Too many open files`. Consider "
2097 "increasing with ulimit -n", current_soft, e)
2098
vllm/v1/worker/gpu_worker.py
+1 -1
@@ -277,5 +277,5 @@ def _check_if_gpu_supports_dtype(torch_dtype: torch.dtype):
277 raise ValueError(
278 "Bfloat16 is only supported on GPUs with compute capability "
279 f"of at least 8.0. Your {gpu_name} GPU {compute_str}. "
280 - "You can use float16 instead by explicitly setting the"
280 + "You can use float16 instead by explicitly setting the "
281 "`dtype` flag in CLI, for example: --dtype=half.")
vllm/worker/openvino_worker.py
+1 -1
@@ -545,7 +545,7 @@ class OpenVINOWorker(LoraNotSupportedWorkerBase):
545 "value. This may cause low performance due to "
546 "occupying the majority of available system "
547 "memory. Please consider decreasing "
548 - "gpu_memory_utilization or explicitly setting"
548 + "gpu_memory_utilization or explicitly setting "
549 "`VLLM_OPENVINO_KVCACHE_SPACE` (GB) environment "
550 "variable.", memory_utilization)
551
vllm/worker/worker.py
+2 -2
@@ -525,7 +525,7 @@ def _check_if_gpu_supports_dtype(torch_dtype: torch.dtype):
525 raise ValueError(
526 "Bfloat16 is only supported on GPUs with compute capability "
527 f"of at least 8.0. Your {gpu_name} GPU {compute_str}. "
528 - "You can use float16 instead by explicitly setting the"
528 + "You can use float16 instead by explicitly setting the "
529 "`dtype` flag in CLI, for example: --dtype=half.")
530
531
@@ -533,7 +533,7 @@ def raise_if_cache_size_invalid(num_gpu_blocks, block_size, is_attention_free,
533 max_model_len) -> None:
534 if is_attention_free and num_gpu_blocks != 0:
535 raise ValueError("No memory should be allocated for the cache blocks "
536 - f"for an attention-free model, but {num_gpu_blocks}"
536 + f"for an attention-free model, but {num_gpu_blocks} "
537 "blocks are allocated.")
538 if not is_attention_free and num_gpu_blocks <= 0:
539 raise ValueError("No available memory for the cache blocks. "