[torch.compile] caching of config fields should be opt-out by default (#26468)
Signed-off-by: vnadathur <glvikramn@gmail.com> Signed-off-by: WorldExplored <srreyansh.sethi@gmail.com> Signed-off-by: Srreyansh Sethi <srreyansh.sethi@gmail.com> Signed-off-by: Srreyansh Sethi <107075589+WorldExplored@users.noreply.github.com> Co-authored-by: WorldExplored <srreyansh.sethi@gmail.com> Co-authored-by: Srreyansh Sethi <107075589+worldexplored@users.noreply.github.com> Co-authored-by: vnadathur <236933696+vnadathur@users.noreply.github.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
This commit is contained in:
co-authored by
WorldExplored
Srreyansh Sethi
vnadathur
Luka Govedič
parent
2c8b9182b5
commit
1ffe934c8a
@@ -2,9 +2,11 @@
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from vllm.logging_utils.formatter import NewLineFormatter
|
||||
from vllm.logging_utils.lazy import lazy
|
||||
from vllm.logging_utils.log_time import logtime
|
||||
|
||||
__all__ = [
|
||||
"NewLineFormatter",
|
||||
"lazy",
|
||||
"logtime",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
|
||||
class lazy:
|
||||
"""Wrap a zero-argument callable evaluated only during log formatting."""
|
||||
|
||||
__slots__ = ("_factory",)
|
||||
|
||||
def __init__(self, factory: Callable[[], Any]) -> None:
|
||||
self._factory = factory
|
||||
|
||||
def __str__(self) -> str:
|
||||
return str(self._factory())
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return str(self)
|
||||
Reference in New Issue
Block a user