File tree Expand file tree Collapse file tree 5 files changed +12
-1
lines changed Expand file tree Collapse file tree 5 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1515
1616from sagemaker .debugger .debugger import ( # noqa: F401
1717 CollectionConfig ,
18+ DEBUGGER_FLAG ,
1819 DebuggerHookConfig ,
1920 framework_name ,
2021 get_default_profiler_rule ,
Original file line number Diff line number Diff line change 3232from sagemaker .utils import build_dict
3333
3434framework_name = "debugger"
35+ DEBUGGER_FLAG = "USE_SMDEBUG"
3536
3637
3738def get_rule_container_image_uri (region ):
Original file line number Diff line number Diff line change 2929from sagemaker .analytics import TrainingJobAnalytics
3030from sagemaker .debugger import TensorBoardOutputConfig # noqa: F401 # pylint: disable=unused-import
3131from sagemaker .debugger import (
32+ DEBUGGER_FLAG ,
3233 DebuggerHookConfig ,
3334 FrameworkProfile ,
3435 get_default_profiler_rule ,
@@ -2269,6 +2270,11 @@ def _validate_and_set_debugger_configs(self):
22692270 )
22702271 self .debugger_hook_config = False
22712272
2273+ if self .debugger_hook_config is False :
2274+ if self .environment is None :
2275+ self .environment = {}
2276+ self .environment [DEBUGGER_FLAG ] = "0"
2277+
22722278 def _stage_user_code_in_s3 (self ):
22732279 """Upload the user training script to s3 and return the location.
22742280
Original file line number Diff line number Diff line change 1818import pytest
1919
2020from sagemaker .debugger .debugger import (
21+ DEBUGGER_FLAG ,
2122 DebuggerHookConfig ,
2223 Rule ,
2324 rule_configs ,
@@ -748,6 +749,7 @@ def test_mxnet_with_debugger_hook_config_disabled(
748749 job_description = mx .latest_training_job .describe ()
749750
750751 assert job_description .get ("DebugHookConfig" ) is None
752+ assert job_description .get ("Environment" , {}).get (DEBUGGER_FLAG ) == "0"
751753
752754
753755def _get_rule_evaluation_statuses (job_description ):
Original file line number Diff line number Diff line change 2323 patch ,
2424)
2525
26- from sagemaker .debugger import ProfilerConfig
26+ from sagemaker .debugger import DEBUGGER_FLAG , ProfilerConfig
2727from sagemaker .estimator import Estimator
2828from sagemaker .tensorflow import TensorFlow
2929from sagemaker .inputs import TrainingInput , TransformInput , CreateModelInput
@@ -275,6 +275,7 @@ def test_training_step_tensorflow(sagemaker_session):
275275 "sagemaker_distributed_dataparallel_custom_mpi_options" : '""' ,
276276 },
277277 "ProfilerConfig" : {"S3OutputPath" : "s3://my-bucket/" },
278+ "Environment" : {DEBUGGER_FLAG : "0" },
278279 },
279280 "CacheConfig" : {"Enabled" : True , "ExpireAfter" : "PT1H" },
280281 }
You can’t perform that action at this time.
0 commit comments