-
Notifications
You must be signed in to change notification settings - Fork 59
[AQUA] Improve Handling of Default SMM Parameters for Model Deployment #1305
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
9e7c5d6
e9b9a6b
f894725
27c1755
314e085
94123be
241dfee
57de9c6
9300052
61bef3d
1a25531
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ | |
| from ads.aqua.common.utils import ( | ||
| build_params_string, | ||
| find_restricted_params, | ||
| get_combined_params, | ||
| get_container_params_type, | ||
| get_params_dict, | ||
| ) | ||
|
|
@@ -177,26 +176,35 @@ def _merge_gpu_count_params( | |
| model.model_id, AquaDeploymentConfig() | ||
| ).configuration.get(deployment_details.instance_shape, ConfigurationItem()) | ||
|
|
||
| final_model_params = user_params | ||
| params_found = False | ||
| for item in deployment_config.multi_model_deployment: | ||
| if model.gpu_count and item.gpu_count and item.gpu_count == model.gpu_count: | ||
| config_parameters = item.parameters.get( | ||
|
|
||
| # If user DID NOT provide specific params (None or Empty), we look for defaults | ||
| if not user_params: | ||
|
||
| for item in deployment_config.multi_model_deployment: | ||
| if ( | ||
| model.gpu_count | ||
| and item.gpu_count | ||
| and item.gpu_count == model.gpu_count | ||
| ): | ||
| config_parameters = item.parameters.get( | ||
| get_container_params_type(container_type_key), UNKNOWN | ||
| ) | ||
| if config_parameters: | ||
| final_model_params = config_parameters | ||
| params_found = True | ||
| break | ||
|
|
||
| if not params_found and deployment_config.parameters: | ||
| config_parameters = deployment_config.parameters.get( | ||
| get_container_params_type(container_type_key), UNKNOWN | ||
| ) | ||
| params = f"{params} {get_combined_params(config_parameters, user_params)}".strip() | ||
| if config_parameters: | ||
| final_model_params = config_parameters | ||
| params_found = True | ||
| break | ||
|
|
||
| if not params_found and deployment_config.parameters: | ||
| config_parameters = deployment_config.parameters.get( | ||
| get_container_params_type(container_type_key), UNKNOWN | ||
| ) | ||
| params = f"{params} {get_combined_params(config_parameters, user_params)}".strip() | ||
| params_found = True | ||
|
|
||
| # if no config parameters found, append user parameters directly. | ||
| if not params_found: | ||
| params = f"{params} {user_params}".strip() | ||
| # Combine Container System Defaults (params) + Model Params (final_model_params) | ||
| params = f"{params} {final_model_params}".strip() | ||
|
|
||
| return params | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to validate
find_restricted_paramsonly ifdeployment_params = user_input_params. Other case may cause error like whendeployment_params = config_paramsand its not needed as this params is not provided by user.We should put this
if deployment_params:statement under line 941.cc: @mrDzurb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn’t allow this situation. We must validate both user-provided and default params, since some system parameters are immutable. If the defaults include restricted parameters, we should throw an error and fix the default config on our side. Ideally, we’d offer a way to bypass validation, but that option doesn’t exist today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, so in the case of defaut config, this should raise service error with clear wording instead of aqua value error?