Skip to content

change: use recommended inference image URI from Neo API #2806

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

Closed
wants to merge 42 commits into from

Conversation

HappyAmazonian
Copy link
Contributor

@HappyAmazonian HappyAmazonian commented Dec 20, 2021

Issue #, if available:

Description of changes:

Testing done:
unit tests passed

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

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backword compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used 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.

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2021

Codecov Report

Merging #2806 (13aa858) into dev (c2b5f95) will increase coverage by 0.21%.
The diff coverage is 95.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2806      +/-   ##
==========================================
+ Coverage   88.71%   88.93%   +0.21%     
==========================================
  Files         175      178       +3     
  Lines       15500    15755     +255     
==========================================
+ Hits        13751    14011     +260     
+ Misses       1749     1744       -5     
Impacted Files Coverage Δ
src/sagemaker/image_uris.py 99.32% <ø> (ø)
src/sagemaker/tensorflow/model.py 89.13% <ø> (ø)
src/sagemaker/workflow/execution_variables.py 100.00% <ø> (ø)
src/sagemaker/lineage/action.py 85.91% <58.33%> (-14.09%) ⬇️
src/sagemaker/tuner.py 97.91% <83.33%> (-0.22%) ⬇️
src/sagemaker/lineage/context.py 81.98% <94.73%> (+6.63%) ⬆️
src/sagemaker/workflow/properties.py 88.15% <94.73%> (+0.83%) ⬆️
src/sagemaker/lineage/query.py 94.96% <97.61%> (+14.80%) ⬆️
src/sagemaker/clarify.py 92.91% <100.00%> (+0.51%) ⬆️
src/sagemaker/estimator.py 91.18% <100.00%> (+0.58%) ⬆️
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2b5f95...13aa858. Read the comment docs.

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 08c3a7b
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@HappyAmazonian
Copy link
Contributor Author

Hi, is it possible to check the log for those failed tests?

Copy link
Contributor

@shreyapandit shreyapandit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment to be discussed

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 1d5a5dc
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@@ -286,7 +282,7 @@ def test_compile_with_framework_version_15(session):
job_name="compile-model",
)

assert "1.5" in model.image_uri
assert model.image_uri is not None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any specific reason we are not checking "1.5" here in image uri

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the uri is fetched from Neo API now, I think it would be suffice to just check that
model.image_uri is equal to the uri inside the response.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still check for 1.5 to make sure the uri we are receiving is as expected

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is possible. Checking 1.5 requires API access within the unit tests. I changed it to make sure the model.image_uri is the same as what is inside the response.

)

assert "Unsupported neo-pytorch version: 1.6.1." in str(e)
assert model.image_uri is not None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Comment on lines -310 to -326
@patch("sagemaker.session.Session")
def test_compile_validates_framework_version(session):
session.return_value.boto_region_name = REGION

model = _create_model()
with pytest.raises(ValueError) as e:
model.compile(
target_instance_family="ml_c4",
input_shape={"data": [1, 3, 1024, 1024]},
output_path="s3://output",
role="role",
framework="pytorch",
framework_version="1.6.1",
job_name="compile-model",
)

assert "Unsupported neo-pytorch version: 1.6.1." in str(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any specific reason we are removing negative test case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the previous reply.
Since the uri is fetched from Neo API now, the API response will put inference uri as None if there is not a proper inference image.

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: d28b89f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala mufaddal-rohawala changed the base branch from master to dev December 30, 2021 00:34
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: cec05a5
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: cec05a5
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

mchoi8739 and others added 3 commits December 30, 2021 07:30
* update smdmp change log, archive api doc for 1.4.0 and 1.5.0

* add no-index flags

* finish api doc archive

* fix: Set ProcessingStep upload locations deterministically to avoid c… (aws#2790)

* fix: Prevent repack_model script from referencing nonexistent directories (aws#2755)

Co-authored-by: Payton Staub <[email protected]>
Co-authored-by: Ahsan Khan <[email protected]>

* fix: S3Input - add support for instance attributes (aws#2754)

* fix: typos and broken link (aws#2765)

Co-authored-by: Shreya Pandit <[email protected]>

* add all api docs

* add appendix, fix links

* structural changes, fix links

* incorporate feedback

* prepare release v2.72.1

* update development version to v2.72.2.dev0

Co-authored-by: Payton Staub <[email protected]>
Co-authored-by: Payton Staub <[email protected]>
Co-authored-by: Ahsan Khan <[email protected]>
Co-authored-by: Mufaddal Rohawala <[email protected]>
Co-authored-by: Mohamed Ali Jamaoui <[email protected]>
Co-authored-by: Shreya Pandit <[email protected]>
Co-authored-by: ci <ci>
Co-authored-by: Jeniya Tabassum <[email protected]>
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: f728e11
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 431e853
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 431e853
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-notebook-tests
  • Commit ID: 431e853
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

framework,
framework_version,
)
self.image_uri = job_status.get("InferenceImage", None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the impact if this is None? Would that prevent creation of model? Can we have a default instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the impact if this is None?
It would be None only if there is no recommended inference image. In that case, all other functions depending on this value ought to fail naturally since it is not valid.

Would that prevent creation of model?
No. In model.compile function, it simply launches a compilation job.

Can we have a default instead?
From now on, we want user to use the image_uri provided by Neo service. Even if we decide to have a default image-uri later, we will make that change through our API response.

yzhu0 and others added 4 commits January 19, 2022 13:08
Currently the Clarify BiasConfig only accepts facet name. Actually
Clarify analysis configuration supports both name and index. This
commit adds the same support to BiasConfig.
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 13aa858
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 13aa858
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 13aa858
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@HappyAmazonian
Copy link
Contributor Author

HappyAmazonian commented Feb 9, 2022

Since the history and the diff are getting messier overtime, I create a new PR if that helps.

@HappyAmazonian
Copy link
Contributor Author

Since the history and the diff are getting messier overtime, I create a new #2923 if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.