File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,6 @@ def arguments(self) -> RequestType:
160
160
NOTE: The CreateTrainingJob request is not quite the args list that workflow needs.
161
161
The TrainingJobName and ExperimentConfig attributes cannot be included.
162
162
"""
163
- self .estimator .disable_profiler = True
164
- self .estimator .profiler_config = None
165
- self .estimator .profiler_rules = None
166
163
167
164
self .estimator ._prepare_for_training ()
168
165
train_args = _TrainingJob ._get_train_args (
Original file line number Diff line number Diff line change @@ -450,7 +450,7 @@ def test_conditional_pytorch_training_model_registration(
450
450
pass
451
451
452
452
453
- def test_training_job_with_debugger (
453
+ def test_training_job_with_debugger_and_profiler (
454
454
sagemaker_session ,
455
455
pipeline_name ,
456
456
role ,
@@ -535,6 +535,9 @@ def test_training_job_with_debugger(
535
535
config ["RuleParameters" ]["rule_to_invoke" ] == rule .rule_parameters ["rule_to_invoke" ]
536
536
)
537
537
assert job_description ["DebugHookConfig" ] == debugger_hook_config ._to_request_dict ()
538
+
539
+ assert job_description ["ProfilingStatus" ] == "Enabled"
540
+ assert job_description ["ProfilerConfig" ]["ProfilingIntervalInMilliseconds" ] == 500
538
541
finally :
539
542
try :
540
543
pipeline .delete ()
Original file line number Diff line number Diff line change 21
21
PropertyMock ,
22
22
)
23
23
24
+ from sagemaker .debugger import ProfilerConfig
24
25
from sagemaker .estimator import Estimator
25
26
from sagemaker .inputs import TrainingInput , TransformInput , CreateModelInput
26
27
from sagemaker .model import Model
@@ -112,6 +113,8 @@ def test_training_step(sagemaker_session):
112
113
role = ROLE ,
113
114
instance_count = 1 ,
114
115
instance_type = "c4.4xlarge" ,
116
+ profiler_config = ProfilerConfig (system_monitor_interval_millis = 500 ),
117
+ rules = [],
115
118
sagemaker_session = sagemaker_session ,
116
119
)
117
120
inputs = TrainingInput (f"s3://{ BUCKET } /train_manifest" )
@@ -144,6 +147,10 @@ def test_training_step(sagemaker_session):
144
147
},
145
148
"RoleArn" : ROLE ,
146
149
"StoppingCondition" : {"MaxRuntimeInSeconds" : 86400 },
150
+ "ProfilerConfig" : {
151
+ "ProfilingIntervalInMilliseconds" : 500 ,
152
+ "S3OutputPath" : f"s3://{ BUCKET } /" ,
153
+ },
147
154
},
148
155
"CacheConfig" : {"Enabled" : True , "ExpireAfter" : "PT1H" },
149
156
}
You can’t perform that action at this time.
0 commit comments