Skip to content

Commit d5b8d5a

Browse files
committed
set disable_profiler= True
1 parent 85c038e commit d5b8d5a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/sagemaker/estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def __init__(
595595

596596
if not _region_supports_profiler(
597597
self.sagemaker_session.boto_region_name
598-
) or not _instance_type_supports_profiler(self.instance_type):
598+
) or _instance_type_supports_profiler(self.instance_type):
599599
self.disable_profiler = True
600600

601601
self.profiler_rule_configs = None

src/sagemaker/fw_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,8 +1077,8 @@ def _instance_type_supports_profiler(instance_type):
10771077
if isinstance(instance_type, str):
10781078
match = re.match(r"^ml[\._]([a-z\d]+)\.?\w*$", instance_type)
10791079
if match and match[1].startswith("trn"):
1080-
return False
1081-
return True
1080+
return True
1081+
return False
10821082

10831083

10841084
def validate_version_or_image_args(framework_version, py_version, image_uri):

tests/unit/test_fw_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,6 @@ def test_validate_unsupported_distributions_trainium_raises():
10431043

10441044

10451045
def test_instance_type_supports_profiler():
1046-
assert fw_utils._instance_type_supports_profiler("ml.trn1.xlarge") is False
1047-
assert fw_utils._instance_type_supports_profiler("ml.m4.xlarge") is True
1048-
assert fw_utils._instance_type_supports_profiler("local") is True
1046+
assert fw_utils._instance_type_supports_profiler("ml.trn1.xlarge") is True
1047+
assert fw_utils._instance_type_supports_profiler("ml.m4.xlarge") is False
1048+
assert fw_utils._instance_type_supports_profiler("local") is False

0 commit comments

Comments
 (0)