-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: jumpstart EULA models #3999
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
|
||
model_artifact_key = None | ||
|
||
for model_artifact_field_name in _MODEL_ARTIFACT_PRIORITY_LIST: |
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.
just from a code legibility standpoint this for-loop block would benefit from being extracted into a helper function
if script_scope == JumpStartScriptScope.INFERENCE: | ||
script_uri = getattr(model_specs, "hosting_script_uri", None) | ||
if script_uri is not None: |
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.
Same here, I'm not a fan of the nested ifs. Not a blocker through
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 |
Codecov Report
@@ Coverage Diff @@
## master #3999 +/- ##
==========================================
- Coverage 90.18% 89.42% -0.77%
==========================================
Files 1296 307 -989
Lines 114144 28274 -85870
==========================================
- Hits 102940 25283 -77657
+ Misses 11204 2991 -8213
|
427c22e
to
2367d16
Compare
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 |
src/sagemaker/jumpstart/types.py
Outdated
@@ -351,6 +351,8 @@ class JumpStartModelSpecs(JumpStartDataHolderType): | |||
"inference_enable_network_isolation", | |||
"training_enable_network_isolation", | |||
"resource_name_base", | |||
"eula_model", |
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.
Should we pass the eula filepath here? We may eventually need to make this retrievable for customers (otherwise they are just blindly accepting something)
@@ -402,6 +402,12 @@ def verify_model_region_and_return_specs( | |||
f"JumpStart model ID '{model_id}' and version '{version}' " "does not support training." | |||
) | |||
|
|||
if model_specs.eula_model: | |||
LOGGER.info( |
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.
See prior comment, we can perhaps give them the ability to retrieve the EULA from our public bucket
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 |
src/sagemaker/jumpstart/utils.py
Outdated
if model_specs.eula_model: | ||
LOGGER.info( | ||
"Using model with end-user license agreement (EULA). " | ||
"Deploying this model requires accepting EULA terms." |
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.
May want to provide a more exact call to action
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 |
@evakravi Please remove from draft and ping me when you need this to be reviewed from sagemaker team - Thanks |
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 |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@@ -2299,6 +2299,8 @@ | |||
"training_script_key": "source-directory-tarballs/pytorch/transfer_learning/ic/v1.0.0/sourcedir.tar.gz", | |||
"training_prepacked_script_key": None, | |||
"hosting_prepacked_artifact_key": None, | |||
"hosting_model_package_arns": None, | |||
"hosting_eula_key": False, |
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 will have to change it to None
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.
Changes looks good to me. Once this change is public we are planning to have a follow-up PR to add integ-test as well as unit tests under jumpstart module.
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 |
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 |
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 you also add unit tests for model package flow as well?
|
||
super(JumpStartModel, self).__init__(**model_init_kwargs.to_kwargs_dict()) | ||
|
||
def _create_sagemaker_model(self, *args, **kwargs): # pylint: disable=unused-argument | ||
"""Create a SageMaker Model Entity |
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.
nit^2: missing period .
at the end of the docstring.
model_id, | ||
get_jumpstart_content_bucket(region=region), | ||
region, | ||
".cn" if region.startswith("cn-") else "", |
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.
callout: this may not work for gov-cloud.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue #, if available:
Description of changes:
JumpStart is releasing models that require the customer to accept an end-user license agreement (EULA). These models have protected model weights, so the artifacts cannot be stored in public S3 buckets.
Models that require EULA will rely use a
ModelPackage
to store the model weights. This paradigm requires modifying the metadata for JumpStart models, as well as modifying the workflow so that if a model package arn is detected, a Model is created from the model package versus the normal method of injecting public s3 artifacts into the container.custom_attributes
field was also added toPredictor
class to support EULA models.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.