Skip to content

Commit 73a29f1

Browse files
committed
feature: Support profiler config in the pipeline training job step
issue: #2150 test: tox tests/unit
1 parent e08c04e commit 73a29f1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/sagemaker/workflow/steps.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ def arguments(self) -> RequestType:
160160
NOTE: The CreateTrainingJob request is not quite the args list that workflow needs.
161161
The TrainingJobName and ExperimentConfig attributes cannot be included.
162162
"""
163-
self.estimator.disable_profiler = True
164-
self.estimator.profiler_config = None
165-
self.estimator.profiler_rules = None
166163

167164
self.estimator._prepare_for_training()
168165
train_args = _TrainingJob._get_train_args(

tests/unit/sagemaker/workflow/test_steps.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
PropertyMock,
2222
)
2323

24+
from sagemaker.debugger import ProfilerConfig, ProfilerRule
2425
from sagemaker.estimator import Estimator
2526
from sagemaker.inputs import TrainingInput, TransformInput, CreateModelInput
2627
from sagemaker.model import Model
@@ -112,6 +113,8 @@ def test_training_step(sagemaker_session):
112113
role=ROLE,
113114
instance_count=1,
114115
instance_type="c4.4xlarge",
116+
profiler_config=ProfilerConfig(system_monitor_interval_millis=500),
117+
rules=[],
115118
sagemaker_session=sagemaker_session,
116119
)
117120
inputs = TrainingInput(f"s3://{BUCKET}/train_manifest")
@@ -144,6 +147,10 @@ def test_training_step(sagemaker_session):
144147
},
145148
"RoleArn": ROLE,
146149
"StoppingCondition": {"MaxRuntimeInSeconds": 86400},
150+
"ProfilerConfig": {
151+
"ProfilingIntervalInMilliseconds": 500,
152+
"S3OutputPath": f"s3://{BUCKET}/",
153+
}
147154
},
148155
"CacheConfig": {"Enabled": True, "ExpireAfter": "PT1H"},
149156
}

0 commit comments

Comments
 (0)