[Misc] Remove pass_config from CompilationConfig dump_json excluded (#21911)

Signed-off-by: elvischenv <219235043+elvischenv@users.noreply.github.com>
This commit is contained in:
elvischenv 2025-08-05 10:17:18 +08:00 committed by GitHub
parent 8a6e108e76
commit 7b455cf1c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4374,12 +4374,20 @@ class CompilationConfig:
"disabled_custom_ops": True,
"compilation_time": True,
"bs_to_padded_graph_size": True,
"pass_config": True,
"traced_files": True,
"inductor_compile_config": {
"post_grad_custom_post_pass": True,
},
}
# exclude default attr in pass_config
pass_config_exclude = {}
for attr, default_val in vars(PassConfig()).items():
if getattr(self.pass_config, attr) == default_val:
pass_config_exclude[attr] = True
if pass_config_exclude:
exclude["pass_config"] = pass_config_exclude
# The cast to string is necessary because Pydantic is mocked in docs
# builds and sphinx-argparse doesn't know the return type of decode()
return str(