Skip to content

Commit b538525

Browse files
author
Judy Heflin
authored
doc: JumpStart Utility Doc Update (#3866)
1 parent 0549961 commit b538525

12 files changed

+328
-126
lines changed

doc/api/inference/deserializers.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Deserializers
55
:members:
66
:undoc-members:
77
:show-inheritance:
8+

doc/api/inference/model.rst

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Model
77
:show-inheritance:
88
:inherited-members:
99

10+
.. autoclass:: sagemaker.jumpstart.model.JumpStartModel
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
:inherited-members:
15+
1016
.. autoclass:: sagemaker.model.FrameworkModel
1117
:members:
1218
:undoc-members:

doc/api/inference/serializers.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Serializers
55
:members:
66
:undoc-members:
77
:show-inheritance:
8+

doc/api/training/estimators.rst

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ A high level interface for SageMaker training
1717
:show-inheritance:
1818
:inherited-members:
1919

20+
.. autoclass:: sagemaker.jumpstart.estimator.JumpStartEstimator
21+
:members:
22+
:undoc-members:
23+
:show-inheritance:
24+
:inherited-members:
25+
2026
.. autoclass:: sagemaker.estimator.Framework
2127
:members:
2228
:undoc-members:

doc/api/utility/accept_types.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Accept Types
2+
------------
3+
4+
.. automodule:: sagemaker.accept_types
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
:private-members:

doc/api/utility/content_types.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Content Types
2+
-------------
3+
4+
.. automodule:: sagemaker.content_types
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
:private-members:

doc/api/utility/hyperparameters.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Hyperparameters
55
:members:
66
:undoc-members:
77
:show-inheritance:
8+

doc/api/utility/instance_types.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Instance Types
2+
--------------
3+
4+
.. automodule:: sagemaker.instance_types
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
:private-members:
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Metric Definitions
2+
------------------
3+
4+
.. automodule:: sagemaker.metric_definitions
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
:private-members:

doc/overview.rst

+248-79
Large diffs are not rendered by default.

src/sagemaker/jumpstart/estimator.py

+18-25
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ def __init__(
340340
when training on Amazon SageMaker. If 'git_config' is provided,
341341
'source_dir' should be a relative location to a directory in the Git
342342
repo.
343+
(Default: None).
343344
344345
.. admonition:: Example
345346
@@ -353,7 +354,6 @@ def __init__(
353354
if you need 'train.py'
354355
as the entry point and 'test.py' as the training source code, you can assign
355356
entry_point='train.py', source_dir='src'.
356-
(Default: None).
357357
git_config (Optional[dict[str, str]]): Git configurations used for cloning
358358
files, including ``repo``, ``branch``, ``commit``,
359359
``2FA_enabled``, ``username``, ``password`` and ``token``. The
@@ -363,18 +363,6 @@ def __init__(
363363
'master' is used. If you don't provide ``commit``, the latest
364364
commit in the specified branch is used.
365365
366-
.. admonition:: Example
367-
368-
The following config:
369-
370-
>>> git_config = {'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
371-
>>> 'branch': 'test-branch-git-config',
372-
>>> 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'}
373-
374-
results in cloning the repo specified in 'repo', then
375-
checking out the 'master' branch, and checking out the specified
376-
commit.
377-
378366
``2FA_enabled``, ``username``, ``password`` and ``token`` are
379367
used for authentication. For GitHub (or other Git) accounts, set
380368
``2FA_enabled`` to 'True' if two-factor authentication is
@@ -405,6 +393,17 @@ def __init__(
405393
the SageMaker Python SDK attempts to use either the CodeCommit
406394
credential helper or local credential storage for authentication.
407395
(Default: None).
396+
397+
.. admonition:: Example
398+
The following config:
399+
400+
>>> git_config = {'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
401+
>>> 'branch': 'test-branch-git-config',
402+
>>> 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'}
403+
404+
results in cloning the repo specified in 'repo', then
405+
checking out the 'master' branch, and checking out the specified
406+
commit.
408407
container_log_level (Optional[Union[int, PipelineVariable]]): The log level to use
409408
within the container. Valid values are defined in the Python logging module.
410409
(Default: None).
@@ -420,8 +419,9 @@ def __init__(
420419
must point to a file located at the root of ``source_dir``.
421420
If 'git_config' is provided, 'entry_point' should be
422421
a relative location to the Python source file in the Git repo.
422+
(Default: None).
423423
424-
Example:
424+
.. admonition:: Example
425425
With the following GitHub repo directory structure:
426426
427427
>>> |----- README.md
@@ -430,18 +430,16 @@ def __init__(
430430
>>> |----- test.py
431431
432432
You can assign entry_point='src/train.py'.
433-
434-
(Default: None).
435433
dependencies (Optional[list[str]]): A list of absolute or relative paths to directories
436434
with any additional libraries that should be exported
437435
to the container. The library folders are
438436
copied to SageMaker in the same folder where the entrypoint is
439437
copied. If 'git_config' is provided, 'dependencies' should be a
440438
list of relative locations to directories with any additional
441-
libraries needed in the Git repo.
439+
libraries needed in the Git repo. This is not supported with "local code"
440+
in Local Mode. (Default: None).
442441
443442
.. admonition:: Example
444-
445443
The following Estimator call:
446444
447445
>>> Estimator(entry_point='train.py',
@@ -455,9 +453,6 @@ def __init__(
455453
>>> |------ train.py
456454
>>> |------ common
457455
>>> |------ virtual-env
458-
459-
This is not supported with "local code" in Local Mode.
460-
(Default: None).
461456
instance_groups (Optional[list[:class:`sagemaker.instance_group.InstanceGroup`]]):
462457
A list of ``InstanceGroup`` objects for launching a training job with a
463458
heterogeneous cluster. For example:
@@ -475,8 +470,7 @@ def __init__(
475470
through the SageMaker generic and framework estimator classes, see
476471
`Train Using a Heterogeneous Cluster
477472
<https://docs.aws.amazon.com/sagemaker/latest/dg/train-heterogeneous-cluster.html>`_
478-
in the *Amazon SageMaker developer guide*.
479-
(Default: None).
473+
in the *Amazon SageMaker developer guide*. (Default: None).
480474
training_repository_access_mode (Optional[str]): Specifies how SageMaker accesses the
481475
Docker image that contains the training algorithm (Default: None).
482476
Set this to one of the following values:
@@ -797,7 +791,7 @@ def deploy(
797791
when training on Amazon SageMaker. If 'git_config' is provided,
798792
'source_dir' should be a relative location to a directory in the Git repo.
799793
If the directory points to S3, no code is uploaded and the S3 location
800-
is used instead.
794+
is used instead. (Default: None).
801795
802796
.. admonition:: Example
803797
@@ -809,7 +803,6 @@ def deploy(
809803
>>> |----- test.py
810804
811805
You can assign entry_point='inference.py', source_dir='src'.
812-
(Default: None).
813806
code_location (Optional[str]): Name of the S3 bucket where custom code is
814807
uploaded (Default: None). If not specified, the default bucket
815808
created by ``sagemaker.session.Session`` is used. (Default: None).

src/sagemaker/jumpstart/model.py

+15-22
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def __init__(
138138
when training on Amazon SageMaker. If 'git_config' is provided,
139139
'source_dir' should be a relative location to a directory in the Git repo.
140140
If the directory points to S3, no code is uploaded and the S3 location
141-
is used instead.
141+
is used instead. (Default: None).
142142
143143
.. admonition:: Example
144144
@@ -150,7 +150,6 @@ def __init__(
150150
>>> |----- test.py
151151
152152
You can assign entry_point='inference.py', source_dir='src'.
153-
(Default: None).
154153
code_location (Optional[str]): Name of the S3 bucket where custom code is
155154
uploaded (Default: None). If not specified, the default bucket
156155
created by ``sagemaker.session.Session`` is used. (Default: None).
@@ -159,9 +158,9 @@ def __init__(
159158
model hosting. (Default: None). If ``source_dir`` is specified, then ``entry_point``
160159
must point to a file located at the root of ``source_dir``.
161160
If 'git_config' is provided, 'entry_point' should be
162-
a relative location to the Python source file in the Git repo.
161+
a relative location to the Python source file in the Git repo. (Default: None).
163162
164-
Example:
163+
.. admonition:: Example
165164
With the following GitHub repo directory structure:
166165
167166
>>> |----- README.md
@@ -170,8 +169,6 @@ def __init__(
170169
>>> |----- test.py
171170
172171
You can assign entry_point='src/inference.py'.
173-
174-
(Default: None).
175172
container_log_level (Optional[Union[int, PipelineVariable]]): Log level to use
176173
within the container. Valid values are defined in the Python
177174
logging module. (Default: None).
@@ -183,7 +180,8 @@ def __init__(
183180
list of relative locations to directories with any additional
184181
libraries needed in the Git repo. If the ```source_dir``` points
185182
to S3, code will be uploaded and the S3 location will be used
186-
instead.
183+
instead. This is not supported with "local code" in Local Mode.
184+
(Default: None).
187185
188186
.. admonition:: Example
189187
@@ -200,9 +198,6 @@ def __init__(
200198
>>> |------ inference.py
201199
>>> |------ common
202200
>>> |------ virtual-env
203-
204-
This is not supported with "local code" in Local Mode.
205-
(Default: None).
206201
git_config (Optional[dict[str, str]]): Git configurations used for cloning
207202
files, including ``repo``, ``branch``, ``commit``,
208203
``2FA_enabled``, ``username``, ``password`` and ``token``. The
@@ -212,18 +207,6 @@ def __init__(
212207
'master' is used. If you don't provide ``commit``, the latest
213208
commit in the specified branch is used.
214209
215-
.. admonition:: Example
216-
217-
The following config:
218-
219-
>>> git_config = {'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
220-
>>> 'branch': 'test-branch-git-config',
221-
>>> 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'}
222-
223-
results in cloning the repo specified in 'repo', then
224-
checking out the 'master' branch, and checking out the specified
225-
commit.
226-
227210
``2FA_enabled``, ``username``, ``password`` and ``token`` are
228211
used for authentication. For GitHub (or other Git) accounts, set
229212
``2FA_enabled`` to 'True' if two-factor authentication is
@@ -255,6 +238,16 @@ def __init__(
255238
credential helper or local credential storage for authentication.
256239
(Default: None).
257240
241+
.. admonition:: Example
242+
243+
The following config results in cloning the repo specified in 'repo', then
244+
checking out the 'master' branch, and checking out the specified
245+
commit.
246+
247+
>>> git_config = {'repo': 'https://github.com/aws/sagemaker-python-sdk.git',
248+
>>> 'branch': 'test-branch-git-config',
249+
>>> 'commit': '329bfcf884482002c05ff7f44f62599ebc9f445a'}
250+
258251
Raises:
259252
ValueError: If the model ID is not recognized by JumpStart.
260253
"""

0 commit comments

Comments
 (0)