-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feature: Add image_uris.retrieve() support for AutoGluon #2699
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"training": { | ||
"processors": ["cpu", "gpu"], | ||
"versions": { | ||
"0.3.1": { | ||
"registries": { | ||
"af-south-1": "626614931356", | ||
"ap-east-1": "871362719292", | ||
"ap-northeast-1": "763104351884", | ||
"ap-northeast-2": "763104351884", | ||
"ap-northeast-3": "364406365360", | ||
"ap-south-1": "763104351884", | ||
"ap-southeast-1": "763104351884", | ||
"ap-southeast-2": "763104351884", | ||
"ca-central-1": "763104351884", | ||
"eu-central-1": "763104351884", | ||
"eu-north-1": "763104351884", | ||
"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": "autogluon-training", | ||
"py_versions": ["py37"] | ||
} | ||
} | ||
}, | ||
"inference": { | ||
"processors": ["cpu"], | ||
"versions": { | ||
"0.3.1": { | ||
"registries": { | ||
"af-south-1": "626614931356", | ||
"ap-east-1": "871362719292", | ||
"ap-northeast-1": "763104351884", | ||
"ap-northeast-2": "763104351884", | ||
"ap-northeast-3": "364406365360", | ||
"ap-south-1": "763104351884", | ||
"ap-southeast-1": "763104351884", | ||
"ap-southeast-2": "763104351884", | ||
"ca-central-1": "763104351884", | ||
"cn-north-1": "727897471807", | ||
"cn-northwest-1": "727897471807", | ||
"eu-central-1": "763104351884", | ||
"eu-north-1": "763104351884", | ||
"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": "autogluon-inference", | ||
"py_versions": ["py37"] | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ | |
"xgboost", | ||
"spark", | ||
"huggingface", | ||
"autogluon", | ||
) | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). You | ||
# may not use this file except in compliance with the License. A copy of | ||
# the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0/ | ||
# | ||
# or in the "license" file accompanying this file. This file is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF | ||
# ANY KIND, either express or implied. See the License for the specific | ||
# language governing permissions and limitations under the License. | ||
from __future__ import absolute_import | ||
|
||
import pytest | ||
|
||
from sagemaker import image_uris | ||
from tests.unit.sagemaker.image_uris import expected_uris | ||
|
||
ACCOUNTS = { | ||
"af-south-1": "626614931356", | ||
"ap-east-1": "871362719292", | ||
"ap-northeast-1": "763104351884", | ||
"ap-northeast-2": "763104351884", | ||
"ap-northeast-3": "364406365360", | ||
"ap-south-1": "763104351884", | ||
"ap-southeast-1": "763104351884", | ||
"ap-southeast-2": "763104351884", | ||
"ca-central-1": "763104351884", | ||
"eu-central-1": "763104351884", | ||
"eu-north-1": "763104351884", | ||
"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", | ||
} | ||
VERSIONS = ["0.3.1"] | ||
|
||
|
||
@pytest.mark.parametrize("version", VERSIONS) | ||
def test_valid_uris(version): | ||
Comment on lines
+48
to
+49
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. Why don't you parameterize the 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. I'm following same pattern other tests are doing |
||
for region in ACCOUNTS.keys(): | ||
uri = image_uris.retrieve( | ||
"autogluon", | ||
region=region, | ||
version=version, | ||
py_version="py37", | ||
image_scope="training", | ||
instance_type="ml.c4.xlarge", | ||
) | ||
|
||
expected = expected_uris.framework_uri( | ||
"autogluon-training", | ||
version, | ||
ACCOUNTS[region], | ||
py_version="py37", | ||
region=region, | ||
) | ||
assert uri == expected | ||
|
||
|
||
@pytest.mark.parametrize("version", VERSIONS) | ||
def test_py3_error(version): | ||
with pytest.raises(ValueError) as e: | ||
image_uris.retrieve( | ||
"autogluon", | ||
region="us-west-2", | ||
version=version, | ||
py_version="py3", | ||
image_scope="training", | ||
instance_type="ml.c4.xlarge", | ||
) | ||
|
||
assert "Unsupported Python version: py3." in str(e.value) | ||
|
||
|
||
@pytest.mark.parametrize("version", VERSIONS) | ||
def test_gpu_error(version): | ||
with pytest.raises(ValueError) as e: | ||
image_uris.retrieve( | ||
"autogluon", | ||
region="us-west-2", | ||
version=version, | ||
image_scope="inference", | ||
instance_type="ml.p2.xlarge", | ||
) | ||
|
||
assert "Unsupported processor: gpu." in str(e.value) |
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 to confirm, no gpu for inference?
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.
Correct, only CPU inference container (for now)