Skip to content

Commit b3a72fd

Browse files
evakravibeniericjinyoung-limshinglyuShing Lyu
authored
change: bump jinja2 to 3.1.3 in doc/requirments.txt (#4421) (#4423)
* change: bump jinja2 to 3.1.3 in doc/requirments.txt (#4421) * change: bump jinja2 to 3.1.3 in doc/requirments.txt * Update requirements.txt * feature: TGI 1.4.0 (#4424) * documentation: fix the ClarifyCheckStep documentation to mention PDP (#4259) * documentation: fix the ClarifyCheckStep documentation to mention PDP support * fix: break the lines to meet pylint requirement --------- Co-authored-by: Shing Lyu <[email protected]> * documentation: Explain the ClarifyCheckStep and QualityCheckStep parameters (#4261) * documentation: explain the ClarifyCheckStep and QualityCheckStep parameters * fix: remove trailing space --------- Co-authored-by: Shing Lyu <[email protected]> * feat: Telemetry metrics (#4414) * Emit additional telemetry metrics * Fix unit tests * Emit endpoint failure to telemetry * Address PR Comments * Emit latency in telemetry * Address PR Comments * Addressed PR Comments * Address PR Comments * Fix tests * Fix integ tests --------- Co-authored-by: Jonathan Makunga <[email protected]> Co-authored-by: Erick Benitez-Ramos <[email protected]> * documentation: change order of pipelines topics (#4427) * prepare release v2.208.0 * update development version to v2.208.1.dev0 * feature: AutoGluon 1.0.0 image_uris update (#4426) --------- Co-authored-by: Erick Benitez-Ramos <[email protected]> Co-authored-by: Jinyoung Lim <[email protected]> Co-authored-by: Shing Lyu <[email protected]> Co-authored-by: Shing Lyu <[email protected]> Co-authored-by: Jonathan Makunga <[email protected]> Co-authored-by: Jonathan Makunga <[email protected]> Co-authored-by: stacicho <[email protected]> Co-authored-by: ci <ci> Co-authored-by: tonyhu <[email protected]>
1 parent bf698e7 commit b3a72fd

File tree

13 files changed

+229
-13
lines changed

13 files changed

+229
-13
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ env/
3434
**/_repack_script_launcher.sh
3535
tests/data/**/_repack_model.py
3636
tests/data/experiment/sagemaker-dev-1.0.tar.gz
37-
src/sagemaker/serve/tmp_workspace
37+
src/sagemaker/serve/tmp_workspace

CHANGELOG.md

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

3+
## v2.208.0 (2024-02-15)
4+
5+
### Features
6+
7+
* Telemetry metrics
8+
* TGI 1.4.0
9+
* Support collection type and target store for feature store ingestion.
10+
11+
### Bug Fixes and Other Changes
12+
13+
* bump jinja2 to 3.1.3 in doc/requirments.txt
14+
* chore(deps): bump jinja2 from 3.0.3 to 3.1.3 in /requirements/extras
15+
* Fix dependabot alert in transformers package
16+
* Bump Apache Airflow version to 2.8.0
17+
* skip failing mxnet tests
18+
19+
### Documentation Changes
20+
21+
* change order of pipelines topics
22+
* Explain the ClarifyCheckStep and QualityCheckStep parameters
23+
* fix the ClarifyCheckStep documentation to mention PDP
24+
325
## v2.207.1 (2024-02-06)
426

527
### Bug Fixes and Other Changes

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.207.2.dev0
1+
2.208.1.dev0

doc/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ sphinx==5.1.1
22
sphinx-rtd-theme==0.5.0
33
docutils==0.15.2
44
packaging==20.9
5-
jinja2<3.1
5+
jinja2==3.1.3
66
schema==0.7.5

doc/workflows/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The SageMaker Python SDK supports managed training and inference for a variety o
77
.. toctree::
88
:maxdepth: 2
99

10+
pipelines/index
1011
airflow/index
1112
step_functions/index
12-
pipelines/index
1313
lineage/index

src/sagemaker/image_uri_config/autogluon.json

+88-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"0.5": "0.5.2",
1111
"0.6": "0.6.2",
1212
"0.7": "0.7.0",
13-
"0.8": "0.8.2"
13+
"0.8": "0.8.2",
14+
"1.0": "1.0.0"
1415
},
1516
"versions": {
1617
"0.3.1": {
@@ -438,6 +439,47 @@
438439
"py_versions": [
439440
"py39"
440441
]
442+
},
443+
"1.0.0": {
444+
"registries": {
445+
"af-south-1": "626614931356",
446+
"il-central-1": "780543022126",
447+
"ap-east-1": "871362719292",
448+
"ap-northeast-1": "763104351884",
449+
"ap-northeast-2": "763104351884",
450+
"ap-northeast-3": "364406365360",
451+
"ap-south-1": "763104351884",
452+
"ap-southeast-1": "763104351884",
453+
"ap-southeast-2": "763104351884",
454+
"ap-southeast-3": "907027046896",
455+
"ap-southeast-4": "457447274322",
456+
"ca-central-1": "763104351884",
457+
"eu-central-1": "763104351884",
458+
"eu-north-1": "763104351884",
459+
"eu-west-1": "763104351884",
460+
"eu-west-2": "763104351884",
461+
"eu-west-3": "763104351884",
462+
"eu-south-1": "692866216735",
463+
"me-south-1": "217643126080",
464+
"sa-east-1": "763104351884",
465+
"us-east-1": "763104351884",
466+
"us-east-2": "763104351884",
467+
"us-gov-east-1": "446045086412",
468+
"us-gov-west-1": "442386744353",
469+
"us-iso-east-1": "886529160074",
470+
"us-isob-east-1": "094389454867",
471+
"us-west-1": "763104351884",
472+
"us-west-2": "763104351884",
473+
"ca-west-1": "204538143572"
474+
},
475+
"repository": "autogluon-training",
476+
"processors": [
477+
"cpu",
478+
"gpu"
479+
],
480+
"py_versions": [
481+
"py310"
482+
]
441483
}
442484
}
443485
},
@@ -448,7 +490,8 @@
448490
"0.5": "0.5.2",
449491
"0.6": "0.6.2",
450492
"0.7": "0.7.0",
451-
"0.8": "0.8.2"
493+
"0.8": "0.8.2",
494+
"1.0": "1.0.0"
452495
},
453496
"versions": {
454497
"0.3.1": {
@@ -901,6 +944,49 @@
901944
"py_versions": [
902945
"py39"
903946
]
947+
},
948+
"1.0.0": {
949+
"registries": {
950+
"af-south-1": "626614931356",
951+
"il-central-1": "780543022126",
952+
"ap-east-1": "871362719292",
953+
"ap-northeast-1": "763104351884",
954+
"ap-northeast-2": "763104351884",
955+
"ap-northeast-3": "364406365360",
956+
"ap-south-1": "763104351884",
957+
"ap-southeast-1": "763104351884",
958+
"ap-southeast-2": "763104351884",
959+
"ap-southeast-3": "907027046896",
960+
"ap-southeast-4": "457447274322",
961+
"ca-central-1": "763104351884",
962+
"cn-north-1": "727897471807",
963+
"cn-northwest-1": "727897471807",
964+
"eu-central-1": "763104351884",
965+
"eu-north-1": "763104351884",
966+
"eu-west-1": "763104351884",
967+
"eu-west-2": "763104351884",
968+
"eu-west-3": "763104351884",
969+
"eu-south-1": "692866216735",
970+
"me-south-1": "217643126080",
971+
"sa-east-1": "763104351884",
972+
"us-east-1": "763104351884",
973+
"us-east-2": "763104351884",
974+
"us-gov-east-1": "446045086412",
975+
"us-gov-west-1": "442386744353",
976+
"us-iso-east-1": "886529160074",
977+
"us-isob-east-1": "094389454867",
978+
"us-west-1": "763104351884",
979+
"us-west-2": "763104351884",
980+
"ca-west-1": "204538143572"
981+
},
982+
"repository": "autogluon-inference",
983+
"processors": [
984+
"cpu",
985+
"gpu"
986+
],
987+
"py_versions": [
988+
"py310"
989+
]
904990
}
905991
}
906992
}

src/sagemaker/image_uri_config/huggingface-llm.json

+49-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"1.0": "1.0.3",
1111
"1.1": "1.1.0",
1212
"1.2": "1.2.0",
13-
"1.3": "1.3.3"
13+
"1.3": "1.3.3",
14+
"1.4": "1.4.0"
1415
},
1516
"versions": {
1617
"0.6.0": {
@@ -388,6 +389,53 @@
388389
"container_version": {
389390
"gpu": "cu121-ubuntu20.04"
390391
}
392+
},
393+
"1.4.0": {
394+
"py_versions": [
395+
"py310"
396+
],
397+
"registries": {
398+
"af-south-1": "626614931356",
399+
"il-central-1": "780543022126",
400+
"ap-east-1": "871362719292",
401+
"ap-northeast-1": "763104351884",
402+
"ap-northeast-2": "763104351884",
403+
"ap-northeast-3": "364406365360",
404+
"ap-south-1": "763104351884",
405+
"ap-south-2": "772153158452",
406+
"ap-southeast-1": "763104351884",
407+
"ap-southeast-2": "763104351884",
408+
"ap-southeast-3": "907027046896",
409+
"ap-southeast-4": "457447274322",
410+
"ca-central-1": "763104351884",
411+
"cn-north-1": "727897471807",
412+
"cn-northwest-1": "727897471807",
413+
"eu-central-1": "763104351884",
414+
"eu-central-2": "380420809688",
415+
"eu-north-1": "763104351884",
416+
"eu-west-1": "763104351884",
417+
"eu-west-2": "763104351884",
418+
"eu-west-3": "763104351884",
419+
"eu-south-1": "692866216735",
420+
"eu-south-2": "503227376785",
421+
"me-south-1": "217643126080",
422+
"me-central-1": "914824155844",
423+
"sa-east-1": "763104351884",
424+
"us-east-1": "763104351884",
425+
"us-east-2": "763104351884",
426+
"us-gov-east-1": "446045086412",
427+
"us-gov-west-1": "442386744353",
428+
"us-iso-east-1": "886529160074",
429+
"us-isob-east-1": "094389454867",
430+
"us-west-1": "763104351884",
431+
"us-west-2": "763104351884",
432+
"ca-west-1": "204538143572"
433+
},
434+
"tag_prefix": "2.1.1-tgi1.4.0",
435+
"repository": "huggingface-pytorch-tgi-inference",
436+
"container_version": {
437+
"gpu": "cu121-ubuntu20.04"
438+
}
391439
}
392440
}
393441
}

src/sagemaker/serve/utils/telemetry_logger.py

+21-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
"""Placeholder docstring"""
1414
from __future__ import absolute_import
1515
import logging
16+
from time import perf_counter
17+
1618
import requests
1719

18-
from sagemaker import Session
20+
from sagemaker import Session, exceptions
1921
from sagemaker.serve.mode.function_pointers import Mode
2022
from sagemaker.serve.utils.exceptions import ModelBuilderException
2123
from sagemaker.serve.utils.types import ModelServer
24+
from sagemaker.user_agent import SDK_VERSION
2225

2326
logger = logging.getLogger(__name__)
2427

@@ -63,13 +66,21 @@ def wrapper(self, *args, **kwargs):
6366
f"{func_name}"
6467
f"&x-modelServer={MODEL_SERVER_TO_CODE[str(self.model_server)]}"
6568
f"&x-imageTag={image_uri_tail}"
69+
f"&x-sdkVersion={SDK_VERSION}"
6670
)
6771

6872
if self.model_server == ModelServer.DJL_SERVING or self.model_server == ModelServer.TGI:
6973
extra += f"&x-modelName={self.model}"
7074

75+
if self.sagemaker_session and self.sagemaker_session.endpoint_arn:
76+
extra += f"&x-endpointArn={self.sagemaker_session.endpoint_arn}"
77+
78+
start_timer = perf_counter()
7179
try:
7280
response = func(self, *args, **kwargs)
81+
stop_timer = perf_counter()
82+
elapsed = stop_timer - start_timer
83+
extra += f"&x-latency={round(elapsed, 2)}"
7384
if not self.serve_settings.telemetry_opt_out:
7485
_send_telemetry(
7586
"1",
@@ -79,7 +90,15 @@ def wrapper(self, *args, **kwargs):
7990
None,
8091
extra,
8192
)
82-
except ModelBuilderException as e:
93+
except (
94+
ModelBuilderException,
95+
exceptions.CapacityError,
96+
exceptions.UnexpectedStatusException,
97+
exceptions.AsyncInferenceError,
98+
) as e:
99+
stop_timer = perf_counter()
100+
elapsed = stop_timer - start_timer
101+
extra += f"&x-latency={round(elapsed, 2)}"
83102
if not self.serve_settings.telemetry_opt_out:
84103
_send_telemetry(
85104
"0",

src/sagemaker/session.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ def __init__(
243243
# sagemaker_config is validated and initialized inside :func:`_initialize`,
244244
# so if default_bucket is None and the sagemaker_config has a default S3 bucket configured,
245245
# _default_bucket_name_override will be set again inside :func:`_initialize`.
246+
self.endpoint_arn = None
246247
self._default_bucket = None
247248
self._default_bucket_name_override = default_bucket
248249
# this may also be set again inside :func:`_initialize` if it is None
@@ -4284,9 +4285,12 @@ def create_endpoint(self, endpoint_name, config_name, tags=None, wait=True, live
42844285
tags, "{}.{}.{}".format(SAGEMAKER, ENDPOINT, TAGS)
42854286
)
42864287

4287-
self.sagemaker_client.create_endpoint(
4288+
res = self.sagemaker_client.create_endpoint(
42884289
EndpointName=endpoint_name, EndpointConfigName=config_name, Tags=tags
42894290
)
4291+
if res:
4292+
self.endpoint_arn = res["EndpointArn"]
4293+
42904294
if wait:
42914295
self.wait_for_endpoint(endpoint_name, live_logging=live_logging)
42924296
return endpoint_name
@@ -4344,9 +4348,11 @@ def update_endpoint(self, endpoint_name, endpoint_config_name, wait=True):
43444348
"existing endpoint name".format(endpoint_name)
43454349
)
43464350

4347-
self.sagemaker_client.update_endpoint(
4351+
res = self.sagemaker_client.update_endpoint(
43484352
EndpointName=endpoint_name, EndpointConfigName=endpoint_config_name
43494353
)
4354+
if res:
4355+
self.endpoint_arn = res["EndpointArn"]
43504356

43514357
if wait:
43524358
self.wait_for_endpoint(endpoint_name)

src/sagemaker/workflow/clarify_check_step.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ class ModelExplainabilityCheckConfig(ClarifyCheckConfig):
132132
133133
Attributes:
134134
model_config (ModelConfig): Config of the model and its endpoint to be created.
135-
explainability_config (SHAPConfig): Config of the specific explainability method.
136-
Currently, only SHAP is supported.
135+
explainability_config (SHAPConfig or PDPConfig): Config of the explainability method.
136+
Supports SHAP or PDP.
137+
For `PDPConfig`, `features` must be specified.
138+
`top_k_features` based on SHAP is currently not supported.
137139
model_scores (str or int or ModelPredictedLabelConfig): Index or JMESPath expression
138140
to locate the predicted scores in the model output (default: None).
139141
This is not required if the model output is a single score. Alternatively,
@@ -166,6 +168,10 @@ def __init__(
166168
):
167169
"""Constructs a ClarifyCheckStep.
168170
171+
To understand the `skip_check`, `fail_on_violation`, `register_new_baseline`
172+
and `supplied_baseline_constraints` parameters, check the following documentation:
173+
https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-quality-clarify-baseline-lifecycle.html
174+
169175
Args:
170176
name (str): The name of the ClarifyCheckStep step.
171177
clarify_check_config (ClarifyCheckConfig): A ClarifyCheckConfig instance.

src/sagemaker/workflow/quality_check_step.py

+5
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ def __init__(
135135
):
136136
"""Constructs a QualityCheckStep.
137137
138+
To understand the `skip_check`, `fail_on_violation`, `register_new_baseline`,
139+
`supplied_baseline_constraints` and `supplied_baseline_constraints` parameters,
140+
check the following documentation:
141+
https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-quality-clarify-baseline-lifecycle.html
142+
138143
Args:
139144
name (str): The name of the QualityCheckStep step.
140145
quality_check_config (QualityCheckConfig): A QualityCheckConfig instance.

tests/unit/sagemaker/image_uris/test_huggingface_llm.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"1.2.0": "2.1.1-tgi1.2.0-gpu-py310-cu121-ubuntu20.04",
2929
"1.3.1": "2.1.1-tgi1.3.1-gpu-py310-cu121-ubuntu20.04",
3030
"1.3.3": "2.1.1-tgi1.3.3-gpu-py310-cu121-ubuntu20.04",
31+
"1.4.0": "2.1.1-tgi1.4.0-gpu-py310-cu121-ubuntu20.04",
3132
},
3233
"inf2": {
3334
"0.0.16": "1.13.1-optimum0.0.16-neuronx-py310-ubuntu22.04",

0 commit comments

Comments
 (0)