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
[Refactor] refactor freezing_value/cuda_event initialize outside try finally (#23758)
Signed-off-by: Andy Xie <andy.xning@gmail.com>
Ning Xie committed
Aug 30, 2025 at 21:42 UTC
e80bca309eb866e6d62e081e6ad80f3e10c113e9
1 file changed
+3
-3
vllm/v1/worker/cpu_model_runner.py
+3
-3
@@ -128,8 +128,8 @@ def _torch_cuda_wrapper():
128
self.record = lambda: None
129
self.synchronize = lambda: None
130
131
+ cuda_event = torch.cuda.Event
132
try:
132
- cuda_event = torch.cuda.Event
133
torch.cuda.Event = _EventPlaceholder
134
yield
135
finally:
@@ -141,9 +141,9 @@ def _set_global_compilation_settings(config: VllmConfig):
141
import torch._inductor.config
142
143
inductor_config = config.compilation_config.inductor_compile_config
144
+ # Note: The MKLDNN and CPPGEMM backend requires freezing parameters.
145
+ freezing_value = torch._inductor.config.freezing
146
try:
145
- # Note: The MKLDNN and CPPGEMM backend requires freezing parameters.
146
- freezing_value = torch._inductor.config.freezing
147
if inductor_config.get("max_autotune", False):
148
torch._inductor.config.freezing = True
149
yield