File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11
11
from .piecewise .test_simple import SillyModel
12
12
13
13
14
+ def test_use_cudagraphs_dynamic (monkeypatch ):
15
+ assert vllm .envs .VLLM_USE_V1
16
+ vllm_config = VllmConfig ()
17
+ assert vllm_config .compilation_config .use_cudagraph
18
+
19
+ monkeypatch .setenv ('VLLM_USE_V1' , '0' )
20
+ vllm_config = VllmConfig ()
21
+ assert not vllm_config .compilation_config .use_cudagraph
22
+
23
+
14
24
@pytest .mark .parametrize ("enabled" , [True , False ])
15
25
def test_use_cudagraphs (enabled ):
16
26
assert vllm .envs .VLLM_USE_V1
Original file line number Diff line number Diff line change @@ -3938,7 +3938,7 @@ class CompilationConfig:
3938
3938
constructor, e.g. `CompilationConfig(inductor_passes={"a": func})`."""
3939
3939
3940
3940
# CudaGraph compilation
3941
- use_cudagraph : bool = envs .VLLM_USE_V1
3941
+ use_cudagraph : bool = field ( default_factory = lambda : envs .VLLM_USE_V1 )
3942
3942
"""Whether to use cudagraph inside compilation.
3943
3943
- False: cudagraph inside compilation is not used.
3944
3944
- True: cudagraph inside compilation is used. It requires
You can’t perform that action at this time.
0 commit comments