Skip to content

feat: jumpstart estimator enable infra check flag #4154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sagemaker/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3082,6 +3082,7 @@ def __init__(
hyperparameters=hyperparameters,
instance_groups=instance_groups,
training_repository_access_mode=training_repository_access_mode,
enable_infra_check=enable_infra_check,
training_repository_credentials_provider_arn=training_repository_credentials_provider_arn, # noqa: E501 # pylint: disable=line-too-long
container_entry_point=container_entry_point,
container_arguments=container_arguments,
Expand Down
4 changes: 4 additions & 0 deletions src/sagemaker/jumpstart/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def __init__(
instance_groups: Optional[List[InstanceGroup]] = None,
training_repository_access_mode: Optional[Union[str, PipelineVariable]] = None,
training_repository_credentials_provider_arn: Optional[Union[str, PipelineVariable]] = None,
enable_infra_check: Optional[Union[bool, PipelineVariable]] = None,
container_entry_point: Optional[List[str]] = None,
container_arguments: Optional[List[str]] = None,
disable_output_compression: Optional[bool] = None,
Expand Down Expand Up @@ -485,6 +486,8 @@ def __init__(
private Docker registry where your training image is hosted (Default: None).
When it's set to None, SageMaker will not do authentication before pulling the image
in the private Docker registry. (Default: None).
enable_infra_check (Optional[Union[bool, PipelineVariable]]):
Specifies whether it is running Sagemaker built-in infra check jobs.
container_entry_point (Optional[List[str]]): The entrypoint script for a Docker
container used to run a training job. This script takes precedence over
the default train processing instructions.
Expand Down Expand Up @@ -565,6 +568,7 @@ def _is_valid_model_id_hook():
container_entry_point=container_entry_point,
container_arguments=container_arguments,
disable_output_compression=disable_output_compression,
enable_infra_check=enable_infra_check,
)

self.model_id = estimator_init_kwargs.model_id
Expand Down
2 changes: 2 additions & 0 deletions src/sagemaker/jumpstart/factory/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def get_init_kwargs(
container_entry_point: Optional[List[str]] = None,
container_arguments: Optional[List[str]] = None,
disable_output_compression: Optional[bool] = None,
enable_infra_check: Optional[Union[bool, PipelineVariable]] = None,
) -> JumpStartEstimatorInitKwargs:
"""Returns kwargs required to instantiate `sagemaker.estimator.Estimator` object."""

Expand Down Expand Up @@ -178,6 +179,7 @@ def get_init_kwargs(
container_entry_point=container_entry_point,
container_arguments=container_arguments,
disable_output_compression=disable_output_compression,
enable_infra_check=enable_infra_check,
)

estimator_init_kwargs = _add_model_version_to_kwargs(estimator_init_kwargs)
Expand Down
4 changes: 4 additions & 0 deletions src/sagemaker/jumpstart/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from sagemaker.utils import get_instance_type_family

from sagemaker.session import Session
from sagemaker.workflow.entities import PipelineVariable


class JumpStartDataHolderType:
Expand Down Expand Up @@ -1011,6 +1012,7 @@ class JumpStartEstimatorInitKwargs(JumpStartKwargs):
"container_entry_point",
"container_arguments",
"disable_output_compression",
"enable_infra_check",
]

SERIALIZATION_EXCLUSION_SET = {
Expand Down Expand Up @@ -1074,6 +1076,7 @@ def __init__(
container_entry_point: Optional[List[str]] = None,
container_arguments: Optional[List[str]] = None,
disable_output_compression: Optional[bool] = None,
enable_infra_check: Optional[Union[bool, PipelineVariable]] = None,
) -> None:
"""Instantiates JumpStartEstimatorInitKwargs object."""

Expand Down Expand Up @@ -1130,6 +1133,7 @@ def __init__(
self.container_entry_point = container_entry_point
self.container_arguments = container_arguments
self.disable_output_compression = disable_output_compression
self.enable_infra_check = enable_infra_check


class JumpStartEstimatorFitKwargs(JumpStartKwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def test_jumpstart_estimator_kwargs_match_parent_class(self):
Please add the new argument to the skip set below,
and reach out to JumpStart team."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a prompt to cut a sev-2.5 to JumpStart team please?


init_args_to_skip: Set[str] = set(["kwargs", "enable_infra_check"])
init_args_to_skip: Set[str] = set(["kwargs"])
fit_args_to_skip: Set[str] = set()
deploy_args_to_skip: Set[str] = set(["kwargs"])

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/sagemaker/jumpstart/model/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_jumpstart_model_kwargs_match_parent_class(self):

"""If you add arguments to <Model constructor>, this test will fail.
Please add the new argument to the skip set below,
and cut a ticket sev-3 to JumpStart team: AWS > SageMaker > JumpStart"""
and reach out to JumpStart team."""

init_args_to_skip: Set[str] = set()
deploy_args_to_skip: Set[str] = set(["kwargs"])
Expand Down