Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
da511d54
Unverified
Commit
da511d54
authored
Jun 06, 2025
by
Richard Zou
Committed by
GitHub
Jun 06, 2025
Browse files
Fix CompilationConfig repr (#19091)
Signed-off-by:
rzou
<
zou3519@gmail.com
>
parent
65c69444
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
+33
-15
tests/test_config.py
tests/test_config.py
+13
-0
vllm/config.py
vllm/config.py
+20
-15
No files found.
tests/test_config.py
View file @
da511d54
...
...
@@ -6,6 +6,7 @@ from typing import Literal, Union
import
pytest
from
vllm.compilation.backends
import
VllmBackend
from
vllm.config
import
(
LoadConfig
,
ModelConfig
,
PoolerConfig
,
VllmConfig
,
config
,
get_field
)
from
vllm.model_executor.layers.pooler
import
PoolingType
...
...
@@ -44,6 +45,18 @@ def test_config(test_config, expected_error):
config
(
test_config
)
def
test_compile_config_repr_succeeds
():
# setup: VllmBackend mutates the config object
config
=
VllmConfig
()
backend
=
VllmBackend
(
config
)
backend
.
configure_post_pass
()
# test that repr(config) succeeds
val
=
repr
(
config
)
assert
'VllmConfig'
in
val
assert
'inductor_passes'
in
val
def
test_get_field
():
@
dataclass
...
...
vllm/config.py
View file @
da511d54
...
...
@@ -4007,19 +4007,24 @@ class CompilationConfig:
def
__repr__
(
self
)
->
str
:
exclude
=
{
"static_forward_context"
,
"enabled_custom_ops"
,
"disabled_custom_ops"
,
"compilation_time"
,
"bs_to_padded_graph_size"
,
"pass_config"
,
"traced_files"
,
"static_forward_context"
:
True
,
"enabled_custom_ops"
:
True
,
"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
,
},
}
# 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
(
TypeAdapter
(
CompilationConfig
).
dump_json
(
self
,
exclude
=
exclude
,
exclude_unset
=
True
).
decode
())
self
,
exclude
=
exclude
,
# type: ignore[arg-type]
exclude_unset
=
True
).
decode
())
__str__
=
__repr__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment