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 4, 18:45 UTC
[Refactor] Clean up log once `scope="local"` (#40540)
Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Wentao Ye committed
Apr 22, 2026 at 16:42 UTC
8f87eb4622cf7516ce34c1f9703fee43fb0101e1
44 files changed
+56
-148
vllm/compilation/backends.py
+3
-13
@@ -292,7 +292,6 @@ class CompilerManager:
292
"from the cache, took %.3f s",
293
str(compile_range),
294
elapsed,
295
- scope="local",
295
)
296
return compiled_graph
297
@@ -377,7 +376,6 @@ class CompilerManager:
376
logger.info_once(
377
"Cache the graph of compile range %s for later use",
378
str(compile_range),
380
- scope="local",
379
)
380
logger.debug_once(
381
"Store the %s-th graph for compile range%s from %s via handle %s",
@@ -385,7 +383,6 @@ class CompilerManager:
383
str(compile_range),
384
self.compiler.name,
385
handle,
388
- scope="local",
386
)
387
388
# after compiling the last graph, record the end time
@@ -399,7 +396,6 @@ class CompilerManager:
396
"Compiling a graph for compile range %s takes %.2f s",
397
str(compile_range),
398
elapsed,
402
- scope="local",
399
)
400
401
return compiled_graph
@@ -1072,12 +1068,11 @@ class VllmBackend:
1068
disable_cache = disable_cache or is_ngram_gpu_enabled
1069
1070
if disable_cache:
1075
- logger.info_once("vLLM's torch.compile cache is disabled.", scope="local")
1071
+ logger.info_once("vLLM's torch.compile cache is disabled.")
1072
else:
1073
logger.info_once(
1074
"Using cache directory: %s for vLLM's torch.compile",
1075
local_cache_dir,
1080
- scope="local",
1076
)
1077
1078
self.compiler_manager.initialize_cache(
@@ -1134,9 +1129,7 @@ class VllmBackend:
1129
from .monitor import torch_compile_start_time
1130
1131
dynamo_time = time.perf_counter() - torch_compile_start_time
1137
- logger.info_once(
1138
- "Dynamo bytecode transform time: %.2f s", dynamo_time, scope="local"
1139
- )
1132
+ logger.info_once("Dynamo bytecode transform time: %.2f s", dynamo_time)
1133
if self.is_encoder:
1134
self.compilation_config.encoder_compilation_time += dynamo_time
1135
else:
@@ -1215,7 +1208,6 @@ class VllmBackend:
1208
logger.info_once(
1209
"Saved compiler manager cache in %.2f seconds.",
1210
elapsed,
1218
- scope="local",
1211
)
1212
1213
from torch._guards import detect_fake_mode
@@ -1254,9 +1246,7 @@ class VllmBackend:
1246
with open(graph_path, "w") as f:
1247
f.write(src)
1248
1257
- logger.debug_once(
1258
- "Computation graph saved to %s", graph_path, scope="local"
1259
- )
1249
+ logger.debug_once("Computation graph saved to %s", graph_path)
1250
1251
self._called = True
1252
graph_to_serialize = (
vllm/compilation/decorators.py
-1
@@ -665,7 +665,6 @@ def _support_torch_compile(
665
logger.info_once(
666
"saved AOT compiled function to %s",
667
self._aot_compilation_path,
668
- scope="local",
668
)
669
except Exception as e:
670
logger.warning(
vllm/compilation/monitor.py
+1
-2
@@ -45,7 +45,7 @@ def monitor_torch_compile(
45
else:
46
total_compile_time = time.perf_counter() - torch_compile_start_time
47
if compilation_config.mode == CompilationMode.VLLM_COMPILE:
48
- logger.info_once(message, total_compile_time, scope="local")
48
+ logger.info_once(message, total_compile_time)
49
finally:
50
if depyf_cm is not None:
51
try:
@@ -76,7 +76,6 @@ def monitor_profiling_run() -> Generator[None, None, None]:
76
logger.info_once(
77
"Initial profiling/warmup run took %.2f s",
78
elapsed,
79
- scope="local",
79
)
80
81
vllm/config/scheduler.py
-1
@@ -239,7 +239,6 @@ class SchedulerConfig:
239
logger.info_once(
240
"Chunked prefill is enabled with max_num_batched_tokens=%d.",
241
self.max_num_batched_tokens,
242
- scope="local",
242
)
243
244
if self.max_num_partial_prefills > 1:
vllm/config/vllm.py
+1
-10
@@ -716,9 +716,7 @@ class VllmConfig:
716
self.instance_id = f"{time.time_ns()}"
717
718
if self.performance_mode != "balanced":
719
- logger.info_once(
720
- "Performance mode set to '%s'.", self.performance_mode, scope="local"
721
- )
719
+ logger.info_once("Performance mode set to '%s'.", self.performance_mode)
720
721
self.try_verify_and_update_config()
722
@@ -818,7 +816,6 @@ class VllmConfig:
816
"Async scheduling not supported with %s-based "
817
"speculative decoding and will be disabled.",
818
self.speculative_config.method,
821
- scope="local",
819
)
820
self.scheduler_config.async_scheduling = False
821
elif (
@@ -828,7 +825,6 @@ class VllmConfig:
825
logger.warning_once(
826
"Async scheduling is not compatible with "
827
"disable_padded_drafter_batch=True and will be disabled.",
831
- scope="local",
828
)
829
self.scheduler_config.async_scheduling = False
830
elif not executor_supports_async_sched:
@@ -836,7 +832,6 @@ class VllmConfig:
832
"Async scheduling will be disabled because it is not supported "
833
"with the `%s` distributed executor backend. ",
834
executor_backend,
839
- scope="local",
835
)
836
self.scheduler_config.async_scheduling = False
837
else:
@@ -855,7 +850,6 @@ class VllmConfig:
850
logger.info_once(
851
"Disabling NCCL for DP synchronization "
852
"when using async scheduling.",
858
- scope="local",
853
)
854
self.parallel_config.disable_nccl_for_dp_synchronization = True
855
else:
@@ -870,7 +864,6 @@ class VllmConfig:
864
logger.warning_once(
865
"Disabling cascade attention (not yet compatible with "
866
"async speculative decoding).",
873
- scope="local",
867
)
868
self.model_config.disable_cascade_attn = True
869
@@ -1231,7 +1224,6 @@ class VllmConfig:
1224
self.model_config.disable_cascade_attn = True
1225
logger.warning_once(
1226
"Disabling cascade attention when VLLM_BATCH_INVARIANT is enabled.",
1234
- scope="local",
1227
)
1228
1229
if self.parallel_config.use_ubatching:
@@ -1418,7 +1410,6 @@ class VllmConfig:
1410
" performance. Consider increasing max_num_batched_tokens to"
1411
" accommodate the additional draft token slots, or decrease"
1412
" num_speculative_tokens or max_num_seqs.",
1421
- scope="local",
1413
)
1414
1415
max_num_scheduled_tokens = self.scheduler_config.max_num_scheduled_tokens
vllm/distributed/device_communicators/pynccl.py
+1
-3
@@ -108,9 +108,7 @@ class PyNcclCommunicator:
108
if self.rank == 0:
109
# get the unique id from NCCL
110
self.unique_id = self.nccl.ncclGetUniqueId()
111
- logger.info_once(
112
- "vLLM is using nccl==%s", self.nccl.ncclGetVersion(), scope="local"
113
- )
111
+ logger.info_once("vLLM is using nccl==%s", self.nccl.ncclGetVersion())
112
else:
113
# construct an empty unique id
114
self.unique_id = ncclUniqueId()
vllm/engine/arg_utils.py
-3
@@ -2254,7 +2254,6 @@ class EngineArgs:
2254
"This model does not officially support disabling chunked prefill. "
2255
"Disabling this manually may cause the engine to crash "
2256
"or produce incorrect outputs.",
2257
- scope="local",
2257
)
2258
elif (
2259
model_config.runner_type == "pooling"
@@ -2265,7 +2264,6 @@ class EngineArgs:
2264
"This model does not officially support chunked prefill. "
2265
"Enabling this manually may cause the engine to crash "
2266
"or produce incorrect outputs.",
2268
- scope="local",
2267
)
2268
2269
if self.enable_prefix_caching is None:
@@ -2284,7 +2282,6 @@ class EngineArgs:
2282
"This model does not officially support prefix caching. "
2283
"Enabling this manually may cause the engine to crash "
2284
"or produce incorrect outputs.",
2287
- scope="local",
2285
)
2286
2287
# Disable chunked prefill and prefix caching for:
vllm/lora/model_manager.py
-1
@@ -387,7 +387,6 @@ class LoRAModelManager:
387
"LoRA is not supported for non-gated MoE gate module."
388
" %s will be ignored.",
389
module_name,
390
- scope="local",
390
)
391
continue
392
vllm/model_executor/layers/attention/attention.py
-1
@@ -332,7 +332,6 @@ class Attention(nn.Module, AttentionLayerBase):
332
logger.warning_once(
333
"Disabling prefix caching for FLASHINFER/TRITON_MLA "
334
"with batch invariance, as it is not yet supported.",
335
- scope="local",
335
)
336
cache_config.enable_prefix_caching = False
337
vllm/model_executor/layers/attention/mla_attention.py
+5
-12
@@ -427,7 +427,6 @@ class MLAAttention(nn.Module, AttentionLayerBase):
427
logger.warning_once(
428
"Disabling prefix caching for TRITON_MLA / FLASHINFER "
429
"with batch invariance, as it is not yet supported.",
430
- scope="local",
430
)
431
cache_config.enable_prefix_caching = False
432
@@ -1523,9 +1522,7 @@ class MLACommonMetadataBuilder(AttentionMetadataBuilder[M]):
1522
1523
if use_fp8:
1524
fp8_dtype = current_platform.fp8_dtype()
1526
- logger.info_once(
1527
- "FP8 prefill attention enabled: query data type is FP8", scope="local"
1528
- )
1525
+ logger.info_once("FP8 prefill attention enabled: query data type is FP8")
1526
return fp8_dtype
1527
elif vllm_config.attention_config.use_prefill_query_quantization:
1528
logger.info_once(
@@ -1533,7 +1530,6 @@ class MLACommonMetadataBuilder(AttentionMetadataBuilder[M]):
1530
" use_prefill_query_quantization is enabled. Please"
1531
" ensure that --kv-cache-dtype is set to fp8 and your prefill"
1532
" backend is compatible with FP8 attention.",
1536
- scope="local",
1533
)
1534
return model_dtype
1535
elif (
@@ -1547,7 +1543,6 @@ class MLACommonMetadataBuilder(AttentionMetadataBuilder[M]):
1543
"prefill latency. To enable, add: "
1544
'--attention-config \'{"use_prefill_query_quantization"'
1545
": true}'",
1550
- scope="local",
1546
)
1547
1548
return model_dtype
@@ -2225,21 +2220,19 @@ class MLACommonImpl(MLAAttentionImpl[M], Generic[M]):
2220
)
2221
2222
if use_trtllm_ragged_deepseek_prefill():
2228
- logger.info_once(
2229
- "Using TRT-LLM ragged DeepSeek prefill for MLA", scope="local"
2230
- )
2223
+ logger.info_once("Using TRT-LLM ragged DeepSeek prefill for MLA")
2224
self._run_prefill_context_chunk = (
2225
self._run_prefill_context_chunk_trtllm_ragged
2226
)
2227
self._run_prefill_new_tokens = self._run_prefill_new_tokens_trtllm_ragged
2228
self._pad_v = False
2229
elif use_flashinfer_prefill():
2237
- logger.info_once("Using FlashInfer prefill for MLA", scope="local")
2230
+ logger.info_once("Using FlashInfer prefill for MLA")
2231
self._run_prefill_context_chunk = self._run_prefill_context_chunk_fi
2232
self._run_prefill_new_tokens = self._run_prefill_new_tokens_fi
2233
self._pad_v = False
2234
elif use_cudnn_prefill():
2242
- logger.info_once("Using CUDNN prefill for MLA", scope="local")
2235
+ logger.info_once("Using CUDNN prefill for MLA")
2236
self._run_prefill_context_chunk = self._run_prefill_context_chunk_cudnn
2237
self._run_prefill_new_tokens = self._run_prefill_new_tokens_cudnn
2238
self._pad_v = False
@@ -2250,7 +2243,7 @@ class MLACommonImpl(MLAAttentionImpl[M], Generic[M]):
2243
"available. Please install flash_attn or use "
2244
"--attention-backend ROCM_AITER_MLA."
2245
)
2253
- logger.info_once("Using FlashAttention prefill for MLA", scope="local")
2246
+ logger.info_once("Using FlashAttention prefill for MLA")
2247
self._run_prefill_context_chunk = self._run_prefill_context_chunk_fa
2248
self._run_prefill_new_tokens = self._run_prefill_new_tokens_fa
2249
vllm/model_executor/layers/attention/mm_encoder_attention.py
+1
-3
@@ -227,9 +227,7 @@ class MMEncoderAttention(CustomOp):
227
if self.attn_backend == AttentionBackendEnum.FLASHINFER:
228
_get_flashinfer_workspace_buffer()
229
230
- logger.info_once(
231
- f"Using {self.attn_backend} for MMEncoderAttention.", scope="local"
232
- )
230
+ logger.info_once(f"Using {self.attn_backend} for MMEncoderAttention.")
231
232
@classmethod
233
def enabled(cls) -> bool:
vllm/model_executor/layers/batch_invariant.py
+1
-1
@@ -1020,7 +1020,7 @@ def override_envs_for_invariance(
1020
"You are using a non-decode-invariant form of batch invariance. "
1021
"This will not be invariant between prefill and decode."
1022
)
1023
- logger.warning_once(warning, scope="local")
1023
+ logger.warning_once(warning)
1024
os.environ["VLLM_ALLREDUCE_USE_SYMM_MEM"] = "0"
1025
1026
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"
vllm/model_executor/layers/fused_moe/experts/batched_deep_gemm_moe.py
-1
@@ -369,7 +369,6 @@ class BatchedDeepGemmExperts(mk.FusedMoEExpertsModular):
369
logger.warning_once(
370
"DPMetadata unavailable. Defaulting expected_m to "
371
f"{max_tokens_per_expert}.",
372
- scope="local",
372
)
373
return max_tokens_per_expert
374
vllm/model_executor/layers/fused_moe/fused_moe.py
-1
@@ -1091,7 +1091,6 @@ def get_moe_configs(
1091
"Using default MoE config. Performance might be sub-optimal! "
1092
"Config file not found at %s",
1093
", ".join(config_file_paths),
1094
- scope="local",
1094
)
1095
return None
1096
vllm/model_executor/layers/fused_moe/nixl_ep_prepare_finalize.py
-1
@@ -123,7 +123,6 @@ class NixlEPPrepareAndFinalize(mk.FusedMoEPrepareAndFinalizeModular):
123
"NixlEPPrepareAndFinalize is setup to dispatch raw/unquantized "
124
f"activations despite ({fused_experts.__class__.__name__}) being able "
125
"to support quantized activations.",
126
- scope="local",
126
)
127
128
def num_dispatchers(self) -> int:
vllm/model_executor/layers/fused_moe/oracle/fp8.py
+6
-8
@@ -266,7 +266,7 @@ def select_fp8_moe_backend(
266
k_cls, config, weight_key, activation_key, activation_format
267
)
268
if supported:
269
- logger.info_once(_make_log_backend(backend), scope="local")
269
+ logger.info_once(_make_log_backend(backend))
270
return backend, k_cls
271
raise ValueError(_make_log_unsupported(backend, reason))
272
@@ -337,12 +337,10 @@ def select_fp8_moe_backend(
337
)
338
339
if supported:
340
- logger.info_once(_make_log_backend(backend), scope="local")
340
+ logger.info_once(_make_log_backend(backend))
341
return backend, k_cls
342
else:
343
- logger.debug_once(
344
- _make_log_unsupported(backend, reason), scope="local"
345
- )
343
+ logger.debug_once(_make_log_unsupported(backend, reason))
344
345
raise NotImplementedError(
346
"Found VLLM_USE_FLASHINFER_MOE_FP8=1, but no "
@@ -396,10 +394,10 @@ def select_fp8_moe_backend(
394
activation_format,
395
)
396
if supported:
399
- logger.info_once(_make_log_backend(backend), scope="local")
397
+ logger.info_once(_make_log_backend(backend))
398
return backend, k_cls
399
else:
402
- logger.debug_once(_make_log_unsupported(backend, reason), scope="local")
400
+ logger.debug_once(_make_log_unsupported(backend, reason))
401
402
# TODO(rob): per discussion with TPU team, we need a way to register
403
# MoE backends by OOT plugins, rather than having an explicit list
@@ -580,7 +578,7 @@ def make_fp8_moe_kernel(
578
)
579
assert prepare_finalize is not None
580
583
- logger.info_once("Using %s", prepare_finalize.__class__.__name__, scope="local")
581
+ logger.info_once("Using %s", prepare_finalize.__class__.__name__)
582
583
# Create Experts.
584
if prepare_finalize.activation_format == mk.FusedMoEActivationFormat.BatchedExperts:
vllm/model_executor/layers/fused_moe/oracle/int8.py
+4
-4
@@ -117,7 +117,7 @@ def select_int8_moe_backend(
117
k_cls, config, weight_key, activation_key, activation_format
118
)
119
if supported:
120
- logger.info_once(_make_log_backend(backend), scope="local")
120
+ logger.info_once(_make_log_backend(backend))
121
return backend, k_cls
122
raise ValueError(_make_log_unsupported(backend, reason))
123
@@ -138,10 +138,10 @@ def select_int8_moe_backend(
138
activation_format,
139
)
140
if supported:
141
- logger.info_once(_make_log_backend(backend), scope="local")
141
+ logger.info_once(_make_log_backend(backend))
142
return backend, k_cls
143
else:
144
- logger.debug_once(_make_log_unsupported(backend, reason), scope="local")
144
+ logger.debug_once(_make_log_unsupported(backend, reason))
145
146
raise NotImplementedError(
147
"No Int8 MoE backend supports the deployment configuration."
@@ -193,7 +193,7 @@ def make_int8_moe_kernel(
193
)
194
assert prepare_finalize is not None
195
196
- logger.info_once("Using %s", prepare_finalize.__class__.__name__, scope="local")
196
+ logger.info_once("Using %s", prepare_finalize.__class__.__name__)
197
198
# Create Experts.
199
if prepare_finalize.activation_format == mk.FusedMoEActivationFormat.BatchedExperts:
vllm/model_executor/layers/fused_moe/oracle/mxfp4.py
+4
-4
@@ -269,7 +269,7 @@ def select_gpt_oss_mxfp4_moe_backend(
269
k_cls, config, weight_key, activation_key, activation_format
270
)
271
if supported:
272
- logger.info_once(_make_log_backend(backend), scope="local")
272
+ logger.info_once(_make_log_backend(backend))
273
return backend, k_cls
274
raise ValueError(_make_log_unsupported(backend, reason))
275
@@ -363,10 +363,10 @@ def select_gpt_oss_mxfp4_moe_backend(
363
k_cls, config, kMxfp4Static, activation_key, activation_format
364
)
365
if supported:
366
- logger.info_once(_make_log_backend(backend), scope="local")
366
+ logger.info_once(_make_log_backend(backend))
367
return backend, k_cls
368
else:
369
- logger.debug_once(_make_log_unsupported(backend, reason), scope="local")
369
+ logger.debug_once(_make_log_unsupported(backend, reason))
370
371
if current_platform.is_xpu():
372
backend = Mxfp4MoeBackend.XPU
@@ -861,7 +861,7 @@ def make_mxfp4_moe_kernel(
861
)
862
assert prepare_finalize is not None
863
864
- logger.info_once("Using %s", prepare_finalize.__class__.__name__, scope="local")
864
+ logger.info_once("Using %s", prepare_finalize.__class__.__name__)
865
866
# Create Experts.
867
if prepare_finalize.activation_format == mk.FusedMoEActivationFormat.BatchedExperts:
vllm/model_executor/layers/fused_moe/oracle/nvfp4.py
+4
-6
@@ -252,12 +252,10 @@ def select_nvfp4_moe_backend(
252
activation_format,
253
)
254
if supported:
255
- logger.info_once(_make_log_backend(backend), scope="local")
255
+ logger.info_once(_make_log_backend(backend))
256
return backend, k_cls
257
else:
258
- logger.debug_once(
259
- _make_log_unsupported(backend, reason), scope="local"
260
- )
258
+ logger.debug_once(_make_log_unsupported(backend, reason))
259
260
raise NotImplementedError(
261
"Found VLLM_USE_FLASHINFER_MOE_FP4=1, but no "
@@ -282,10 +280,10 @@ def select_nvfp4_moe_backend(
280
)
281
282
if supported:
285
- logger.info_once(_make_log_backend(backend), scope="local")
283
+ logger.info_once(_make_log_backend(backend))
284
return backend, k_cls
285
else:
288
- logger.debug_once(_make_log_unsupported(backend, reason), scope="local")
286
+ logger.debug_once(_make_log_unsupported(backend, reason))
287
288
raise NotImplementedError(
289
"No NvFp4 MoE backend supports the deployment configuration."
vllm/model_executor/layers/fused_moe/oracle/unquantized.py
+6
-8
@@ -210,7 +210,7 @@ def select_unquantized_moe_backend(
210
k_cls, config, None, None, activation_format
211
)
212
if supported:
213
- logger.info_once(_make_log_backend(backend), scope="local")
213
+ logger.info_once(_make_log_backend(backend))
214
return backend, k_cls
215
raise ValueError(_make_log_unsupported(backend, reason))
216
@@ -271,12 +271,10 @@ def select_unquantized_moe_backend(
271
k_cls, moe_config, None, None, activation_format
272
)
273
if supported:
274
- logger.info_once(_make_log_backend(backend), scope="local")
274
+ logger.info_once(_make_log_backend(backend))
275
return backend, k_cls
276
else:
277
- logger.debug_once(
278
- _make_log_unsupported(backend, reason), scope="local"
279
- )
277
+ logger.debug_once(_make_log_unsupported(backend, reason))
278
279
raise NotImplementedError(
280
"Found VLLM_USE_FLASHINFER_MOE_FP16=1, but no "
@@ -298,10 +296,10 @@ def select_unquantized_moe_backend(
296
k_cls, moe_config, None, None, activation_format
297
)
298
if supported:
301
- logger.info_once(_make_log_backend(backend), scope="local")
299
+ logger.info_once(_make_log_backend(backend))
300
return backend, k_cls
301
304
- logger.debug_once(_make_log_unsupported(backend, reason), scope="local")
302
+ logger.debug_once(_make_log_unsupported(backend, reason))
303
304
raise NotImplementedError(
305
"No Unquantized MoE backend supports the deployment configuration."
@@ -355,7 +353,7 @@ def make_unquantized_moe_kernel(
353
)
354
assert prepare_finalize is not None
355
358
- logger.info_once("Using %s", prepare_finalize.__class__.__name__, scope="local")
356
+ logger.info_once("Using %s", prepare_finalize.__class__.__name__)
357
358
# Create Experts
359
if prepare_finalize.activation_format == mk.FusedMoEActivationFormat.BatchedExperts:
vllm/model_executor/layers/fused_moe/prepare_finalize/deepep_ll.py
-1
@@ -135,7 +135,6 @@ class DeepEPLLPrepareAndFinalize(mk.FusedMoEPrepareAndFinalizeModular):
135
"DeepEPLLPrepareAndFinalize is setup to dispatch raw/unquantized "
136
f"activations despite ({fused_experts.__class__.__name__}) being able "
137
"to support quantized activations.",
138
- scope="local",
138
)
139
140
def num_dispatchers(self) -> int:
vllm/model_executor/layers/fused_moe/runner/shared_experts.py
+2
-4
@@ -69,16 +69,14 @@ class SharedExperts:
69
# TODO: Remove this after more extensive testings with TP/DP
70
# and other execution modes
71
if envs.VLLM_DISABLE_SHARED_EXPERTS_STREAM:
72
- logger.debug_once("Disabling MoE shared_experts cuda stream", scope="local")
72
+ logger.debug_once("Disabling MoE shared_experts cuda stream")
73
self._stream = None
74
else:
75
# TODO(rob): enable shared expert overlap with non-cuda-alike.
76
# aux_stream() returns None on non-cuda-alike platforms.
77
self._stream = aux_stream()
78
if self._stream is not None:
79
- logger.debug_once(
80
- "Enabled separate cuda stream for MoE shared_experts", scope="local"
81
- )
79
+ logger.debug_once("Enabled separate cuda stream for MoE shared_experts")
80
81
@property
82
def _disable_shared_experts_overlap(self) -> bool:
vllm/model_executor/layers/mamba/gdn_linear_attn.py
+2
-3
@@ -143,15 +143,14 @@ class ChunkGatedDeltaRule(CustomOp):
143
use_flashinfer = supports_flashinfer
144
145
if use_flashinfer:
146
- logger.info_once("Using FlashInfer GDN prefill kernel", scope="local")
146
+ logger.info_once("Using FlashInfer GDN prefill kernel")
147
logger.info_once(
148
"FlashInfer GDN prefill kernel is JIT-compiled; first run may "
149
"take a while to compile. Set `--gdn-prefill-backend triton` to "
150
"avoid JIT compile time.",
151
- scope="local",
151
)
152
else:
154
- logger.info_once("Using Triton/FLA GDN prefill kernel", scope="local")
153
+ logger.info_once("Using Triton/FLA GDN prefill kernel")
154
155
self._forward_method = (
156
self.forward_cuda if use_flashinfer else self.forward_native
vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe/compressed_tensors_moe_w4a4_mxfp4.py
+2
-2
@@ -44,10 +44,10 @@ class CompressedTensorsW4A4Mxfp4MoEMethod(CompressedTensorsMoEMethod):
44
self.use_cutlass_mxfp4 = CutlassExpertsMxfp4._supports_current_device()
45
self.experts_cls: type[mk.FusedMoEExperts]
46
if self.use_cutlass_mxfp4:
47
- logger.info_once("Using CutlassExpertsMxfp4 for MXFP4 MoE", scope="local")
47
+ logger.info_once("Using CutlassExpertsMxfp4 for MXFP4 MoE")
48
self.experts_cls = CutlassExpertsMxfp4
49
else:
50
- logger.info_once("Using MarlinExperts for MXFP4 MoE", scope="local")
50
+ logger.info_once("Using MarlinExperts for MXFP4 MoE")
51
self.experts_cls = MarlinExperts
52
53
def create_weights(
vllm/model_executor/layers/quantization/compressed_tensors/compressed_tensors_moe/compressed_tensors_moe_wna16_marlin.py
-1
@@ -87,7 +87,6 @@ class CompressedTensorsWNA16MarlinMoEMethod(CompressedTensorsMoEMethod):
87
logger.info_once(
88
f"Using {self.kernel_backend} backend for WNA16 MoE "
89
f"(group_size={self.group_size}, num_bits={self.num_bits})",
90
- scope="local",
90
)
91
92
def get_weight_shape(
vllm/model_executor/layers/quantization/mxfp4.py
-2
@@ -83,7 +83,6 @@ class Mxfp4Config(QuantizationConfig):
83
logger.debug_once(
84
"MXFP4 linear layer is not implemented - falling back to "
85
"UnquantizedLinearMethod.",
86
- scope="local",
86
)
87
return UnquantizedLinearMethod()
88
elif isinstance(layer, FusedMoE):
@@ -92,7 +91,6 @@ class Mxfp4Config(QuantizationConfig):
91
logger.debug_once(
92
"MXFP4 attention layer is not implemented. "
93
"Skipping quantization for this layer.",
95
- scope="local",
94
)
95
return None
96
vllm/model_executor/layers/quantization/utils/flashinfer_utils.py
-4
@@ -111,7 +111,6 @@ def get_flashinfer_moe_backend() -> FlashinferMoeBackend:
111
logger.info_once(
112
"Flashinfer TRTLLM MOE backend is only supported on "
113
"SM100 and later, using CUTLASS backend instead",
114
- scope="local",
114
)
115
return FlashinferMoeBackend.CUTLASS
116
return backend_map[flashinfer_moe_backend]
@@ -239,7 +238,6 @@ def align_fp4_moe_weights_for_fi(
238
"Padding intermediate size from %d to %d for up/down projection weights.",
239
intermediate,
240
padded_intermediate,
242
- scope="local",
241
)
242
243
up_mult = 2 if is_act_and_mul else 1
@@ -285,7 +283,6 @@ def align_trtllm_fp4_moe_hidden_dim_for_fi(
283
"performance degradation.",
284
hidden_size,
285
padded_hidden_size,
288
- scope="local",
286
)
287
288
padded_w13 = w13.new_zeros((num_experts, gate_up_dim, padded_hidden_size // 2))
@@ -331,7 +328,6 @@ def align_fp8_moe_weights_for_fi(
328
"Padding intermediate size from %d to %d for up/down projection weights.",
329
intermediate,
330
padded_intermediate,
334
- scope="local",
331
)
332
333
up_mult = 2 if is_act_and_mul else 1
vllm/model_executor/model_loader/base_loader.py
-1
@@ -70,7 +70,6 @@ class BaseModelLoader(ABC):
70
logger.debug_once(
71
"Peak GPU memory after loading weights: %s GiB",
72
format_gib(peak_memory),
73
- scope="local",
73
)
74
75
# Process weights into kernel format. Note that when using online
vllm/model_executor/model_loader/default_loader.py
-1
@@ -384,7 +384,6 @@ class DefaultModelLoader(BaseModelLoader):
384
logger.info_once(
385
"Loading weights took %.2f seconds",
386
self.counter_after_loading_weights - self.counter_before_loading_weights,
387
- scope="local",
387
)
388
# We only enable strict check for non-quantized models
389
# that have loaded weights tracking currently.
vllm/model_executor/model_loader/sharded_state_loader.py
-1
@@ -157,7 +157,6 @@ class ShardedStateLoader(BaseModelLoader):
157
logger.info_once(
158
"Loading weights took %.2f seconds",
159
counter_after_loading_weights - counter_before_loading_weights,
160
- scope="local",
160
)
161
if state_dict:
162
raise ValueError(f"Missing keys {tuple(state_dict)} in loaded state!")
vllm/model_executor/offloader/base.py
+2
-4
@@ -118,11 +118,9 @@ def set_offloader(instance: BaseOffloader) -> None:
118
global _instance
119
_instance = instance
120
if isinstance(instance, NoopOffloader):
121
- logger.debug_once(
122
- "Offloader set to NoopOffloader (no offloading).", scope="local"
123
- )
121
+ logger.debug_once("Offloader set to NoopOffloader (no offloading).")
122
else:
125
- logger.info_once("Offloader set to %s", type(instance).__name__, scope="local")
123
+ logger.info_once("Offloader set to %s", type(instance).__name__)
124
125
126
def create_offloader(offload_config: "OffloadConfig") -> BaseOffloader:
vllm/platforms/cuda.py
-2
@@ -369,7 +369,6 @@ class CudaPlatformBase(Platform):
369
"Using %s attention backend out of potential backends: %s.",
370
selected_backend.name,
371
"[" + ", ".join(f"'{b[0].name}'" for b in valid_backends_priorities) + "]",
372
- scope="local",
372
)
373
374
return selected_backend.get_path()
@@ -423,7 +422,6 @@ class CudaPlatformBase(Platform):
422
if is_backend_supported:
423
logger.info_once(
424
f"Using backend {vit_attn_backend} for vit attention",
426
- scope="local",
425
)
426
return vit_attn_backend
427
except ImportError:
vllm/profiler/wrapper.py
+4
-8
@@ -63,7 +63,7 @@ class WorkerProfiler(ABC):
63
"""Call _stop with error handling but no safeguards."""
64
try:
65
self._stop()
66
- logger.info_once("Profiler stopped successfully.", scope="local")
66
+ logger.info_once("Profiler stopped successfully.")
67
except Exception as e:
68
logger.warning("Failed to stop profiler: %s", e)
69
self._running = False # Always mark as not running, assume stop worked
@@ -93,7 +93,7 @@ class WorkerProfiler(ABC):
93
and self._delay_iters > 0
94
and self._active_iteration_count == self._delay_iters
95
):
96
- logger.info_once("Starting profiler after delay...", scope="local")
96
+ logger.info_once("Starting profiler after delay...")
97
self._call_start()
98
99
# Call profiler step for schedule-based profiling
@@ -109,9 +109,7 @@ class WorkerProfiler(ABC):
109
# Automatically stop the profiler after max iters
110
# will be marked as not running, but leave as active so that stop
111
# can clean up properly
112
- logger.info_once(
113
- "Max profiling iterations reached. Stopping profiler...", scope="local"
114
- )
112
+ logger.info_once("Max profiling iterations reached. Stopping profiler...")
113
self._call_stop()
114
return
115
@@ -141,7 +139,7 @@ class WorkerProfiler(ABC):
139
140
def shutdown(self) -> None:
141
"""Ensure profiler is stopped when shutting down."""
144
- logger.info_once("Shutting down profiler", scope="local")
142
+ logger.info_once("Shutting down profiler")
143
if self._running:
144
self.stop()
145
@@ -176,7 +174,6 @@ class TorchProfilerWrapper(WorkerProfiler):
174
logger.info_once(
175
"Torch profiling enabled. Traces will be saved to: %s",
176
torch_profiler_trace_dir,
179
- scope="local",
177
)
178
logger.debug(
179
"Profiler config: record_shapes=%s,"
@@ -216,7 +213,6 @@ class TorchProfilerWrapper(WorkerProfiler):
213
profiler_config.wait_iterations,
214
profiler_config.warmup_iterations,
215
profiler_config.active_iterations,
219
- scope="local",
216
)
217
218
self.profiler = torch.profiler.profile(
vllm/utils/deep_gemm.py
+3
-5
@@ -106,16 +106,14 @@ def is_deep_gemm_e8m0_used() -> bool:
106
_lazy_init()
107
108
if _fp8_gemm_nt_impl is None:
109
- logger.info_once(
110
- "DeepGEMM E8M0 disabled: _fp8_gemm_nt_impl not found", scope="local"
111
- )
109
+ logger.info_once("DeepGEMM E8M0 disabled: _fp8_gemm_nt_impl not found")
110
return False
111
112
if envs.VLLM_USE_DEEP_GEMM_E8M0:
115
- logger.info_once("DeepGEMM E8M0 enabled on current platform.", scope="local")
113
+ logger.info_once("DeepGEMM E8M0 enabled on current platform.")
114
return True
115
118
- logger.info_once("DeepGEMM E8M0 disabled on current configuration.", scope="local")
116
+ logger.info_once("DeepGEMM E8M0 disabled on current configuration.")
117
return False
118
119
vllm/utils/import_utils.py
-2
@@ -66,14 +66,12 @@ def import_triton_kernels():
66
67
logger.debug_once(
68
f"Loading module triton_kernels from {triton_kernels.__file__}.",
69
- scope="local",
69
)
70
elif _has_module("vllm.third_party.triton_kernels"):
71
import vllm.third_party.triton_kernels as triton_kernels
72
73
logger.debug_once(
74
f"Loading module triton_kernels from {triton_kernels.__file__}.",
76
- scope="local",
75
)
76
sys.modules["triton_kernels"] = triton_kernels
77
else:
vllm/v1/attention/backends/fa_utils.py
-1
@@ -118,7 +118,6 @@ def get_flash_attn_version(
118
logger.warning_once(
119
"Cannot use FA version 4 with batch invariance, "
120
"defaulting to FA version 2.",
121
- scope="local",
121
)
122
fa_version = 2
123
vllm/v1/attention/backends/flash_attn.py
-1
@@ -637,7 +637,6 @@ class FlashAttentionImpl(AttentionImpl):
637
logger.info_once(
638
"Using FlashAttention version %s",
639
self.vllm_flash_attn_version,
640
- scope="local",
640
)
641
# Cache the batch invariant result for use in forward passes
642
self.batch_invariant_enabled = envs.VLLM_BATCH_INVARIANT
vllm/v1/core/kv_cache_utils.py
+1
-5
@@ -1334,7 +1334,7 @@ def _report_kv_cache_config(
1334
dcp_size,
1335
)
1336
num_tokens_str = f"{num_tokens:,}"
1337
- logger.info_once("GPU KV cache size: %s tokens", num_tokens_str, scope="local")
1337
+ logger.info_once("GPU KV cache size: %s tokens", num_tokens_str)
1338
max_model_len_str = f"{vllm_config.model_config.max_model_len:,}"
1339
max_concurrency = get_max_concurrency_for_kv_cache_config(
1340
vllm_config, kv_cache_config
@@ -1343,7 +1343,6 @@ def _report_kv_cache_config(
1343
"Maximum concurrency for %s tokens per request: %.2fx",
1344
max_model_len_str,
1345
max_concurrency,
1346
- scope="local",
1346
)
1347
1348
@@ -1445,7 +1444,6 @@ def _auto_fit_max_model_len(
1444
"Auto-fit max_model_len: attention-free model, "
1445
"using derived max_model_len=%d",
1446
original_max,
1448
- scope="local",
1447
)
1448
return
1449
@@ -1472,7 +1470,6 @@ def _auto_fit_max_model_len(
1470
"Auto-fit max_model_len: full model context length %d fits in "
1471
"available GPU memory",
1472
original_max,
1475
- scope="local",
1473
)
1474
else:
1475
# Need to reduce max_model_len to fit in memory
@@ -1483,7 +1480,6 @@ def _auto_fit_max_model_len(
1480
original_max,
1481
auto_fit_max,
1482
format_gib(limiting_worker_mem),
1486
- scope="local",
1483
)
1484
1485
vllm/v1/engine/core.py
-3
@@ -293,7 +293,6 @@ class EngineCore:
293
compile_time + encoder_compile_time,
294
compile_time,
295
encoder_compile_time,
296
- scope="local",
296
)
297
elif compile_time > 0:
298
logger.info_once(
@@ -301,13 +300,11 @@ class EngineCore:
300
"%.2f s (compilation: %.2f s)",
301
elapsed,
302
compile_time,
304
- scope="local",
303
)
304
else:
305
logger.info_once(
306
"init engine (profile, create kv cache, warmup model) took %.2f s",
307
elapsed,
310
- scope="local",
308
)
309
return scheduler_kv_cache_config
310
vllm/v1/executor/multiproc_executor.py
-1
@@ -1032,7 +1032,6 @@ def set_multiprocessing_worker_envs():
1032
"external environment to tune this value as needed.",
1033
current_parallelism,
1034
default_omp_num_threads,
1035
- scope="local",
1035
)
1036
os.environ["OMP_NUM_THREADS"] = str(default_omp_num_threads)
1037
torch.set_num_threads(default_omp_num_threads)
vllm/v1/worker/dp_utils.py
-1
@@ -29,7 +29,6 @@ def _get_device_and_group(parallel_config: ParallelConfig):
29
if parallel_config.disable_nccl_for_dp_synchronization:
30
logger.info_once(
31
"Using CPU all reduce to synchronize DP padding between ranks.",
32
- scope="local",
32
)
33
device = "cpu"
34
group = get_dp_group().cpu_group
vllm/v1/worker/gpu/eplb_utils.py
+1
-3
@@ -92,9 +92,7 @@ class EPLBController:
92
if not is_mixture_of_experts(model):
93
return False
94
95
- logger.info_once(
96
- "EPLB is enabled for model %s.", model_config.model, scope="local"
97
- )
95
+ logger.info_once("EPLB is enabled for model %s.", model_config.model)
96
assert self.state is not None
97
self.state.add_model(model, model_config)
98
self._has_registered_models = True
vllm/v1/worker/gpu_model_runner.py
+1
-6
@@ -4855,7 +4855,6 @@ class GPUModelRunner(
4855
"Model loading took %s GiB memory and %.6f seconds",
4856
format_gib(self.model_memory_usage),
4857
time_after_load - time_before_load,
4858
- scope="local",
4858
)
4859
if not load_dummy_weights:
4860
prepare_communication_buffer_for_model(self.model)
@@ -4989,7 +4988,7 @@ class GPUModelRunner(
4988
)
4989
4990
# begin loading weights
4992
- logger.info_once("Reloading weights inplace...", scope="local")
4991
+ logger.info_once("Reloading weights inplace...")
4992
if is_checkpoint_format:
4993
# load weights from checkpoint/ original model format
4994
initialize_layerwise_reload(model)
@@ -5001,7 +5000,6 @@ class GPUModelRunner(
5000
logger.warning_once(
5001
"Reloading with `is_checkpoint_format=True` requires that "
5002
"weights be in kernel format and already sharded",
5004
- scope="local",
5003
)
5004
loaded_weights = set()
5005
for name, loaded_weight in weights_iterator:
@@ -5015,7 +5013,6 @@ class GPUModelRunner(
5013
logger.info_once(
5014
"Reloading and processing weights took %.2f seconds",
5015
diff_seconds,
5018
- scope="local",
5016
)
5017
if self.model_config.quantization is None and loaded_weights is not None:
5018
weights_not_loaded = weights_to_load - loaded_weights
@@ -5802,7 +5799,6 @@ class GPUModelRunner(
5799
encoder_budget,
5800
max_mm_items_per_batch,
5801
dummy_modality,
5805
- scope="local",
5802
)
5803
5804
# Create dummy batch of multimodal inputs.
@@ -6099,7 +6095,6 @@ class GPUModelRunner(
6095
"Graph capturing finished in %.0f secs, took %.2f GiB",
6096
elapsed_time,
6097
cuda_graph_size / (1 << 30),
6102
- scope="local",
6098
)
6099
return cuda_graph_size
6100
vllm/v1/worker/gpu_worker.py
+1
-2
@@ -269,7 +269,7 @@ class Worker(WorkerBase):
269
)
270
271
if self.use_v2_model_runner:
272
- logger.info_once("Using V2 Model Runner", scope="local")
272
+ logger.info_once("Using V2 Model Runner")
273
274
# Set random seed.
275
set_random_seed(self.model_config.seed)
@@ -440,7 +440,6 @@ class Worker(WorkerBase):
440
logger.info_once(
441
"Available KV cache memory: %s GiB",
442
format_gib(self.available_kv_cache_memory_bytes),
443
- scope="local",
443
)
444
445
if cudagraph_memory_estimate > 0: