@@ -160,7 +160,7 @@ def __init__(
160
160
instance_count (int): Number of Amazon EC2 instances to use
161
161
for training. Required if instance_groups is not set.
162
162
instance_type (str): Type of EC2 instance to use for training,
163
- for example, 'ml.c4.xlarge'. Required if instance_groups is
163
+ for example, `` 'ml.c4.xlarge'`` . Required if instance_groups is
164
164
not set.
165
165
volume_size (int): Size in GB of the EBS volume to use for
166
166
storing input data during training (default: 30). Must be large
@@ -235,7 +235,6 @@ def __init__(
235
235
use_spot_instances (bool): Specifies whether to use SageMaker
236
236
Managed Spot instances for training. If enabled then the
237
237
``max_wait`` arg should also be set.
238
-
239
238
More information:
240
239
https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html
241
240
(default: ``False``).
@@ -313,40 +312,38 @@ def __init__(
313
312
when training on Amazon SageMaker. If 'git_config' is provided,
314
313
'source_dir' should be a relative location to a directory in the Git
315
314
repo.
315
+ With the following GitHub repo directory structure:
316
316
317
- .. admonition:: Example
318
-
319
- With the following GitHub repo directory structure:
317
+ .. code::
320
318
321
- >>> |----- README.md
322
- >>> |----- src
323
- >>> |----- train.py
324
- >>> |----- test.py
319
+ |----- README.md
320
+ |----- src
321
+ |----- train.py
322
+ |----- test.py
325
323
326
- if you need 'train.py' as the entry point and 'test.py' as
327
- the training source code, you can assign
328
- entry_point='train.py' and source_dir='src'.
324
+ if you need 'train.py' as the entry point and 'test.py' as
325
+ the training source code, you can assign
326
+ entry_point='train.py' and source_dir='src'.
329
327
git_config (dict[str, str]): Git configurations used for cloning
330
328
files, including ``repo``, ``branch``, ``commit``,
331
329
``2FA_enabled``, ``username``, ``password``, and ``token``. The
332
330
``repo`` field is required. All other fields are optional.
333
331
``repo`` specifies the Git repository where your training script
334
332
is stored. If you don't provide ``branch``, the default value
335
333
'master' is used. If you don't provide ``commit``, the latest
336
- commit in the specified branch is used.
334
+ commit in the specified branch is used. For example, the following config:
337
335
338
- .. admonition:: Example
339
-
340
- The following config:
341
-
342
- >>> git_config = {'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
343
- >>> 'branch': 'test-branch-git-config',
344
- >>> 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'}
336
+ .. code:: python
345
337
346
- results in cloning the repo specified in 'repo', then
347
- checking out the 'master' branch, and checking out the specified
348
- commit.
338
+ git_config = {
339
+ 'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
340
+ 'branch': 'test-branch-git-config',
341
+ 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'
342
+ }
349
343
344
+ results in cloning the repo specified in 'repo', then
345
+ checking out the 'master' branch, and checking out the specified
346
+ commit.
350
347
``2FA_enabled``, ``username``, ``password``, and ``token`` are
351
348
used for authentication. For GitHub (or other Git) accounts, set
352
349
``2FA_enabled`` to 'True' if two-factor authentication is
@@ -427,10 +424,25 @@ def __init__(
427
424
>>> |------ virtual-env
428
425
429
426
This is not supported with "local code" in Local Mode.
430
- instance_groups (list[InstanceGroup]): Optional. List of InstanceGroup
431
- for specifying different instance groups for heterogeneous cluster.
432
- For example: [sagemaker.InstanceGroup('worker','ml.p3dn.24xlarge',64),
433
- sagemaker.InstanceGroup('server','ml.c5n.18xlarge',64)]
427
+ instance_groups (list[:class:`sagemaker.instance_group.InstanceGroup`]):
428
+ Optional. A list of ``InstanceGroup`` objects
429
+ for launching a training job with a heterogeneous cluster.
430
+ For example:
431
+
432
+ .. code:: python
433
+
434
+ instance_groups=[
435
+ sagemaker.InstanceGroup(
436
+ 'instance_group_name_1', 'ml.p3dn.24xlarge', 64),
437
+ sagemaker.InstanceGroup(
438
+ 'instance_group_name_2', 'ml.c5n.18xlarge', 64)]
439
+
440
+ For instructions on how to use ``InstanceGroup`` objects
441
+ to configure a heterogeneous cluster
442
+ through the SageMaker generic and framework estimator classes, see
443
+ `Train Using a Heterogeneous Cluster
444
+ <https://docs.aws.amazon.com/sagemaker/latest/dg/train-heterogeneous-cluster.html>`_
445
+ in the *Amazon SageMaker developer guide*.
434
446
"""
435
447
instance_count = renamed_kwargs (
436
448
"train_instance_count" , "instance_count" , instance_count , kwargs
@@ -2418,10 +2430,25 @@ def __init__(
2418
2430
>>> |------ virtual-env
2419
2431
2420
2432
This is not supported with "local code" in Local Mode.
2421
- instance_groups (list[InstanceGroup]): Optional. List of InstanceGroup
2422
- for specifying different instance groups for heterogeneous cluster.
2423
- For example: [sagemaker.InstanceGroup('worker','ml.p3dn.24xlarge',64),
2424
- sagemaker.InstanceGroup('server','ml.c5n.18xlarge',64)]
2433
+ instance_groups (list[:class:`sagemaker.instance_group.InstanceGroup`]):
2434
+ Optional. A list of ``InstanceGroup`` objects
2435
+ for launching a training job with a heterogeneous cluster.
2436
+ For example:
2437
+
2438
+ .. code:: python
2439
+
2440
+ instance_groups=[
2441
+ sagemaker.InstanceGroup(
2442
+ 'instance_group_name_1', 'ml.p3dn.24xlarge', 64),
2443
+ sagemaker.InstanceGroup(
2444
+ 'instance_group_name_2', 'ml.c5n.18xlarge', 64)]
2445
+
2446
+ For instructions on how to use ``InstanceGroup`` objects
2447
+ to configure a heterogeneous cluster
2448
+ through the SageMaker generic and framework estimator classes, see
2449
+ `Train Using a Heterogeneous Cluster
2450
+ <https://docs.aws.amazon.com/sagemaker/latest/dg/train-heterogeneous-cluster.html>`_
2451
+ in the *Amazon SageMaker developer guide*.
2425
2452
"""
2426
2453
self .image_uri = image_uri
2427
2454
self ._hyperparameters = hyperparameters .copy () if hyperparameters else {}
0 commit comments