Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trt-llm] always perform verbose dump of defaults for forward compatibility #1338

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions truss/base/trt_llm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,5 @@ def requires_build(self):

# TODO(Abu): Replace this with model_dump(json=True)
# when pydantic v2 is used here
def to_json_dict(self, verbose=True):
return json.loads(self.json(exclude_unset=not verbose))
def to_json_dict(self):
return json.loads(self.json())
2 changes: 1 addition & 1 deletion truss/base/truss_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ def obj_to_dict(obj, verbose: bool = False):
)
elif isinstance(field_curr_value, TRTLLMConfiguration):
d["trt_llm"] = transform_optional(
field_curr_value, lambda data: data.to_json_dict(verbose=verbose)
field_curr_value, lambda data: data.to_json_dict()
)
elif isinstance(field_curr_value, BaseImage):
d["base_image"] = transform_optional(
Expand Down
14 changes: 5 additions & 9 deletions truss/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,17 @@
{
"name": "Main usage",
"commands": ["init", "push", "watch", "predict"],
"table_styles": { # type: ignore
"row_styles": ["green"]
},
"table_styles": {"row_styles": ["green"]}, # type: ignore
},
{
"name": "Advanced Usage",
"commands": ["image", "container", "cleanup"],
"table_styles": { # type: ignore
"row_styles": ["yellow"]
},
"table_styles": {"row_styles": ["yellow"]}, # type: ignore
},
{
"name": "Chains",
"commands": ["chains"],
"table_styles": { # type: ignore
"row_styles": ["red"]
},
"table_styles": {"row_styles": ["red"]}, # type: ignore
},
]
}
Expand Down Expand Up @@ -1179,6 +1173,8 @@ def push(
"`num_builder_gpus` can be used to specify the number of GPUs to use at build time."
)
console.print(fp8_and_num_builder_gpus_text, style="yellow")
# dump full config to yaml to ensure forward compatibility of current defaults
tr.spec.config.write_to_yaml_file(tr.spec.config_path, verbose=False)

# TODO(Abu): This needs to be refactored to be more generic
service = remote_provider.push(
Expand Down
Loading