Skip to content

Commit 63cd970

Browse files
Merge branch 'master' into master
2 parents c604059 + 0b13d2a commit 63cd970

File tree

8 files changed

+122
-4
lines changed

8 files changed

+122
-4
lines changed

src/sagemaker/dataset_definition/inputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __init__(
198198
the path to a local directory. If not provided, skips data download
199199
by SageMaker platform.
200200
s3_data_type (str, default="S3Prefix"): Valid options are "ManifestFile" or "S3Prefix".
201-
s3_input_mode (str, default="File"): Valid options are "Pipe" or "File".
201+
s3_input_mode (str, default="File"): Valid options are "Pipe", "File" or "FastFile".
202202
s3_data_distribution_type (str, default="FullyReplicated"):
203203
Valid options are "FullyReplicated" or "ShardedByS3Key".
204204
s3_compression_type (str, default=None): Valid options are "None" or "Gzip".

src/sagemaker/image_uri_config/huggingface-llm.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,48 @@
218218
"tag_prefix": "2.0.1-tgi1.1.0",
219219
"repository": "huggingface-pytorch-tgi-inference",
220220
"container_version": {"gpu": "cu118-ubuntu20.04"}
221+
},
222+
"1.2.0": {
223+
"py_versions": ["py310"],
224+
"registries": {
225+
"af-south-1": "626614931356",
226+
"il-central-1": "780543022126",
227+
"ap-east-1": "871362719292",
228+
"ap-northeast-1": "763104351884",
229+
"ap-northeast-2": "763104351884",
230+
"ap-northeast-3": "364406365360",
231+
"ap-south-1": "763104351884",
232+
"ap-south-2": "772153158452",
233+
"ap-southeast-1": "763104351884",
234+
"ap-southeast-2": "763104351884",
235+
"ap-southeast-3": "907027046896",
236+
"ap-southeast-4": "457447274322",
237+
"ca-central-1": "763104351884",
238+
"cn-north-1": "727897471807",
239+
"cn-northwest-1": "727897471807",
240+
"eu-central-1": "763104351884",
241+
"eu-central-2": "380420809688",
242+
"eu-north-1": "763104351884",
243+
"eu-west-1": "763104351884",
244+
"eu-west-2": "763104351884",
245+
"eu-west-3": "763104351884",
246+
"eu-south-1": "692866216735",
247+
"eu-south-2": "503227376785",
248+
"me-south-1": "217643126080",
249+
"me-central-1": "914824155844",
250+
"sa-east-1": "763104351884",
251+
"us-east-1": "763104351884",
252+
"us-east-2": "763104351884",
253+
"us-gov-east-1": "446045086412",
254+
"us-gov-west-1": "442386744353",
255+
"us-iso-east-1": "886529160074",
256+
"us-isob-east-1": "094389454867",
257+
"us-west-1": "763104351884",
258+
"us-west-2": "763104351884"
259+
},
260+
"tag_prefix": "2.1.1-tgi1.2.0",
261+
"repository": "huggingface-pytorch-tgi-inference",
262+
"container_version": {"gpu": "cu121-ubuntu20.04"}
221263
}
222264
}
223265
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"processing": {
3+
"versions": {
4+
"1.x": {
5+
"registries": {
6+
"us-west-2": "081189585635"
7+
},
8+
"repository": "sagemaker-geospatial-v1-0",
9+
"tag_prefix": "latest"
10+
}
11+
}
12+
}
13+
}

src/sagemaker/model_monitor/model_monitoring.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3933,7 +3933,8 @@ def __init__(
39333933
Args:
39343934
endpoint_name (str): The name of the endpoint.
39353935
destination (str): The destination of the input.
3936-
s3_input_mode (str): The S3 input mode. Can be one of: "File", "Pipe. Default: "File".
3936+
s3_input_mode (str): The S3 input mode. Can be one of: "File", "Pipe" or "FastFile".
3937+
Default: "File".
39373938
s3_data_distribution_type (str): The S3 Data Distribution Type. Can be one of:
39383939
"FullyReplicated", "ShardedByS3Key"
39393940
start_time_offset (str): Monitoring start time offset, e.g. "-PT1H"
@@ -4043,7 +4044,8 @@ def __init__(
40434044
data_captured_destination_s3_uri (str): Location to the batch transform captured data
40444045
file which needs to be analysed.
40454046
destination (str): The destination of the input.
4046-
s3_input_mode (str): The S3 input mode. Can be one of: "File", "Pipe. (default: File)
4047+
s3_input_mode (str): The S3 input mode. Can be one of: "File", "Pipe" or
4048+
"FastFile". (default: File)
40474049
s3_data_distribution_type (str): The S3 Data Distribution Type. Can be one of:
40484050
"FullyReplicated", "ShardedByS3Key" (default: FullyReplicated)
40494051
start_time_offset (str): Monitoring start time offset, e.g. "-PT1H" (default: None)

src/sagemaker/processing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ def __init__(
12421242
input_name (str or PipelineVariable): The name for the input. If a name
12431243
is not provided, one will be generated (eg. "input-1").
12441244
s3_data_type (str or PipelineVariable): Valid options are "ManifestFile" or "S3Prefix".
1245-
s3_input_mode (str or PipelineVariable): Valid options are "Pipe" or "File".
1245+
s3_input_mode (str or PipelineVariable): Valid options are "Pipe", "File" or "FastFile".
12461246
s3_data_distribution_type (str or PipelineVariable): Valid options are "FullyReplicated"
12471247
or "ShardedByS3Key".
12481248
s3_compression_type (str or PipelineVariable): Valid options are "None" or "Gzip".

tests/unit/sagemaker/image_uris/expected_uris.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def monitor_uri(account, region=REGION):
5959
return MONITOR_URI_FORMAT.format(account, region, domain)
6060

6161

62+
def algo_uri_with_tag(algo, account, region, tag):
63+
domain = ALTERNATE_DOMAINS.get(region, DOMAIN)
64+
return IMAGE_URI_FORMAT.format(account, region, domain, algo, tag)
65+
66+
6267
def graviton_framework_uri(
6368
repo,
6469
fw_version,

tests/unit/sagemaker/image_uris/test_huggingface_llm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"0.9.3": "2.0.1-tgi0.9.3-gpu-py39-cu118-ubuntu20.04",
2525
"1.0.3": "2.0.1-tgi1.0.3-gpu-py39-cu118-ubuntu20.04",
2626
"1.1.0": "2.0.1-tgi1.1.0-gpu-py39-cu118-ubuntu20.04",
27+
"1.2.0": "2.1.1-tgi1.2.0-gpu-py310-cu121-ubuntu20.04",
2728
}
2829

2930

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
from __future__ import absolute_import
14+
15+
import pytest
16+
from sagemaker import image_uris
17+
from tests.unit.sagemaker.image_uris import expected_uris
18+
19+
20+
def _test_ecr_uri(account, region, version, tag):
21+
actual_uri = image_uris.retrieve("sagemaker-geospatial", region=region, version=version)
22+
expected_uri = expected_uris.algo_uri_with_tag(
23+
"sagemaker-geospatial-v1-0",
24+
account,
25+
region,
26+
tag=tag,
27+
)
28+
return expected_uri == actual_uri
29+
30+
31+
@pytest.mark.parametrize("load_config", ["sagemaker-geospatial.json"], indirect=True)
32+
@pytest.mark.parametrize("extract_versions_for_image_scope", ["processing"], indirect=True)
33+
def test_sagemaker_geospatial_ecr_uri(load_config, extract_versions_for_image_scope):
34+
VERSIONS = extract_versions_for_image_scope
35+
for version in VERSIONS:
36+
SAGEMAKER_GEOSPATIAL_ACCOUNTS = load_config["processing"]["versions"][version]["registries"]
37+
for region in SAGEMAKER_GEOSPATIAL_ACCOUNTS.keys():
38+
39+
assert _test_ecr_uri(
40+
account=SAGEMAKER_GEOSPATIAL_ACCOUNTS[region],
41+
region=region,
42+
version=version,
43+
tag="latest",
44+
)
45+
46+
47+
@pytest.mark.parametrize("load_config", ["sagemaker-geospatial.json"], indirect=True)
48+
def test_sagemaker_geospatial_ecr_uri_no_version(load_config):
49+
region = "us-west-2"
50+
SAGEMAKER_GEOSPATIAL_ACCOUNTS = load_config["processing"]["versions"]["1.x"]["registries"]
51+
actual_uri = image_uris.retrieve("sagemaker-geospatial", region=region)
52+
expected_uri = expected_uris.algo_uri_with_tag(
53+
"sagemaker-geospatial-v1-0", SAGEMAKER_GEOSPATIAL_ACCOUNTS[region], region, tag="latest"
54+
)
55+
assert expected_uri == actual_uri

0 commit comments

Comments
 (0)