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 15
15
16
16
from sagemaker .debugger .debugger import ( # noqa: F401
17
17
CollectionConfig ,
18
+ DEBUGGER_FLAG ,
18
19
DebuggerHookConfig ,
19
20
framework_name ,
20
21
get_default_profiler_rule ,
Original file line number Diff line number Diff line change 32
32
from sagemaker .utils import build_dict
33
33
34
34
framework_name = "debugger"
35
+ DEBUGGER_FLAG = "USE_SMDEBUG"
35
36
36
37
37
38
def get_rule_container_image_uri (region ):
Original file line number Diff line number Diff line change 29
29
from sagemaker .analytics import TrainingJobAnalytics
30
30
from sagemaker .debugger import TensorBoardOutputConfig # noqa: F401 # pylint: disable=unused-import
31
31
from sagemaker .debugger import (
32
+ DEBUGGER_FLAG ,
32
33
DebuggerHookConfig ,
33
34
FrameworkProfile ,
34
35
get_default_profiler_rule ,
@@ -2269,6 +2270,11 @@ def _validate_and_set_debugger_configs(self):
2269
2270
)
2270
2271
self .debugger_hook_config = False
2271
2272
2273
+ if self .debugger_hook_config is False :
2274
+ if self .environment is None :
2275
+ self .environment = {}
2276
+ self .environment [DEBUGGER_FLAG ] = "0"
2277
+
2272
2278
def _stage_user_code_in_s3 (self ):
2273
2279
"""Upload the user training script to s3 and return the location.
2274
2280
Original file line number Diff line number Diff line change 18
18
import pytest
19
19
20
20
from sagemaker .debugger .debugger import (
21
+ DEBUGGER_FLAG ,
21
22
DebuggerHookConfig ,
22
23
Rule ,
23
24
rule_configs ,
@@ -748,6 +749,7 @@ def test_mxnet_with_debugger_hook_config_disabled(
748
749
job_description = mx .latest_training_job .describe ()
749
750
750
751
assert job_description .get ("DebugHookConfig" ) is None
752
+ assert job_description .get ("Environment" , {}).get (DEBUGGER_FLAG ) == "0"
751
753
752
754
753
755
def _get_rule_evaluation_statuses (job_description ):
Original file line number Diff line number Diff line change 23
23
patch ,
24
24
)
25
25
26
- from sagemaker .debugger import ProfilerConfig
26
+ from sagemaker .debugger import DEBUGGER_FLAG , ProfilerConfig
27
27
from sagemaker .estimator import Estimator
28
28
from sagemaker .tensorflow import TensorFlow
29
29
from sagemaker .inputs import TrainingInput , TransformInput , CreateModelInput
@@ -275,6 +275,7 @@ def test_training_step_tensorflow(sagemaker_session):
275
275
"sagemaker_distributed_dataparallel_custom_mpi_options" : '""' ,
276
276
},
277
277
"ProfilerConfig" : {"S3OutputPath" : "s3://my-bucket/" },
278
+ "Environment" : {DEBUGGER_FLAG : "0" },
278
279
},
279
280
"CacheConfig" : {"Enabled" : True , "ExpireAfter" : "PT1H" },
280
281
}
You can’t perform that action at this time.
0 commit comments