Skip to content

Commit 6df2889

Browse files
authored
Merge branch 'master' into retry-assoc-tests
2 parents e86e388 + 1f80314 commit 6df2889

14 files changed

+474
-18
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## v2.64.0 (2021-10-20)
4+
5+
### Deprecations and Removals
6+
7+
* warn for deprecation - Lambda model-predictor
8+
9+
### Features
10+
11+
* Add support for TF 2.5
12+
* Add a pre-push git hook
13+
14+
### Bug Fixes and Other Changes
15+
16+
* add s3_analysis_config_output_path field in DataConfig constructor
17+
* make marketplace jobnames random
18+
319
## v2.63.2 (2021-10-18)
420

521
### Bug Fixes and Other Changes

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.63.3.dev0
1+
2.64.1.dev0

src/sagemaker/clarify.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def __init__(
3131
self,
3232
s3_data_input_path,
3333
s3_output_path,
34+
s3_analysis_config_output_path=None,
3435
label=None,
3536
headers=None,
3637
features=None,
@@ -43,6 +44,9 @@ def __init__(
4344
Args:
4445
s3_data_input_path (str): Dataset S3 prefix/object URI.
4546
s3_output_path (str): S3 prefix to store the output.
47+
s3_analysis_config_output_path (str): S3 prefix to store the analysis_config output
48+
If this field is None, then the s3_output_path will be used
49+
to store the analysis_config output
4650
label (str): Target attribute of the model required by bias metrics (optional for SHAP)
4751
Specified as column name or index for CSV dataset, or as JSONPath for JSONLines.
4852
headers (list[str]): A list of column names in the input dataset.
@@ -61,6 +65,7 @@ def __init__(
6165
)
6266
self.s3_data_input_path = s3_data_input_path
6367
self.s3_output_path = s3_output_path
68+
self.s3_analysis_config_output_path = s3_analysis_config_output_path
6469
self.s3_data_distribution_type = s3_data_distribution_type
6570
self.s3_compression_type = s3_compression_type
6671
self.label = label
@@ -473,7 +478,7 @@ def _run(
473478
json.dump(analysis_config, f)
474479
s3_analysis_config_file = _upload_analysis_config(
475480
analysis_config_file,
476-
data_config.s3_output_path,
481+
data_config.s3_analysis_config_output_path or data_config.s3_output_path,
477482
self.sagemaker_session,
478483
kms_key,
479484
)

src/sagemaker/deprecations.py

+62
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,46 @@ def renamed_warning(phrase):
5050
_warn(f"{phrase} has been renamed")
5151

5252

53+
def deprecation_warn(name, date, msg=None):
54+
"""Raise a warning for soon to be deprecated feature in sagemaker>=2
55+
56+
Args:
57+
name (str): Name of the feature
58+
date (str): the date when the feature will be deprecated
59+
msg (str): the prefix phrase of the warning message.
60+
"""
61+
_warn(f"{name} will be deprecated on {date}.{msg}")
62+
63+
64+
def deprecation_warning(date, msg=None):
65+
"""Decorator for raising deprecation warning for a feature in sagemaker>=2
66+
67+
Args:
68+
date (str): the date when the feature will be deprecated
69+
msg (str): the prefix phrase of the warning message.
70+
71+
Usage:
72+
@deprecation_warning(msg="message", date="date")
73+
def sample_function():
74+
print("xxxx....")
75+
76+
@deprecation_warning(msg="message", date="date")
77+
class SampleClass():
78+
def __init__(self):
79+
print("xxxx....")
80+
81+
"""
82+
83+
def deprecate(obj):
84+
def wrapper(*args, **kwargs):
85+
deprecation_warn(obj.__name__, date, msg)
86+
return obj(*args, **kwargs)
87+
88+
return wrapper
89+
90+
return deprecate
91+
92+
5393
def renamed_kwargs(old_name, new_name, value, kwargs):
5494
"""Checks if the deprecated argument is in kwargs
5595
@@ -106,6 +146,28 @@ def func(*args, **kwargs): # pylint: disable=W0613
106146
return func
107147

108148

149+
def deprecated(obj):
150+
"""Decorator for raising deprecated warning for a feature in sagemaker>=2
151+
152+
Usage:
153+
@deprecated
154+
def sample_function():
155+
print("xxxx....")
156+
157+
@deprecated
158+
class SampleClass():
159+
def __init__(self):
160+
print("xxxx....")
161+
162+
"""
163+
164+
def wrapper(*args, **kwargs):
165+
removed_warning(obj.__name__)
166+
return obj(*args, **kwargs)
167+
168+
return wrapper
169+
170+
109171
def deprecated_function(func, name):
110172
"""Wrap a function with a deprecation warning.
111173

src/sagemaker/fw_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"local_gpu",
6060
)
6161
SM_DATAPARALLEL_SUPPORTED_FRAMEWORK_VERSIONS = {
62-
"tensorflow": ["2.3", "2.3.1", "2.3.2", "2.4", "2.4.1"],
62+
"tensorflow": ["2.3", "2.3.1", "2.3.2", "2.4", "2.4.1", "2.4.3", "2.5", "2.5.0", "2.5.1"],
6363
"pytorch": ["1.6", "1.6.0", "1.7", "1.7.1", "1.8", "1.8.0", "1.8.1", "1.9", "1.9.0"],
6464
}
6565
SMDISTRIBUTED_SUPPORTED_STRATEGIES = ["dataparallel", "modelparallel"]
@@ -533,7 +533,7 @@ def _validate_smdataparallel_args(
533533
if "py3" not in py_version:
534534
err_msg += (
535535
f"Provided py_version {py_version} is not supported by smdataparallel.\n"
536-
"Please specify py_version=py3"
536+
"Please specify py_version>=py3"
537537
)
538538

539539
if err_msg:

src/sagemaker/image_uri_config/tensorflow.json

+163-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@
277277
"2.1": "2.1.3",
278278
"2.2": "2.2.2",
279279
"2.3": "2.3.2",
280-
"2.4": "2.4.1"
280+
"2.4": "2.4.3",
281+
"2.5": "2.5.1"
281282
},
282283
"versions": {
283284
"1.10.0": {
@@ -1251,6 +1252,66 @@
12511252
"us-west-2": "763104351884"
12521253
},
12531254
"repository": "tensorflow-inference"
1255+
},
1256+
"2.4.3": {
1257+
"registries": {
1258+
"af-south-1": "626614931356",
1259+
"ap-east-1": "871362719292",
1260+
"ap-northeast-1": "763104351884",
1261+
"ap-northeast-2": "763104351884",
1262+
"ap-northeast-3": "364406365360",
1263+
"ap-south-1": "763104351884",
1264+
"ap-southeast-1": "763104351884",
1265+
"ap-southeast-2": "763104351884",
1266+
"ca-central-1": "763104351884",
1267+
"cn-north-1": "727897471807",
1268+
"cn-northwest-1": "727897471807",
1269+
"eu-central-1": "763104351884",
1270+
"eu-north-1": "763104351884",
1271+
"eu-south-1": "692866216735",
1272+
"eu-west-1": "763104351884",
1273+
"eu-west-2": "763104351884",
1274+
"eu-west-3": "763104351884",
1275+
"me-south-1": "217643126080",
1276+
"sa-east-1": "763104351884",
1277+
"us-east-1": "763104351884",
1278+
"us-east-2": "763104351884",
1279+
"us-gov-west-1": "442386744353",
1280+
"us-iso-east-1": "886529160074",
1281+
"us-west-1": "763104351884",
1282+
"us-west-2": "763104351884"
1283+
},
1284+
"repository": "tensorflow-inference"
1285+
},
1286+
"2.5.1": {
1287+
"registries": {
1288+
"af-south-1": "626614931356",
1289+
"ap-east-1": "871362719292",
1290+
"ap-northeast-1": "763104351884",
1291+
"ap-northeast-2": "763104351884",
1292+
"ap-northeast-3": "364406365360",
1293+
"ap-south-1": "763104351884",
1294+
"ap-southeast-1": "763104351884",
1295+
"ap-southeast-2": "763104351884",
1296+
"ca-central-1": "763104351884",
1297+
"cn-north-1": "727897471807",
1298+
"cn-northwest-1": "727897471807",
1299+
"eu-central-1": "763104351884",
1300+
"eu-north-1": "763104351884",
1301+
"eu-south-1": "692866216735",
1302+
"eu-west-1": "763104351884",
1303+
"eu-west-2": "763104351884",
1304+
"eu-west-3": "763104351884",
1305+
"me-south-1": "217643126080",
1306+
"sa-east-1": "763104351884",
1307+
"us-east-1": "763104351884",
1308+
"us-east-2": "763104351884",
1309+
"us-gov-west-1": "442386744353",
1310+
"us-iso-east-1": "886529160074",
1311+
"us-west-1": "763104351884",
1312+
"us-west-2": "763104351884"
1313+
},
1314+
"repository": "tensorflow-inference"
12541315
}
12551316
}
12561317
},
@@ -1276,7 +1337,8 @@
12761337
"2.1": "2.1.3",
12771338
"2.2": "2.2.2",
12781339
"2.3": "2.3.2",
1279-
"2.4": "2.4.1"
1340+
"2.4": "2.4.3",
1341+
"2.5": "2.5.1"
12801342
},
12811343
"versions": {
12821344
"1.10.0": {
@@ -2370,6 +2432,105 @@
23702432
"us-west-2": "763104351884"
23712433
},
23722434
"repository": "tensorflow-training"
2435+
},
2436+
"2.4.3": {
2437+
"py_versions": [
2438+
"py37"
2439+
],
2440+
"registries": {
2441+
"af-south-1": "626614931356",
2442+
"ap-east-1": "871362719292",
2443+
"ap-northeast-1": "763104351884",
2444+
"ap-northeast-2": "763104351884",
2445+
"ap-northeast-3": "364406365360",
2446+
"ap-south-1": "763104351884",
2447+
"ap-southeast-1": "763104351884",
2448+
"ap-southeast-2": "763104351884",
2449+
"ca-central-1": "763104351884",
2450+
"cn-north-1": "727897471807",
2451+
"cn-northwest-1": "727897471807",
2452+
"eu-central-1": "763104351884",
2453+
"eu-north-1": "763104351884",
2454+
"eu-south-1": "692866216735",
2455+
"eu-west-1": "763104351884",
2456+
"eu-west-2": "763104351884",
2457+
"eu-west-3": "763104351884",
2458+
"me-south-1": "217643126080",
2459+
"sa-east-1": "763104351884",
2460+
"us-east-1": "763104351884",
2461+
"us-east-2": "763104351884",
2462+
"us-gov-west-1": "442386744353",
2463+
"us-iso-east-1": "886529160074",
2464+
"us-west-1": "763104351884",
2465+
"us-west-2": "763104351884"
2466+
},
2467+
"repository": "tensorflow-training"
2468+
},
2469+
"2.5.0": {
2470+
"py_versions": [
2471+
"py37"
2472+
],
2473+
"registries": {
2474+
"af-south-1": "626614931356",
2475+
"ap-east-1": "871362719292",
2476+
"ap-northeast-1": "763104351884",
2477+
"ap-northeast-2": "763104351884",
2478+
"ap-northeast-3": "364406365360",
2479+
"ap-south-1": "763104351884",
2480+
"ap-southeast-1": "763104351884",
2481+
"ap-southeast-2": "763104351884",
2482+
"ca-central-1": "763104351884",
2483+
"cn-north-1": "727897471807",
2484+
"cn-northwest-1": "727897471807",
2485+
"eu-central-1": "763104351884",
2486+
"eu-north-1": "763104351884",
2487+
"eu-south-1": "692866216735",
2488+
"eu-west-1": "763104351884",
2489+
"eu-west-2": "763104351884",
2490+
"eu-west-3": "763104351884",
2491+
"me-south-1": "217643126080",
2492+
"sa-east-1": "763104351884",
2493+
"us-east-1": "763104351884",
2494+
"us-east-2": "763104351884",
2495+
"us-gov-west-1": "442386744353",
2496+
"us-iso-east-1": "886529160074",
2497+
"us-west-1": "763104351884",
2498+
"us-west-2": "763104351884"
2499+
},
2500+
"repository": "tensorflow-training"
2501+
},
2502+
"2.5.1": {
2503+
"py_versions": [
2504+
"py37"
2505+
],
2506+
"registries": {
2507+
"af-south-1": "626614931356",
2508+
"ap-east-1": "871362719292",
2509+
"ap-northeast-1": "763104351884",
2510+
"ap-northeast-2": "763104351884",
2511+
"ap-northeast-3": "364406365360",
2512+
"ap-south-1": "763104351884",
2513+
"ap-southeast-1": "763104351884",
2514+
"ap-southeast-2": "763104351884",
2515+
"ca-central-1": "763104351884",
2516+
"cn-north-1": "727897471807",
2517+
"cn-northwest-1": "727897471807",
2518+
"eu-central-1": "763104351884",
2519+
"eu-north-1": "763104351884",
2520+
"eu-south-1": "692866216735",
2521+
"eu-west-1": "763104351884",
2522+
"eu-west-2": "763104351884",
2523+
"eu-west-3": "763104351884",
2524+
"me-south-1": "217643126080",
2525+
"sa-east-1": "763104351884",
2526+
"us-east-1": "763104351884",
2527+
"us-east-2": "763104351884",
2528+
"us-gov-west-1": "442386744353",
2529+
"us-iso-east-1": "886529160074",
2530+
"us-west-1": "763104351884",
2531+
"us-west-2": "763104351884"
2532+
},
2533+
"repository": "tensorflow-training"
23732534
}
23742535
}
23752536
}

src/sagemaker/serverless/model.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@
2020
import botocore
2121

2222
from sagemaker.model import ModelBase
23-
23+
from sagemaker.deprecations import deprecation_warning
2424
from .predictor import LambdaPredictor
2525

2626

27+
@deprecation_warning(
28+
msg="Based on customer experience and feedback an"
29+
" alternative support will be added in near future",
30+
date="10/27/2021",
31+
)
2732
class LambdaModel(ModelBase):
2833
"""A model that can be deployed to Lambda."""
2934

src/sagemaker/serverless/predictor.py

+6
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@
2020

2121
from sagemaker import deserializers, serializers
2222
from sagemaker.predictor import PredictorBase
23+
from sagemaker.deprecations import deprecation_warning
2324

2425

26+
@deprecation_warning(
27+
msg="Based on customer experience and feedback an"
28+
" alternative support will be added in near future",
29+
date="10/27/2021",
30+
)
2531
class LambdaPredictor(PredictorBase):
2632
"""A deployed model hosted on Lambda."""
2733

0 commit comments

Comments
 (0)