Skip to content

Commit 1989c7c

Browse files
authored
Merge branch 'master' into remove-shortbread
2 parents b5d749e + 47ae559 commit 1989c7c

File tree

8 files changed

+242
-48
lines changed

8 files changed

+242
-48
lines changed

src/sagemaker/amazon/amazon_estimator.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,16 @@ def fit(
229229
generates a default job name, based on the training image name
230230
and current timestamp.
231231
experiment_config (dict[str, str]): Experiment management configuration.
232-
Dictionary contains three optional keys, 'ExperimentName',
233-
'TrialName', and 'TrialComponentName'
234-
(default: ``None``).
232+
Optionally, the dict can contain three keys:
233+
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
234+
The behavior of setting these keys is as follows:
235+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
236+
automatically created and the job's Trial Component associated with the Trial.
237+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
238+
will be associated with the Trial.
239+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
240+
will be unassociated.
241+
* `TrialComponentDisplayName` is used for display in Studio.
235242
"""
236243
self._prepare_for_training(records, job_name=job_name, mini_batch_size=mini_batch_size)
237244

src/sagemaker/clarify.py

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,16 @@ def _run(
455455
kms_key (str): The ARN of the KMS key that is used to encrypt the
456456
user code file (default: None).
457457
experiment_config (dict[str, str]): Experiment management configuration.
458-
Dictionary contains three optional keys:
458+
Optionally, the dict can contain three keys:
459459
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
460+
The behavior of setting these keys is as follows:
461+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
462+
automatically created and the job's Trial Component associated with the Trial.
463+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
464+
will be associated with the Trial.
465+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
466+
will be unassociated.
467+
* `TrialComponentDisplayName` is used for display in Studio.
460468
"""
461469
analysis_config["methods"]["report"] = {"name": "report", "title": "Analysis Report"}
462470
with tempfile.TemporaryDirectory() as tmpdirname:
@@ -541,8 +549,16 @@ def run_pre_training_bias(
541549
kms_key (str): The ARN of the KMS key that is used to encrypt the
542550
user code file (default: None).
543551
experiment_config (dict[str, str]): Experiment management configuration.
544-
Dictionary contains three optional keys:
552+
Optionally, the dict can contain three keys:
545553
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
554+
The behavior of setting these keys is as follows:
555+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
556+
automatically created and the job's Trial Component associated with the Trial.
557+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
558+
will be associated with the Trial.
559+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
560+
will be unassociated.
561+
* `TrialComponentDisplayName` is used for display in Studio.
546562
""" # noqa E501
547563
analysis_config = data_config.get_config()
548564
analysis_config.update(data_bias_config.get_config())
@@ -604,8 +620,16 @@ def run_post_training_bias(
604620
kms_key (str): The ARN of the KMS key that is used to encrypt the
605621
user code file (default: None).
606622
experiment_config (dict[str, str]): Experiment management configuration.
607-
Dictionary contains three optional keys:
623+
Optionally, the dict can contain three keys:
608624
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
625+
The behavior of setting these keys is as follows:
626+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
627+
automatically created and the job's Trial Component associated with the Trial.
628+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
629+
will be associated with the Trial.
630+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
631+
will be unassociated.
632+
* `TrialComponentDisplayName` is used for display in Studio.
609633
"""
610634
analysis_config = data_config.get_config()
611635
analysis_config.update(data_bias_config.get_config())
@@ -684,8 +708,16 @@ def run_bias(
684708
kms_key (str): The ARN of the KMS key that is used to encrypt the
685709
user code file (default: None).
686710
experiment_config (dict[str, str]): Experiment management configuration.
687-
Dictionary contains three optional keys:
711+
Optionally, the dict can contain three keys:
688712
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
713+
The behavior of setting these keys is as follows:
714+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
715+
automatically created and the job's Trial Component associated with the Trial.
716+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
717+
will be associated with the Trial.
718+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
719+
will be unassociated.
720+
* `TrialComponentDisplayName` is used for display in Studio.
689721
""" # noqa E501
690722
analysis_config = data_config.get_config()
691723
analysis_config.update(bias_config.get_config())
@@ -755,8 +787,16 @@ def run_explainability(
755787
kms_key (str): The ARN of the KMS key that is used to encrypt the
756788
user code file (default: None).
757789
experiment_config (dict[str, str]): Experiment management configuration.
758-
Dictionary contains three optional keys:
790+
Optionally, the dict can contain three keys:
759791
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
792+
The behavior of setting these keys is as follows:
793+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
794+
automatically created and the job's Trial Component associated with the Trial.
795+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
796+
will be associated with the Trial.
797+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
798+
will be unassociated.
799+
* `TrialComponentDisplayName` is used for display in Studio.
760800
"""
761801
analysis_config = data_config.get_config()
762802
predictor_config = model_config.get_predictor_config()

src/sagemaker/estimator.py

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,16 @@ def fit(self, inputs=None, wait=True, logs="All", job_name=None, experiment_conf
674674
job_name (str): Training job name. If not specified, the estimator generates
675675
a default job name based on the training image name and current timestamp.
676676
experiment_config (dict[str, str]): Experiment management configuration.
677-
Dictionary contains three optional keys,
677+
Optionally, the dict can contain three keys:
678678
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
679-
679+
The behavior of setting these keys is as follows:
680+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
681+
automatically created and the job's Trial Component associated with the Trial.
682+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
683+
will be associated with the Trial.
684+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
685+
will be unassociated.
686+
* `TrialComponentDisplayName` is used for display in Studio.
680687
"""
681688
self._prepare_for_training(job_name=job_name)
682689

@@ -1443,10 +1450,17 @@ def start_new(cls, estimator, inputs, experiment_config):
14431450
created by the user.
14441451
inputs (str): Parameters used when called
14451452
:meth:`~sagemaker.estimator.EstimatorBase.fit`.
1446-
experiment_config (dict[str, str]): Experiment management configuration used when called
1447-
:meth:`~sagemaker.estimator.EstimatorBase.fit`. Dictionary contains
1448-
three optional keys, 'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
1449-
1453+
experiment_config (dict[str, str]): Experiment management configuration.
1454+
Optionally, the dict can contain three keys:
1455+
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
1456+
The behavior of setting these keys is as follows:
1457+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
1458+
automatically created and the job's Trial Component associated with the Trial.
1459+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
1460+
will be associated with the Trial.
1461+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
1462+
will be unassociated.
1463+
* `TrialComponentDisplayName` is used for display in Studio.
14501464
Returns:
14511465
sagemaker.estimator._TrainingJob: Constructed object that captures
14521466
all information about the started training job.
@@ -1465,9 +1479,17 @@ def _get_train_args(cls, estimator, inputs, experiment_config):
14651479
created by the user.
14661480
inputs (str): Parameters used when called
14671481
:meth:`~sagemaker.estimator.EstimatorBase.fit`.
1468-
experiment_config (dict[str, str]): Experiment management configuration used when called
1469-
:meth:`~sagemaker.estimator.EstimatorBase.fit`. Dictionary contains
1470-
three optional keys, 'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
1482+
experiment_config (dict[str, str]): Experiment management configuration.
1483+
Optionally, the dict can contain three keys:
1484+
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
1485+
The behavior of setting these keys is as follows:
1486+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
1487+
automatically created and the job's Trial Component associated with the Trial.
1488+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
1489+
will be associated with the Trial.
1490+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
1491+
will be unassociated.
1492+
* `TrialComponentDisplayName` is used for display in Studio.
14711493
14721494
Returns:
14731495
Dict: dict for `sagemaker.session.Session.train` method

src/sagemaker/processing.py

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,16 @@ def run(
161161
job_name (str): Processing job name. If not specified, the processor generates
162162
a default job name, based on the base job name and current timestamp.
163163
experiment_config (dict[str, str]): Experiment management configuration.
164-
Dictionary contains three optional keys:
164+
Optionally, the dict can contain three keys:
165165
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
166+
The behavior of setting these keys is as follows:
167+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
168+
automatically created and the job's Trial Component associated with the Trial.
169+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
170+
will be associated with the Trial.
171+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
172+
will be unassociated.
173+
* `TrialComponentDisplayName` is used for display in Studio.
166174
kms_key (str): The ARN of the KMS key that is used to encrypt the
167175
user code file (default: None).
168176
@@ -514,10 +522,16 @@ def run(
514522
job_name (str): Processing job name. If not specified, the processor generates
515523
a default job name, based on the base job name and current timestamp.
516524
experiment_config (dict[str, str]): Experiment management configuration.
517-
Dictionary contains three optional keys:
525+
Optionally, the dict can contain three keys:
518526
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
519-
kms_key (str): The ARN of the KMS key that is used to encrypt the
520-
user code file (default: None).
527+
The behavior of setting these keys is as follows:
528+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
529+
automatically created and the job's Trial Component associated with the Trial.
530+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
531+
will be associated with the Trial.
532+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
533+
will be unassociated.
534+
* `TrialComponentDisplayName` is used for display in Studio.
521535
"""
522536
normalized_inputs, normalized_outputs = self._normalize_args(
523537
job_name=job_name,
@@ -728,8 +742,16 @@ def start_new(cls, processor, inputs, outputs, experiment_config):
728742
outputs (list[:class:`~sagemaker.processing.ProcessingOutput`]): A list of
729743
:class:`~sagemaker.processing.ProcessingOutput` objects.
730744
experiment_config (dict[str, str]): Experiment management configuration.
731-
Dictionary contains three optional keys:
745+
Optionally, the dict can contain three keys:
732746
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
747+
The behavior of setting these keys is as follows:
748+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
749+
automatically created and the job's Trial Component associated with the Trial.
750+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
751+
will be associated with the Trial.
752+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
753+
will be unassociated.
754+
* `TrialComponentDisplayName` is used for display in Studio.
733755
734756
Returns:
735757
:class:`~sagemaker.processing.ProcessingJob`: The instance of ``ProcessingJob`` created
@@ -766,8 +788,16 @@ def _get_process_args(cls, processor, inputs, outputs, experiment_config):
766788
outputs (list[:class:`~sagemaker.processing.ProcessingOutput`]): A list of
767789
:class:`~sagemaker.processing.ProcessingOutput` objects.
768790
experiment_config (dict[str, str]): Experiment management configuration.
769-
Dictionary contains three optional keys:
791+
Optionally, the dict can contain three keys:
770792
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
793+
The behavior of setting these keys is as follows:
794+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
795+
automatically created and the job's Trial Component associated with the Trial.
796+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
797+
will be associated with the Trial.
798+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
799+
will be unassociated.
800+
* `TrialComponentDisplayName` is used for display in Studio.
771801
772802
Returns:
773803
Dict: dict for `sagemaker.session.Session.process` method
@@ -1546,8 +1576,16 @@ def run( # type: ignore[override]
15461576
job_name (str): Processing job name. If not specified, the processor generates
15471577
a default job name, based on the base job name and current timestamp.
15481578
experiment_config (dict[str, str]): Experiment management configuration.
1549-
Dictionary contains three optional keys:
1579+
Optionally, the dict can contain three keys:
15501580
'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
1581+
The behavior of setting these keys is as follows:
1582+
* If `ExperimentName` is supplied but `TrialName` is not a Trial will be
1583+
automatically created and the job's Trial Component associated with the Trial.
1584+
* If `TrialName` is supplied and the Trial already exists the job's Trial Component
1585+
will be associated with the Trial.
1586+
* If both `ExperimentName` and `TrialName` are not supplied the trial component
1587+
will be unassociated.
1588+
* `TrialComponentDisplayName` is used for display in Studio.
15511589
kms_key (str): The ARN of the KMS key that is used to encrypt the
15521590
user code file (default: None).
15531591
"""

0 commit comments

Comments
 (0)