Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
3 changes: 3 additions & 0 deletions src/sagemaker/experiments/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from sagemaker.experiments.trial import _Trial
from sagemaker.experiments.trial_component import _TrialComponent
from sagemaker.utils import format_tags
from sagemaker.telemetry.telemetry_logging import _telemetry_emitter
from sagemaker.telemetry.constants import Feature


class Experiment(_base_types.Record):
Expand Down Expand Up @@ -93,6 +95,7 @@ def load(cls, experiment_name, sagemaker_session=None):
)

@classmethod
@_telemetry_emitter(feature=Feature.MLOPS, func_name="experiment.create")
def create(
cls,
experiment_name,
Expand Down
5 changes: 5 additions & 0 deletions src/sagemaker/jumpstart/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@

from sagemaker.serverless.serverless_inference_config import ServerlessInferenceConfig
from sagemaker.workflow.entities import PipelineVariable
from sagemaker.telemetry.telemetry_logging import _telemetry_emitter
from sagemaker.telemetry.constants import Feature


class JumpStartEstimator(Estimator):
Expand All @@ -60,6 +62,7 @@ class JumpStartEstimator(Estimator):
This class sets defaults based on the model ID and version.
"""

@_telemetry_emitter(feature=Feature.JUMPSTART, func_name="jumpstart_estimator.create")
def __init__(
self,
model_id: Optional[str] = None,
Expand Down Expand Up @@ -646,6 +649,7 @@ def _validate_model_id_and_get_type_hook():

super(JumpStartEstimator, self).__init__(**estimator_init_kwargs.to_kwargs_dict())

@_telemetry_emitter(feature=Feature.JUMPSTART, func_name="jumpstart_estimator.fit")
def fit(
self,
inputs: Optional[Union[str, Dict, TrainingInput, FileSystemInput]] = None,
Expand Down Expand Up @@ -833,6 +837,7 @@ def attach(
additional_kwargs=additional_kwargs,
)

@_telemetry_emitter(feature=Feature.JUMPSTART, func_name="jumpstart_estimator.deploy")
def deploy(
self,
initial_instance_count: Optional[int] = None,
Expand Down
5 changes: 5 additions & 0 deletions src/sagemaker/jumpstart/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@
from sagemaker.drift_check_baselines import DriftCheckBaselines
from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements

from sagemaker.telemetry.telemetry_logging import _telemetry_emitter
from sagemaker.telemetry.constants import Feature


class JumpStartModel(Model):
"""JumpStartModel class.

This class sets defaults based on the model ID and version.
"""

@_telemetry_emitter(feature=Feature.JUMPSTART, func_name="jumpstart_model.create")
Copy link
Contributor

Choose a reason for hiding this comment

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

For Jumpstart, we might need to add for Jumpstart estimator as well: https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/jumpstart/estimator.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just added

def __init__(
self,
model_id: Optional[str] = None,
Expand Down Expand Up @@ -639,6 +643,7 @@ def _create_sagemaker_model(
**kwargs,
)

@_telemetry_emitter(feature=Feature.JUMPSTART, func_name="jumpstart_model.deploy")
def deploy(
self,
initial_instance_count: Optional[int] = None,
Expand Down
3 changes: 3 additions & 0 deletions src/sagemaker/telemetry/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class Feature(Enum):
MODEL_TRAINER = 4
ESTIMATOR = 5
HYPERPOD = 6 # Added to support telemetry in sagemaker-hyperpod-cli
# Note: HyperPod CLI uses codes 6 and 7
JUMPSTART = 8 # Added to support JumpStart telemetry
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure that this value does not coincide with Hyperpod V2 as well, which is WIP

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, ive talked to avi about it.

MLOPS = 9 # Added to support MLOps telemetry

def __str__(self): # pylint: disable=E0307
"""Return the feature name."""
Expand Down
3 changes: 3 additions & 0 deletions src/sagemaker/telemetry/telemetry_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
str(Feature.MODEL_TRAINER): 4,
str(Feature.ESTIMATOR): 5,
str(Feature.HYPERPOD): 6, # Added to support telemetry in sagemaker-hyperpod-cli
# Note: HyperPod CLI uses codes 6 and 7
str(Feature.JUMPSTART): 8,
str(Feature.MLOPS): 9,
}

STATUS_TO_CODE = {
Expand Down
4 changes: 4 additions & 0 deletions src/sagemaker/workflow/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
)
from sagemaker.workflow.utilities import list_to_request
from sagemaker.workflow._steps_compiler import StepsCompiler
from sagemaker.telemetry.telemetry_logging import _telemetry_emitter
from sagemaker.telemetry.constants import Feature

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -134,6 +136,7 @@ def latest_pipeline_version_id(self):
else:
return summaries[0].get("PipelineVersionId")

@_telemetry_emitter(feature=Feature.MLOPS, func_name="pipeline.create")
def create(
self,
role_arn: str = None,
Expand Down Expand Up @@ -342,6 +345,7 @@ def delete(self) -> Dict[str, Any]:
)
return self.sagemaker_session.sagemaker_client.delete_pipeline(PipelineName=self.name)

@_telemetry_emitter(feature=Feature.MLOPS, func_name="pipeline.start")
def start(
self,
parameters: Dict[str, Union[str, bool, int, float]] = None,
Expand Down
Loading