Skip to content

Commit 053a54e

Browse files
authored
Merge branch 'master' into fix/fw-processor-normargs
2 parents 2fbe24b + ead0351 commit 053a54e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2528
-135
lines changed

.githooks/pre-push

+16
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

.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: File a report to help us reproduce and fix the problem
44
title: ''
5-
labels: ''
5+
labels: 'bug'
66
assignees: ''
77

88
---

.github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest new functionality for this library
44
title: ''
5-
labels: ''
5+
labels: 'feature request'
66
assignees: ''
77

88
---

CHANGELOG.md

+80
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,85 @@
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+
19+
## v2.63.2 (2021-10-18)
20+
21+
### Bug Fixes and Other Changes
22+
23+
* Update timeouts for integ tests from 20 to 40
24+
25+
## v2.63.1 (2021-10-14)
26+
27+
### Bug Fixes and Other Changes
28+
29+
* HF estimator attach modified to work with py38
30+
31+
## v2.63.0 (2021-10-13)
32+
33+
### Features
34+
35+
* support configurable retry for pipeline steps
36+
37+
## v2.62.0 (2021-10-12)
38+
39+
### Features
40+
41+
* Hugging Face Transformers 4.10 for Pt1.8/TF2.4 & Transformers 4.11 for PT1.9&TF2.5
42+
43+
### Bug Fixes and Other Changes
44+
45+
* repack_model script used in pipelines to support source_dir and dependencies
46+
47+
## v2.61.0 (2021-10-11)
48+
49+
### Features
50+
51+
* add support for PyTorch 1.9.0
52+
53+
### Bug Fixes and Other Changes
54+
55+
* Update TRAINING_DEFAULT_TIMEOUT_MINUTES to 40 min
56+
* notebook test for parallel PRs
57+
58+
## v2.60.0 (2021-10-08)
59+
60+
### Features
61+
62+
* Add support for Hugging Face 4.10.2
63+
64+
## v2.59.8 (2021-10-07)
65+
66+
### Bug Fixes and Other Changes
67+
68+
* fix feature store ingestion via data wrangler test
69+
70+
## v2.59.7 (2021-10-04)
71+
72+
### Bug Fixes and Other Changes
73+
74+
* update feature request label
75+
* update bug template
76+
77+
## v2.59.6 (2021-09-30)
78+
79+
### Bug Fixes and Other Changes
80+
81+
* ParamValidationError when scheduling a Clarify model monitor
82+
383
## v2.59.5 (2021-09-29)
484

585
### Bug Fixes and Other Changes

README.rst

+12
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

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.59.6.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

+5-5
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
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"],
63-
"pytorch": ["1.6", "1.6.0", "1.7", "1.7.1", "1.8", "1.8.0", "1.8.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"],
63+
"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"]
6666

@@ -298,7 +298,7 @@ def framework_name_from_image(image_uri):
298298
(tensorflow|mxnet|chainer|pytorch|scikit-learn|xgboost
299299
|huggingface-tensorflow|huggingface-pytorch)(?:-)?
300300
(scriptmode|training)?
301-
:(.*)-(.*?)-(py2|py3[67]?)(?:.*)$""",
301+
:(.*)-(.*?)-(py2|py3\d*)(?:.*)$""",
302302
re.VERBOSE,
303303
)
304304
name_match = name_pattern.match(sagemaker_match.group(9))
@@ -329,7 +329,7 @@ def framework_version_from_tag(image_tag):
329329
Returns:
330330
str: The framework version.
331331
"""
332-
tag_pattern = re.compile("^(.*)-(cpu|gpu)-(py2|py3[67]?)$")
332+
tag_pattern = re.compile(r"^(.*)-(cpu|gpu)-(py2|py3\d*)$")
333333
tag_match = tag_pattern.match(image_tag)
334334
return None if tag_match is None else tag_match.group(1)
335335

@@ -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/huggingface/estimator.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ def __init__(
178178
if "enable_sagemaker_metrics" not in kwargs:
179179
kwargs["enable_sagemaker_metrics"] = True
180180

181+
kwargs["py_version"] = self.py_version
182+
181183
super(HuggingFace, self).__init__(
182184
entry_point, source_dir, hyperparameters, image_uri=image_uri, **kwargs
183185
)
@@ -310,7 +312,7 @@ def _prepare_init_params_from_job_description(cls, job_details, model_channel_na
310312
framework_version = None
311313
else:
312314
framework, pt_or_tf = framework.split("-")
313-
tag_pattern = re.compile("^(.*)-transformers(.*)-(cpu|gpu)-(py2|py3[67]?)$")
315+
tag_pattern = re.compile(r"^(.*)-transformers(.*)-(cpu|gpu)-(py2|py3\d*)$")
314316
tag_match = tag_pattern.match(tag)
315317
pt_or_tf_version = tag_match.group(1)
316318
framework_version = tag_match.group(2)

src/sagemaker/image_uri_config/clarify.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"us-east-1": "205585389593",
2626
"us-east-2": "211330385671",
2727
"us-west-1": "740489534195",
28-
"us-west-2": "306415355426"
28+
"us-west-2": "306415355426",
29+
"us-gov-west-1": "598674086554"
2930
},
3031
"repository": "sagemaker-clarify-processing"
3132
}

0 commit comments

Comments
 (0)