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 1111from .piecewise .test_simple import SillyModel
1212
1313
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+
1424@pytest .mark .parametrize ("enabled" , [True , False ])
1525def test_use_cudagraphs (enabled ):
1626 assert vllm .envs .VLLM_USE_V1
Original file line number Diff line number Diff line change @@ -3931,7 +3931,7 @@ class CompilationConfig:
39313931 constructor, e.g. `CompilationConfig(inductor_passes={"a": func})`."""
39323932
39333933 # CudaGraph compilation
3934- use_cudagraph : bool = envs .VLLM_USE_V1
3934+ use_cudagraph : bool = field ( default_factory = lambda : envs .VLLM_USE_V1 )
39353935 """Whether to use cudagraph inside compilation.
39363936 - False: cudagraph inside compilation is not used.
39373937 - True: cudagraph inside compilation is used. It requires
You can’t perform that action at this time.
0 commit comments