-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: emit HyperparameterTuner tags to model and endpoint #803
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,10 @@ | |
{'ModelName': 'model-2'}] | ||
} | ||
|
||
LIST_TAGS_RESULT = { | ||
'Tags': [{'Key': 'TagtestKey', 'Value': 'TagtestValue'}] | ||
} | ||
|
||
|
||
@pytest.fixture() | ||
def sagemaker_session(): | ||
|
@@ -66,6 +70,7 @@ def sagemaker_session(): | |
session.sagemaker_client.describe_training_job = Mock(return_value=describe) | ||
session.sagemaker_client.describe_endpoint = Mock(return_value=ENDPOINT_DESC) | ||
session.sagemaker_client.describe_endpoint_config = Mock(return_value=ENDPOINT_CONFIG_DESC) | ||
session.sagemaker_client.list_tags = Mock(return_value=LIST_TAGS_RESULT) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again, there is no test that the tags actually get added to the estimator. adding an assert in test_attach would cover this. since we are testing parent class behavior, we don't need to add this for every framework, but it would be nice to test it in one of them. |
||
session.wait_for_compilation_job = Mock(return_value=describe_compilation) | ||
session.default_bucket = Mock(name='default_bucket', return_value=BUCKET_NAME) | ||
session.expand_role = Mock(name="expand_role", return_value=ROLE) | ||
|
@@ -346,6 +351,7 @@ def test_attach(sagemaker_session, mxnet_version): | |
'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
'TrainingJobName': 'neo', | ||
'TrainingJobStatus': 'Completed', | ||
'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
'OutputDataConfig': { | ||
'KmsKeyId': '', | ||
'S3OutputPath': 's3://place/output/neo' | ||
|
@@ -369,6 +375,7 @@ def test_attach(sagemaker_session, mxnet_version): | |
assert estimator.hyperparameters()['training_steps'] == '100' | ||
assert estimator.source_dir == 's3://some/sourcedir.tar.gz' | ||
assert estimator.entry_point == 'iris-dnn-classifier.py' | ||
assert estimator.tags == LIST_TAGS_RESULT['Tags'] | ||
|
||
|
||
def test_attach_old_container(sagemaker_session): | ||
|
@@ -392,6 +399,7 @@ def test_attach_old_container(sagemaker_session): | |
'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
'TrainingJobName': 'neo', | ||
'TrainingJobStatus': 'Completed', | ||
'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
'OutputDataConfig': {'KmsKeyId': '', 'S3OutputPath': 's3://place/output/neo'}, | ||
'TrainingJobOutput': {'S3TrainingJobOutput': 's3://here/output.tar.gz'}} | ||
sagemaker_session.sagemaker_client.describe_training_job = Mock(name='describe_training_job', | ||
|
@@ -434,6 +442,7 @@ def test_attach_wrong_framework(sagemaker_session): | |
'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
'TrainingJobName': 'neo', | ||
'TrainingJobStatus': 'Completed', | ||
'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
'OutputDataConfig': {'KmsKeyId': '', 'S3OutputPath': 's3://place/output/neo'}, | ||
'TrainingJobOutput': {'S3TrainingJobOutput': 's3://here/output.tar.gz'}} | ||
sagemaker_session.sagemaker_client.describe_training_job = Mock(name='describe_training_job', return_value=rjd) | ||
|
@@ -465,6 +474,7 @@ def test_attach_custom_image(sagemaker_session): | |
'StoppingCondition': {'MaxRuntimeInSeconds': 24 * 60 * 60}, | ||
'TrainingJobName': 'neo', | ||
'TrainingJobStatus': 'Completed', | ||
'TrainingJobArn': 'arn:aws:sagemaker:us-west-2:336:training-job/neo', | ||
'OutputDataConfig': {'KmsKeyId': '', 'S3OutputPath': 's3://place/output/neo'}, | ||
'TrainingJobOutput': {'S3TrainingJobOutput': 's3://here/output.tar.gz'}} | ||
sagemaker_session.sagemaker_client.describe_training_job = Mock(name='describe_training_job', | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
the mock call is set up here, but there's no test that shows estimator uses the result of the call. adding an assert for this to
test_attach_framework
would cover this.