-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Add deployment support for deployment recommendations #3695
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
Conversation
Can we clarify something?
if so, we could also consider consolidating our multiple model variables into one called
|
Good point. For model name passed in case, since we'll create model for customer so we could check the results and store in
|
got it. So we could have the option in |
except sage_client.exceptions.ResourceNotFound: | ||
pass | ||
try: | ||
model_res = sage_client.describe_model(ModelName=recommendation_job_name) |
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 don't need to make this call if describe_inference_recommendations_job
works right?
May be we can create three private methods to modularize the code since this method is getting big.
def _get_model_recommendation_id(self):
# get recommendation id from model
def _get_right_size_recommendation_id(self):
# get recommendation id from right size job
def _get_recommendation_id(self):
try:
_get_right_size_recommendation_id(self)
except:
_get_model_recommendation_id(self)
def _update_params_for_recommendation_id(...):
try:
recommendation_id = _get_recommendation_id(self)
except:
raise ValueError("Inference Recommendation id is not valid")
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.
- as we discussed before, what if customer's
JobName
andModelName
are the same, egthanos/abcd1234
andthanos/abcd5678
, then we need to find out it's inference or model recommendation. So go through two lists(inference_recommendations and model_recommendations) to get the recommendation is needed. So here I am thinking we need to loop through two lists anyway - good point, will create separate methods
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 should only call describemodel if the recommendation id is not in the right_size recommendations.
Otherwise it is a wasted api call
None, | ||
) | ||
if inference_recommendation is None and instant_recommendation is None: | ||
raise ValueError("Inference Recommendation id does not exist") |
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.
id is invalid
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.
ack, will modify
raise ValueError("Inference Recommendation id does not exist") | ||
|
||
# Update params beased on instant recommendation | ||
if instant_recommendation: |
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.
could we not call it "instant"?
maybe use the names "right_size_recommendation" and "model_recommendation"?
Because that indicates the source of the recommendation
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.
makes sense, will rename them
I think we need to confirm if we want customer to use Here is I think we could modify: @jbarz1 what do you think? |
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.
/bot run all
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.
/bot run all
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Codecov Report
@@ Coverage Diff @@
## master #3695 +/- ##
==========================================
- Coverage 89.79% 89.01% -0.78%
==========================================
Files 980 230 -750
Lines 92208 22839 -69369
==========================================
- Hits 82796 20330 -62466
+ Misses 9412 2509 -6903
... and 1209 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
/bot run all
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
if model_recommendation: | ||
if initial_instance_count is None: | ||
raise ValueError( | ||
"Please specify initial_instance_count with model recommendation id" |
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.
prefer same style as messages in model.py
Must specify recommendation id and instance count.
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.
thanks, modified in next rev
raise ValueError( | ||
"inference_recommendation_id does not exist in InferenceRecommendations list" | ||
"Please either do not specify instance_type and initial_instance_count" |
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.
similar to this
instance type and intial instance count are mutually exclusive with recommendation id
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.
modified in next rev
@@ -442,8 +446,10 @@ def _update_params_for_recommendation_id( | |||
self.model_data = compilation_res["ModelArtifacts"]["S3ModelArtifacts"] | |||
self.image_uri = compilation_res["InferenceImage"] | |||
|
|||
instance_type = recommendation["EndpointConfiguration"]["InstanceType"] | |||
initial_instance_count = recommendation["EndpointConfiguration"]["InitialInstanceCount"] | |||
instance_type = right_size_recommendation["EndpointConfiguration"]["InstanceType"] |
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.
what if right_size_recommendation is also None? Won't this fail ?
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.
This case has been caught by here.
So _get_recommendation
will ensure either right_size_recommendation
or model_recommendation
exists, nevertheless it will throw exception for invalid recommendation id
pushed commits on top of this. closing |
Issue #, if available:
Description of changes:
Testing done:
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
unique_name_from_base
to create resource names in integ tests (if appropriate)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.