Skip to content

Commit fc081c7

Browse files
mariumofknikure
authored andcommitted
fix: add deprecation warning
1 parent 50a6da2 commit fc081c7

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/sagemaker/debugger/profiler_config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
"""Configuration for collecting system and framework metrics in SageMaker training jobs."""
1414
from __future__ import absolute_import
1515

16+
import logging
1617
from typing import Optional, Union
1718

1819
from sagemaker.debugger.framework_profile import FrameworkProfile
1920
from sagemaker.workflow.entities import PipelineVariable
2021

22+
logger = logging.getLogger(__name__)
23+
2124

2225
class ProfilerConfig(object):
2326
"""Configuration for collecting system and framework metrics of SageMaker training jobs.
@@ -81,6 +84,11 @@ class and SageMaker Framework estimators.
8184
self.framework_profile_params = framework_profile_params
8285
self.disable_profiler = disable_profiler
8386

87+
if self.framework_profile_params is not None:
88+
logger.warning(
89+
"Framework profiling will be deprecated from tensorflow 2.12 and pytorch 2.0"
90+
)
91+
8492
def _to_request_dict(self):
8593
"""Generate a request dictionary using the parameters provided when initializing the object.
8694

tests/unit/test_profiler_config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,6 @@ def test_create_pytorch_estimator_w_image_with_framework_profile(
708708
)
709709

710710

711-
"""
712711
def test_create_tf_estimator_with_framework_profile(
713712
sagemaker_session,
714713
tensorflow_inference_version,
@@ -720,13 +719,16 @@ def test_create_tf_estimator_with_framework_profile(
720719
tf = TensorFlow(
721720
entry_point=SCRIPT_PATH,
722721
role=ROLE,
723-
framework_version=tensorflow_inference_version,
724-
py_version=tensorflow_inference_py_version,
722+
framework_version="2.8",
723+
py_version="py39",
725724
sagemaker_session=sagemaker_session,
726725
instance_count=INSTANCE_COUNT,
727726
instance_type=INSTANCE_TYPE,
728727
profiler_config=profiler_config,
729728
)
729+
730+
731+
"""
730732
... ValueError: TF 1.5 supports only legacy mode.
731733
Please supply the image URI directly with
732734
'image_uri=520713654638.dkr.ecr.us-west-2.amazonaws.com/sagemaker-tensorflow:1.5-cpu-py2'

0 commit comments

Comments
 (0)