mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-25 04:04:26 +08:00
[BugFix] Allow use_cudagraph to work with dynamic VLLM_USE_V1 (#19390)
Signed-off-by: rzou <zou3519@gmail.com>
This commit is contained in:
parent
22c3c0aa4a
commit
77f0d465d0
@ -11,6 +11,16 @@ from vllm.config import (CompilationConfig, CompilationLevel, VllmConfig,
|
|||||||
from .piecewise.test_simple import SillyModel
|
from .piecewise.test_simple import SillyModel
|
||||||
|
|
||||||
|
|
||||||
|
def test_use_cudagraphs_dynamic(monkeypatch):
|
||||||
|
assert vllm.envs.VLLM_USE_V1
|
||||||
|
vllm_config = VllmConfig()
|
||||||
|
assert vllm_config.compilation_config.use_cudagraph
|
||||||
|
|
||||||
|
monkeypatch.setenv('VLLM_USE_V1', '0')
|
||||||
|
vllm_config = VllmConfig()
|
||||||
|
assert not vllm_config.compilation_config.use_cudagraph
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("enabled", [True, False])
|
@pytest.mark.parametrize("enabled", [True, False])
|
||||||
def test_use_cudagraphs(enabled):
|
def test_use_cudagraphs(enabled):
|
||||||
assert vllm.envs.VLLM_USE_V1
|
assert vllm.envs.VLLM_USE_V1
|
||||||
|
|||||||
@ -3931,7 +3931,7 @@ class CompilationConfig:
|
|||||||
constructor, e.g. `CompilationConfig(inductor_passes={"a": func})`."""
|
constructor, e.g. `CompilationConfig(inductor_passes={"a": func})`."""
|
||||||
|
|
||||||
# CudaGraph compilation
|
# CudaGraph compilation
|
||||||
use_cudagraph: bool = envs.VLLM_USE_V1
|
use_cudagraph: bool = field(default_factory=lambda: envs.VLLM_USE_V1)
|
||||||
"""Whether to use cudagraph inside compilation.
|
"""Whether to use cudagraph inside compilation.
|
||||||
- False: cudagraph inside compilation is not used.
|
- False: cudagraph inside compilation is not used.
|
||||||
- True: cudagraph inside compilation is used. It requires
|
- True: cudagraph inside compilation is used. It requires
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user