Unverified Commit 43227236 authored by Jiangyun Zhu's avatar Jiangyun Zhu Committed by GitHub
Browse files

[torch.compile] serialize cudagraph_mode as its enum name instead of value (#25868)


Signed-off-by: default avatarzjy0516 <riverclouds.zhu@qq.com>
parent 8616300a
......@@ -73,6 +73,9 @@ class CUDAGraphMode(enum.Enum):
CUDAGraphMode.NONE, CUDAGraphMode.PIECEWISE, CUDAGraphMode.FULL
]
def __str__(self) -> str:
return self.name
@config
@dataclass
......@@ -417,10 +420,11 @@ class CompilationConfig:
if pass_config_exclude:
exclude["pass_config"] = pass_config_exclude
return TypeAdapter(CompilationConfig).dump_json(
self,
exclude=exclude, # type: ignore[arg-type]
exclude_unset=True).decode()
config = TypeAdapter(CompilationConfig).dump_python(self,
exclude=exclude,
exclude_unset=True)
return str(config)
__str__ = __repr__
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment