Skip to content

Commit 9f78b9c

Browse files
ZJY0516yewentao256
authored andcommitted
[torch.compile] serialize cudagraph_mode as its enum name instead of value (#25868)
Signed-off-by: zjy0516 <riverclouds.zhu@qq.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
1 parent 4e2774f commit 9f78b9c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

vllm/config/compilation.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ def valid_runtime_modes(self) -> bool:
7373
CUDAGraphMode.NONE, CUDAGraphMode.PIECEWISE, CUDAGraphMode.FULL
7474
]
7575

76+
def __str__(self) -> str:
77+
return self.name
78+
7679

7780
@config
7881
@dataclass
@@ -417,10 +420,11 @@ def __repr__(self) -> str:
417420
if pass_config_exclude:
418421
exclude["pass_config"] = pass_config_exclude
419422

420-
return TypeAdapter(CompilationConfig).dump_json(
421-
self,
422-
exclude=exclude, # type: ignore[arg-type]
423-
exclude_unset=True).decode()
423+
config = TypeAdapter(CompilationConfig).dump_python(self,
424+
exclude=exclude,
425+
exclude_unset=True)
426+
427+
return str(config)
424428

425429
__str__ = __repr__
426430

0 commit comments

Comments
 (0)