Skip to content

feature: add pytorch 1.5.1 eia configuration #2441

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 9 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions src/sagemaker/image_uri_config/pytorch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
"cpu"
],
"version_aliases": {
"1.3": "1.3.1"
"1.3": "1.3.1",
"1.5": "1.5.1"
},
"versions": {
"1.3.1": {
"py_versions": [
"py3"
],
"registries": {
"af-south-1": "626614931356",
"ap-east-1": "871362719292",
"ap-northeast-1": "763104351884",
"ap-northeast-2": "763104351884",
"ap-northeast-3": "364406365360",
Expand All @@ -26,16 +25,22 @@
"eu-central-1": "763104351884",
"eu-north-1": "763104351884",
Copy link
Contributor

Choose a reason for hiding this comment

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

All these regions, apart from ap-northeast-1, ap-northeast-2, eu-west-1, us-east-1, us-east-2, and us-west-2, cannot create EI inference endpoints because EI is unsupported in those regions.

The list of regions for PT 1.5.1 is correct, and the list of regions for PT 1.3.1 needs to be updated to match that.

Reference: https://aws.amazon.com/machine-learning/elastic-inference/pricing/

Copy link
Contributor

@shreyapandit shreyapandit Aug 13, 2021

Choose a reason for hiding this comment

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

Thanks for clarifying! As discussed, this does lead to a change in customer experience whereby if these regions are non existent, we won't be able to construct the image URIs for the customer properly, and it will diverge from the current error thrown in this scenario. Since we aren't supporting EIA in these regions prior to this, I think this is a correct bug fix in that regard; but we should in general think of introducing a framework which checks for feature/region compatibility and alerts users accordingly, which will allow for easier and more seamless deprecation

"eu-west-1": "763104351884",
"eu-west-2": "763104351884",
"eu-west-3": "763104351884",
"eu-south-1": "692866216735",
"me-south-1": "217643126080",
"sa-east-1": "763104351884",
"us-east-1": "763104351884",
"us-east-2": "763104351884",
"us-gov-west-1": "442386744353",
"us-iso-east-1": "886529160074",
"us-west-1": "763104351884",
"us-west-2": "763104351884"
},
"repository": "pytorch-inference-eia"
},
"1.5.1": {
"py_versions": [
"py3"
],
"registries": {
"ap-northeast-1": "763104351884",
"ap-northeast-2": "763104351884",
"eu-west-1": "763104351884",
"us-east-1": "763104351884",
"us-east-2": "763104351884",
"us-west-2": "763104351884"
},
"repository": "pytorch-inference-eia"
Expand Down
12 changes: 10 additions & 2 deletions tests/unit/sagemaker/image_uris/test_dlc_frameworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
"us-gov-west-1": "246785580436",
"us-iso-east-1": "744548109606",
}
ELASTIC_INFERENCE_REGIONS = [
"ap-northeast-1",
"ap-northeast-2",
"eu-west-1",
"us-east-1",
"us-east-2",
"us-west-2",
]


def _test_image_uris(
Expand Down Expand Up @@ -385,13 +393,13 @@ def test_pytorch_eia(pytorch_eia_version, pytorch_eia_py_version):
)
assert expected == uri

for region, account in DLC_ALTERNATE_REGION_ACCOUNTS.items():
for region in ELASTIC_INFERENCE_REGIONS:
uri = image_uris.retrieve(region=region, **base_args)

expected = expected_uris.framework_uri(
"pytorch-inference-eia",
pytorch_eia_version,
account,
DLC_ACCOUNT,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend looking up the account id from the DLC_ACCOUNT and DLC_ALTERNATE_REGION_ACCOUNTS variables, because we never know when opt-in regions or other partitions might receive EI support.

I guess something like account = DLC_ALTERNATE_REGION_ACCOUNTS.get(region, DLC_ACCOUNT) would be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

py_version=pytorch_eia_py_version,
region=region,
)
Expand Down