Skip to content

Commit ae6e95f

Browse files
committed
fixed small bug w/ constants
1 parent 648ed5b commit ae6e95f

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

ads/aqua/modeldeployment/deployment.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,35 +1288,42 @@ def validate_deployment_params(
12881288

12891289
def recommend_shape(self, **kwargs) -> Union[Table, ShapeRecommendationReport]:
12901290
"""
1291-
For the CLI (set generate_table = True), generates the table (in rich diff) with valid
1291+
For the CLI (set by default, generate_table = True), generates the table (in rich diff) with valid
12921292
GPU deployment shapes for the provided model and configuration.
12931293
12941294
For the API (set generate_table = False), generates the JSON with valid
12951295
GPU deployment shapes for the provided model and configuration.
12961296
1297-
Validates if recommendations are generated, calls method to construct the rich diff
1298-
table with the recommendation data.
1297+
Validates the input and determines whether recommendations are available.
12991298
13001299
Parameters
13011300
----------
1302-
model_ocid : str
1303-
OCID of the model to recommend feasible compute shapes.
1301+
**kwargs
1302+
model_ocid : str
1303+
(Required) The OCID of the model to recommend feasible compute shapes for.
1304+
generate_table : bool, optional
1305+
If True, generate and return a rich-diff table; if False, return a JSON response (default is False).
1306+
compartment_id : str, optional
1307+
The OCID of the user's compartment to use for the recommendation.
13041308
13051309
Returns
13061310
-------
13071311
Table (generate_table = True)
1308-
A table format for the recommendation report with compatible deployment shapes
1309-
or troubleshooting info citing the largest shapes if no shape is suitable.
1312+
If `generate_table` is True, a table displaying the recommendation report with compatible deployment shapes,
1313+
or troubleshooting info if no shape is suitable.
13101314
13111315
ShapeRecommendationReport (generate_table = False)
1312-
A recommendation report with compatible deployment shapes, or troubleshooting info
1313-
citing the largest shapes if no shape is suitable.
1316+
If `generate_table` is False, a structured recommendation report with compatible deployment shapes,
1317+
or troubleshooting info and citing the largest shapes if no shape is suitable.
13141318
13151319
Raises
13161320
------
13171321
AquaValueError
1318-
If model type is unsupported by tool (no recommendation report generated)
1322+
If the model type is unsupported and no recommendation report can be generated.
13191323
"""
1324+
deployment_config = self.get_deployment_config(model_id=kwargs.get("model_id"))
1325+
kwargs["deployment_config"] = deployment_config
1326+
13201327
try:
13211328
request = RequestRecommend(**kwargs)
13221329
except ValidationError as e:

ads/aqua/shaperecommend/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
IN_FLIGHT_QUANTIZATION = {"4bit"} # vLLM only supports 4bit in-flight-quantization
8888

89-
VLLM_PARAMS = "VLLM_PARAMS"
89+
VLLM_PARAMS_FAMILY = "VLLM_PARAMS"
9090
VLLM_ENV = "VLLM"
9191

9292
QUANT_FLAG = "--quantization"

ads/aqua/shaperecommend/shape_report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
QUANT_FLAG,
1717
QUANT_MAPPING,
1818
VLLM_ENV,
19-
VLLM_PARAMS,
19+
VLLM_PARAMS_FAMILY,
2020
WEIGHT_DTYPE_FLAG,
2121
)
2222
from ads.aqua.shaperecommend.estimator import MemoryEstimator
@@ -341,7 +341,7 @@ def from_deployment_config(
341341
continue
342342

343343
recommendation = ""
344-
current_params = current_config.parameters.get(VLLM_PARAMS)
344+
current_params = current_config.parameters.get(VLLM_PARAMS_FAMILY)
345345
current_env = current_config.env.get(VLLM_ENV)
346346

347347
deployment_params = cls.create_deployment_config_from_params_string(

0 commit comments

Comments
 (0)