|
13 | 13 | from ads.aqua.common.utils import ( |
14 | 14 | build_params_string, |
15 | 15 | find_restricted_params, |
16 | | - get_combined_params, |
17 | 16 | get_container_params_type, |
18 | 17 | get_params_dict, |
19 | 18 | ) |
@@ -177,26 +176,35 @@ def _merge_gpu_count_params( |
177 | 176 | model.model_id, AquaDeploymentConfig() |
178 | 177 | ).configuration.get(deployment_details.instance_shape, ConfigurationItem()) |
179 | 178 |
|
| 179 | + final_model_params = user_params |
180 | 180 | params_found = False |
181 | | - for item in deployment_config.multi_model_deployment: |
182 | | - if model.gpu_count and item.gpu_count and item.gpu_count == model.gpu_count: |
183 | | - config_parameters = item.parameters.get( |
| 181 | + |
| 182 | + # If user DID NOT provide specific params (None or Empty), we look for defaults |
| 183 | + if not user_params: |
| 184 | + for item in deployment_config.multi_model_deployment: |
| 185 | + if ( |
| 186 | + model.gpu_count |
| 187 | + and item.gpu_count |
| 188 | + and item.gpu_count == model.gpu_count |
| 189 | + ): |
| 190 | + config_parameters = item.parameters.get( |
| 191 | + get_container_params_type(container_type_key), UNKNOWN |
| 192 | + ) |
| 193 | + if config_parameters: |
| 194 | + final_model_params = config_parameters |
| 195 | + params_found = True |
| 196 | + break |
| 197 | + |
| 198 | + if not params_found and deployment_config.parameters: |
| 199 | + config_parameters = deployment_config.parameters.get( |
184 | 200 | get_container_params_type(container_type_key), UNKNOWN |
185 | 201 | ) |
186 | | - params = f"{params} {get_combined_params(config_parameters, user_params)}".strip() |
| 202 | + if config_parameters: |
| 203 | + final_model_params = config_parameters |
187 | 204 | params_found = True |
188 | | - break |
189 | | - |
190 | | - if not params_found and deployment_config.parameters: |
191 | | - config_parameters = deployment_config.parameters.get( |
192 | | - get_container_params_type(container_type_key), UNKNOWN |
193 | | - ) |
194 | | - params = f"{params} {get_combined_params(config_parameters, user_params)}".strip() |
195 | | - params_found = True |
196 | 205 |
|
197 | | - # if no config parameters found, append user parameters directly. |
198 | | - if not params_found: |
199 | | - params = f"{params} {user_params}".strip() |
| 206 | + # Combine Container System Defaults (params) + Model Params (final_model_params) |
| 207 | + params = f"{params} {final_model_params}".strip() |
200 | 208 |
|
201 | 209 | return params |
202 | 210 |
|
|
0 commit comments