Skip to content

Commit cdba7e3

Browse files
authored
Merge branch 'aws:master' into master
2 parents 6a17572 + ddd06bb commit cdba7e3

File tree

72 files changed

+3375
-256
lines changed

Some content is hidden

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

72 files changed

+3375
-256
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
build
33
src/*.egg-info
44
.cache
5-
.coverage
5+
.coverage*
66
sagemaker_venv*
77
*.egg-info
88
.tox

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,52 @@
11
# Changelog
22

3+
## v2.188.0 (2023-09-26)
4+
5+
### Features
6+
7+
* jumpstart instance type variants
8+
* New methods to ingest and create Feature Groups
9+
10+
### Bug Fixes and Other Changes
11+
12+
* auto ml integ tests and add flaky test markers
13+
* Enhance unit-tests to automatically consume image URIs config registries from config JSONs
14+
15+
## v2.187.0 (2023-09-19)
16+
17+
### Features
18+
19+
* add HealthCheckConfig support
20+
* SkipModelValidation in modelRegistry
21+
22+
### Bug Fixes and Other Changes
23+
24+
* Update fw_utils.py - support 2.0.1 container for DDP and Torch distri…
25+
* bump apache-airflow to v2.7.1
26+
27+
## v2.186.0 (2023-09-14)
28+
29+
### Features
30+
31+
* TGI 1.0.3 Image URI Config
32+
33+
## v2.185.0 (2023-09-12)
34+
35+
### Features
36+
37+
* Local Mode - Add Support for Docker Compose V2
38+
39+
### Bug Fixes and Other Changes
40+
41+
* handle bad jumpstart default session
42+
* Add Data Wrangler TLV and version 3.x images
43+
44+
## v2.184.0.post0 (2023-09-11)
45+
46+
### Documentation Changes
47+
48+
* add interactive apps rst file
49+
350
## v2.184.0 (2023-09-07)
451

552
### Features

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.184.1.dev0
1+
2.188.1.dev0
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FeatureGroup Utilities
2+
----------------------
3+
4+
.. automodule:: sagemaker.feature_store.feature_utils
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

doc/overview.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,14 +1550,15 @@ them to your local environment. This is a great way to test your deep learning s
15501550
managed training or hosting environments. Local Mode is supported for frameworks images (TensorFlow, MXNet, Chainer, PyTorch,
15511551
and Scikit-Learn) and images you supply yourself.
15521552

1553-
You can install necessary dependencies for this feature using pip; local mode also requires docker-compose which you can
1554-
install using the following steps (More info - https://github.com/docker/compose#where-to-get-docker-compose ):
1553+
You can install necessary dependencies for this feature using pip.
15551554

15561555
::
15571556

15581557
pip install 'sagemaker[local]' --upgrade
1559-
curl -L "https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
1560-
chmod +x /usr/local/bin/docker-compose
1558+
1559+
1560+
Additionally, Local Mode also requires Docker Compose V2. Follow the guidelines in https://docs.docker.com/compose/install/ to install.
1561+
Make sure to have a Compose Version compatible with your Docker Engine installation. Check Docker Engine release notes https://docs.docker.com/engine/release-notes to find a compatible version.
15611562

15621563
If you want to keep everything local, and not use Amazon S3 either, you can enable "local code" in one of two ways:
15631564

requirements/extras/test_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ awslogs==0.14.0
1212
black==22.3.0
1313
stopit==1.1.2
1414
# Update tox.ini to have correct version of airflow constraints file
15-
apache-airflow==2.7.0
15+
apache-airflow==2.7.1
1616
apache-airflow-providers-amazon==7.2.1
1717
attrs>=23.1.0,<24
1818
fabric==2.6.0

src/sagemaker/chainer/model.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def __init__(
148148

149149
def register(
150150
self,
151-
content_types: List[Union[str, PipelineVariable]],
152-
response_types: List[Union[str, PipelineVariable]],
151+
content_types: List[Union[str, PipelineVariable]] = None,
152+
response_types: List[Union[str, PipelineVariable]] = None,
153153
inference_instances: Optional[List[Union[str, PipelineVariable]]] = None,
154154
transform_instances: Optional[List[Union[str, PipelineVariable]]] = None,
155155
model_package_name: Optional[Union[str, PipelineVariable]] = None,
@@ -169,6 +169,7 @@ def register(
169169
framework_version: Optional[Union[str, PipelineVariable]] = None,
170170
nearest_model_name: Optional[Union[str, PipelineVariable]] = None,
171171
data_input_configuration: Optional[Union[str, PipelineVariable]] = None,
172+
skip_model_validation: Optional[Union[str, PipelineVariable]] = None,
172173
):
173174
"""Creates a model package for creating SageMaker models or listing on Marketplace.
174175
@@ -216,6 +217,8 @@ def register(
216217
benchmarked by Amazon SageMaker Inference Recommender (default: None).
217218
data_input_configuration (str or PipelineVariable): Input object for the model
218219
(default: None).
220+
skip_model_validation (str or PipelineVariable): Indicates if you want to skip model
221+
validation. Values can be "All" or "None" (default: None).
219222
220223
Returns:
221224
str: A string of SageMaker Model Package ARN.
@@ -254,6 +257,7 @@ def register(
254257
framework_version=framework_version or self.framework_version,
255258
nearest_model_name=nearest_model_name,
256259
data_input_configuration=data_input_configuration,
260+
skip_model_validation=skip_model_validation,
257261
)
258262

259263
def prepare_container_def(

src/sagemaker/environment_variables.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from sagemaker.jumpstart import utils as jumpstart_utils
2121
from sagemaker.jumpstart import artifacts
2222
from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION
23+
from sagemaker.jumpstart.enums import JumpStartScriptScope
2324
from sagemaker.session import Session
2425

2526
logger = logging.getLogger(__name__)
@@ -33,6 +34,8 @@ def retrieve_default(
3334
tolerate_deprecated_model: bool = False,
3435
include_aws_sdk_env_vars: bool = True,
3536
sagemaker_session: Session = DEFAULT_JUMPSTART_SAGEMAKER_SESSION,
37+
instance_type: Optional[str] = None,
38+
script: JumpStartScriptScope = JumpStartScriptScope.INFERENCE,
3639
) -> Dict[str, str]:
3740
"""Retrieves the default container environment variables for the model matching the arguments.
3841
@@ -58,6 +61,10 @@ def retrieve_default(
5861
object, used for SageMaker interactions. If not
5962
specified, one is created using the default AWS configuration
6063
chain. (Default: sagemaker.jumpstart.constants.DEFAULT_JUMPSTART_SAGEMAKER_SESSION).
64+
instance_type (str): An instance type to optionally supply in order to get environment
65+
variables specific for the instance type.
66+
script (JumpStartScriptScope): The JumpStart script for which to retrieve environment
67+
variables.
6168
Returns:
6269
dict: The variables to use for the model.
6370
@@ -78,4 +85,6 @@ def retrieve_default(
7885
tolerate_deprecated_model,
7986
include_aws_sdk_env_vars,
8087
sagemaker_session=sagemaker_session,
88+
instance_type=instance_type,
89+
script=script,
8190
)

src/sagemaker/estimator.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def __init__(
173173
instance_groups: Optional[List[InstanceGroup]] = None,
174174
training_repository_access_mode: Optional[Union[str, PipelineVariable]] = None,
175175
training_repository_credentials_provider_arn: Optional[Union[str, PipelineVariable]] = None,
176+
enable_infra_check: Optional[Union[bool, PipelineVariable]] = None,
176177
container_entry_point: Optional[List[str]] = None,
177178
container_arguments: Optional[List[str]] = None,
178179
disable_output_compression: bool = False,
@@ -536,6 +537,8 @@ def __init__(
536537
a training job.
537538
disable_output_compression (bool): Optional. When set to true, Model is uploaded
538539
to Amazon S3 without compression after training finishes.
540+
enable_infra_check (bool or PipelineVariable): Optional.
541+
Specifies whether it is running Sagemaker built-in infra check jobs.
539542
"""
540543
instance_count = renamed_kwargs(
541544
"train_instance_count", "instance_count", instance_count, kwargs
@@ -665,6 +668,7 @@ def __init__(
665668
training_repository_credentials_provider_arn
666669
)
667670

671+
self.enable_infra_check = enable_infra_check
668672
# container entry point / arguments configs
669673
self.container_entry_point = container_entry_point
670674
self.container_arguments = container_arguments
@@ -1661,8 +1665,8 @@ def deploy(
16611665

16621666
def register(
16631667
self,
1664-
content_types,
1665-
response_types,
1668+
content_types=None,
1669+
response_types=None,
16661670
inference_instances=None,
16671671
transform_instances=None,
16681672
image_uri=None,
@@ -1684,6 +1688,7 @@ def register(
16841688
framework_version=None,
16851689
nearest_model_name=None,
16861690
data_input_configuration=None,
1691+
skip_model_validation=None,
16871692
**kwargs,
16881693
):
16891694
"""Creates a model package for creating SageMaker models or listing on Marketplace.
@@ -1729,6 +1734,8 @@ def register(
17291734
nearest_model_name (str): Name of a pre-trained machine learning benchmarked by
17301735
Amazon SageMaker Inference Recommender (default: None).
17311736
data_input_configuration (str): Input object for the model (default: None).
1737+
skip_model_validation (str): Indicates if you want to skip model validation.
1738+
Values can be "All" or "None" (default: None).
17321739
**kwargs: Passed to invocation of ``create_model()``. Implementations may customize
17331740
``create_model()`` to accept ``**kwargs`` to customize model creation during
17341741
deploy. For more, see the implementation docs.
@@ -1772,6 +1779,7 @@ def register(
17721779
framework_version=framework_version,
17731780
nearest_model_name=nearest_model_name,
17741781
data_input_configuration=data_input_configuration,
1782+
skip_model_validation=skip_model_validation,
17751783
)
17761784

17771785
@property
@@ -1900,6 +1908,11 @@ def _prepare_init_params_from_job_description(cls, job_details, model_channel_na
19001908
"EnableInterContainerTrafficEncryption"
19011909
]
19021910

1911+
if "InfraCheckConfig" in job_details:
1912+
init_params["enable_infra_check"] = job_details["InfraCheckConfig"].get(
1913+
"EnableInfraCheck"
1914+
)
1915+
19031916
subnets, security_group_ids = vpc_utils.from_dict(job_details.get(vpc_utils.VPC_CONFIG_KEY))
19041917
if subnets:
19051918
init_params["subnets"] = subnets
@@ -2442,6 +2455,10 @@ def _get_train_args(cls, estimator, inputs, experiment_config):
24422455
] = estimator.training_repository_credentials_provider_arn
24432456
train_args["training_image_config"] = training_image_config
24442457

2458+
if estimator.enable_infra_check is not None:
2459+
infra_check_config = {"EnableInfraCheck": estimator.enable_infra_check}
2460+
train_args["infra_check_config"] = infra_check_config
2461+
24452462
if estimator.container_entry_point is not None:
24462463
train_args["container_entry_point"] = estimator.container_entry_point
24472464

@@ -2657,6 +2674,7 @@ def __init__(
26572674
container_entry_point: Optional[List[str]] = None,
26582675
container_arguments: Optional[List[str]] = None,
26592676
disable_output_compression: bool = False,
2677+
enable_infra_check: Optional[Union[bool, PipelineVariable]] = None,
26602678
**kwargs,
26612679
):
26622680
"""Initialize an ``Estimator`` instance.
@@ -3016,6 +3034,8 @@ def __init__(
30163034
a training job.
30173035
disable_output_compression (bool): Optional. When set to true, Model is uploaded
30183036
to Amazon S3 without compression after training finishes.
3037+
enable_infra_check (bool or PipelineVariable): Optional.
3038+
Specifies whether it is running Sagemaker built-in infra check jobs.
30193039
"""
30203040
self.image_uri = image_uri
30213041
self._hyperparameters = hyperparameters.copy() if hyperparameters else {}

src/sagemaker/feature_store/feature_group.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,14 @@ def get_query_execution(self) -> Dict[str, Any]:
138138
query_execution_id=self._current_query_execution_id
139139
)
140140

141-
def as_dataframe(self) -> DataFrame:
141+
def as_dataframe(self, **kwargs) -> DataFrame:
142142
"""Download the result of the current query and load it into a DataFrame.
143143
144+
Args:
145+
**kwargs (object): key arguments used for the method pandas.read_csv to be able to
146+
have a better tuning on data. For more info read:
147+
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
148+
144149
Returns:
145150
A pandas DataFrame contains the query result.
146151
"""
@@ -161,7 +166,9 @@ def as_dataframe(self) -> DataFrame:
161166
query_execution_id=self._current_query_execution_id,
162167
filename=output_filename,
163168
)
164-
return pd.read_csv(output_filename, delimiter=",")
169+
170+
kwargs.pop("delimiter", None)
171+
return pd.read_csv(filepath_or_buffer=output_filename, delimiter=",", **kwargs)
165172

166173

167174
@attr.s

0 commit comments

Comments
 (0)