Skip to content

Commit d676d3a

Browse files
committed
fix: linting in training compiler files
1 parent 11ba967 commit d676d3a

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/sagemaker/tensorflow/training_compiler/config.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ def validate(
9999
if estimator.framework_version:
100100
if version.parse(estimator.framework_version) < cls.MIN_SUPPORTED_VERSION:
101101
error_helper_string = (
102-
f"SageMaker Training Compiler only supports TensorFlow version "
103-
f">= {cls.MIN_SUPPORTED_VERSION} but received {estimator.framework_version}"
102+
"SageMaker Training Compiler only supports TensorFlow version "
103+
">= {} but received {}"
104+
)
105+
error_helper_string = error_helper_string.format(
106+
cls.MIN_SUPPORTED_VERSION, estimator.framework_version
104107
)
105108
raise ValueError(error_helper_string)

src/sagemaker/training_compiler/config.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ def validate(
153153
elif estimator.instance_type == "local":
154154
error_helper_string = (
155155
"The local mode is not supported by SageMaker Training Compiler."
156-
f"It only supports the following GPU instances: {cls.SUPPORTED_INSTANCE_CLASS_PREFIXES}."
156+
"It only supports the following GPU instances: {}"
157157
)
158+
error_helper_string = error_helper_string.format(cls.SUPPORTED_INSTANCE_CLASS_PREFIXES)
158159
raise ValueError(error_helper_string)
159160

160161
if estimator.distribution and "smdistributed" in estimator.distribution:
@@ -164,9 +165,13 @@ def validate(
164165
)
165166

166167
if estimator.debugger_hook_config or (not estimator.disable_profiler):
167-
logger.warning(
168-
f"Using Debugger and/or Profiler with SageMaker Training Compiler causes poor "
169-
f"performance. Found debugger_hook_config={estimator.debugger_hook_config} "
170-
f"disable_profiler={estimator.disable_profiler}. Please set "
171-
f"debugger_hook_config=None and disable_profiler=True for optimal performance."
168+
helper_string = (
169+
"Using Debugger and/or Profiler with SageMaker Training Compiler causes poor "
170+
"performance. Found debugger_hook_config={} "
171+
"disable_profiler={}. Please set "
172+
"debugger_hook_config=None and disable_profiler=True for optimal performance."
173+
)
174+
helper_string = helper_string.format(
175+
estimator.debugger_hook_config, estimator.disable_profiler
172176
)
177+
logger.warning(helper_string)

0 commit comments

Comments
 (0)