@@ -160,7 +160,7 @@ def __init__(
160160 instance_count (int): Number of Amazon EC2 instances to use
161161 for training. Required if instance_groups is not set.
162162 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
164164 not set.
165165 volume_size (int): Size in GB of the EBS volume to use for
166166 storing input data during training (default: 30). Must be large
@@ -235,7 +235,6 @@ def __init__(
235235 use_spot_instances (bool): Specifies whether to use SageMaker
236236 Managed Spot instances for training. If enabled then the
237237 ``max_wait`` arg should also be set.
238-
239238 More information:
240239 https://docs.aws.amazon.com/sagemaker/latest/dg/model-managed-spot-training.html
241240 (default: ``False``).
@@ -313,40 +312,38 @@ def __init__(
313312 when training on Amazon SageMaker. If 'git_config' is provided,
314313 'source_dir' should be a relative location to a directory in the Git
315314 repo.
315+ With the following GitHub repo directory structure:
316316
317- .. admonition:: Example
318-
319- With the following GitHub repo directory structure:
317+ .. code::
320318
321- >>> |----- README.md
322- >>> |----- src
323- >>> |----- train.py
324- >>> |----- test.py
319+ |----- README.md
320+ |----- src
321+ |----- train.py
322+ |----- test.py
325323
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'.
329327 git_config (dict[str, str]): Git configurations used for cloning
330328 files, including ``repo``, ``branch``, ``commit``,
331329 ``2FA_enabled``, ``username``, ``password``, and ``token``. The
332330 ``repo`` field is required. All other fields are optional.
333331 ``repo`` specifies the Git repository where your training script
334332 is stored. If you don't provide ``branch``, the default value
335333 '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:
337335
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
345337
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+ }
349343
344+ results in cloning the repo specified in 'repo', then
345+ checking out the 'master' branch, and checking out the specified
346+ commit.
350347 ``2FA_enabled``, ``username``, ``password``, and ``token`` are
351348 used for authentication. For GitHub (or other Git) accounts, set
352349 ``2FA_enabled`` to 'True' if two-factor authentication is
@@ -427,10 +424,25 @@ def __init__(
427424 >>> |------ virtual-env
428425
429426 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*.
434446 """
435447 instance_count = renamed_kwargs (
436448 "train_instance_count" , "instance_count" , instance_count , kwargs
@@ -2418,10 +2430,25 @@ def __init__(
24182430 >>> |------ virtual-env
24192431
24202432 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*.
24252452 """
24262453 self .image_uri = image_uri
24272454 self ._hyperparameters = hyperparameters .copy () if hyperparameters else {}
0 commit comments