Skip to content

Commit ffcfcc0

Browse files
authored
Merge branch 'master' into master
2 parents 8f60d20 + 4039935 commit ffcfcc0

File tree

12 files changed

+425
-15
lines changed

12 files changed

+425
-15
lines changed

.githooks/pre-push

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
# this pre-push hook runs style checks and unit tests in python 3.6, 3.7, and 3.8 using tox.
3+
4+
set -e
5+
6+
TOX_PARALLEL_NO_SPINNER=1,
7+
PY_COLORS=0
8+
start_time=`date +%s`
9+
tox -e flake8,pylint,docstyle,black-check,twine --parallel all
10+
./ci-scripts/displaytime.sh 'flake8,pylint,docstyle,black-check,twine' $start_time
11+
start_time=`date +%s`
12+
tox -e sphinx,doc8 --parallel all
13+
./ci-scripts/displaytime.sh 'sphinx,doc8' $start_time
14+
start_time=`date +%s`
15+
tox -e py36,py37,py38 --parallel all -- tests/unit
16+
./ci-scripts/displaytime.sh 'py36,py37,py38 unit' $start_time

README.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ You can also run them in parallel:
154154
tox -- -n auto tests/integ
155155

156156

157+
Git Hooks
158+
~~~~~~~~~
159+
160+
to enable all git hooks in the .githooks directory, run these commands in the repository directory:
161+
162+
::
163+
164+
find .git/hooks -type l -exec rm {} \;
165+
find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;
166+
167+
To enable an individual git hook, simply move it from the .githooks/ directory to the .git/hooks/ directory.
168+
157169
Building Sphinx docs
158170
~~~~~~~~~~~~~~~~~~~~
159171

src/sagemaker/deprecations.py

Lines changed: 62 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 163 additions & 2 deletions
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 6 additions & 0 deletions
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)