mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-07-08 04:07:14 +08:00
[Refactor] refactor freezing_value/cuda_event initialize outside try finally (#23758)
Signed-off-by: Andy Xie <andy.xning@gmail.com>
This commit is contained in:
parent
fb4983e112
commit
e80bca309e
@ -128,8 +128,8 @@ def _torch_cuda_wrapper():
|
|||||||
self.record = lambda: None
|
self.record = lambda: None
|
||||||
self.synchronize = lambda: None
|
self.synchronize = lambda: None
|
||||||
|
|
||||||
|
cuda_event = torch.cuda.Event
|
||||||
try:
|
try:
|
||||||
cuda_event = torch.cuda.Event
|
|
||||||
torch.cuda.Event = _EventPlaceholder
|
torch.cuda.Event = _EventPlaceholder
|
||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
@ -141,9 +141,9 @@ def _set_global_compilation_settings(config: VllmConfig):
|
|||||||
import torch._inductor.config
|
import torch._inductor.config
|
||||||
|
|
||||||
inductor_config = config.compilation_config.inductor_compile_config
|
inductor_config = config.compilation_config.inductor_compile_config
|
||||||
|
# Note: The MKLDNN and CPPGEMM backend requires freezing parameters.
|
||||||
|
freezing_value = torch._inductor.config.freezing
|
||||||
try:
|
try:
|
||||||
# Note: The MKLDNN and CPPGEMM backend requires freezing parameters.
|
|
||||||
freezing_value = torch._inductor.config.freezing
|
|
||||||
if inductor_config.get("max_autotune", False):
|
if inductor_config.get("max_autotune", False):
|
||||||
torch._inductor.config.freezing = True
|
torch._inductor.config.freezing = True
|
||||||
yield
|
yield
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user