Skip to content

Commit 2d38df9

Browse files
chuyang-dengChuyang Denglaurenyu
authored
doc: specify S3 source_dir needs to point to a tar file (#1498)
* doc: specify S3 source_dir needs to point to a tar file * update source_dir doc * add quotes Co-authored-by: Chuyang Deng <[email protected]> Co-authored-by: Lauren Yu <[email protected]>
1 parent 0260228 commit 2d38df9

File tree

8 files changed

+47
-37
lines changed

8 files changed

+47
-37
lines changed

src/sagemaker/estimator.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,12 +1478,14 @@ def __init__(
14781478
>>> |----- test.py
14791479
14801480
You can assign entry_point='src/train.py'.
1481-
source_dir (str): Path (absolute, relative, or an S3 URI) to a directory with
1482-
any other training source code dependencies aside from the entry
1483-
point file (default: None). Structure within this directory are
1484-
preserved when training on Amazon SageMaker. If 'git_config' is
1485-
provided, 'source_dir' should be a relative location to a
1486-
directory in the Git repo. .. admonition:: Example
1481+
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
1482+
with any other training source code dependencies aside from the entry
1483+
point file (default: None). If ``source_dir`` is an S3 URI, it must
1484+
point to a tar.gz file. Structure within this directory are preserved
1485+
when training on Amazon SageMaker. If 'git_config' is provided,
1486+
'source_dir' should be a relative location to a directory in the Git
1487+
repo.
1488+
.. admonition:: Example
14871489
14881490
With the following GitHub repo directory structure:
14891491

src/sagemaker/model.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -659,13 +659,14 @@ def __init__(
659659
>>> |----- test.py
660660
661661
You can assign entry_point='src/inference.py'.
662-
source_dir (str): Path (absolute or relative) to a directory with
663-
any other training source code dependencies aside from the entry
664-
point file (default: None). Structure within this directory will
665-
be preserved when training on SageMaker. If 'git_config' is
666-
provided, 'source_dir' should be a relative location to a
667-
directory in the Git repo. If the directory points to S3, no
668-
code will be uploaded and the S3 location will be used instead.
662+
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
663+
with any other training source code dependencies aside from the entry
664+
point file (default: None). If ``source_dir`` is an S3 URI, it must
665+
point to a tar.gz file. Structure within this directory are preserved
666+
when training on Amazon SageMaker. If 'git_config' is provided,
667+
'source_dir' should be a relative location to a directory in the Git repo.
668+
If the directory points to S3, no code will be uploaded and the S3 location
669+
will be used instead.
669670
.. admonition:: Example
670671
671672
With the following GitHub repo directory structure:

src/sagemaker/mxnet/estimator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ def __init__(
7171
entry_point (str): Path (absolute or relative) to the Python source
7272
file which should be executed as the entry point to training.
7373
This should be compatible with either Python 2.7 or Python 3.5.
74-
source_dir (str): Path (absolute or relative) to a directory with
75-
any other training source code dependencies aside from the entry
76-
point file (default: None). Structure within this directory are
77-
preserved when training on Amazon SageMaker.
74+
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
75+
with any other training source code dependencies aside from the entry
76+
point file (default: None). If ``source_dir`` is an S3 URI, it must
77+
point to a tar.gz file. Structure within this directory are preserved
78+
when training on Amazon SageMaker.
7879
hyperparameters (dict): Hyperparameters that will be used for
7980
training (default: None). The hyperparameters are made
8081
accessible as a dict[str, str] to the training code on

src/sagemaker/pytorch/estimator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ def __init__(
6868
entry_point (str): Path (absolute or relative) to the Python source
6969
file which should be executed as the entry point to training.
7070
This should be compatible with either Python 2.7 or Python 3.5.
71-
source_dir (str): Path (absolute or relative) to a directory with
72-
any other training source code dependencies aside from the entry
73-
point file (default: None). Structure within this directory are
74-
preserved when training on Amazon SageMaker.
71+
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
72+
with any other training source code dependencies aside from the entry
73+
point file (default: None). If ``source_dir`` is an S3 URI, it must
74+
point to a tar.gz file. Structure within this directory are preserved
75+
when training on Amazon SageMaker.
7576
hyperparameters (dict): Hyperparameters that will be used for
7677
training (default: None). The hyperparameters are made
7778
accessible as a dict[str, str] to the training code on

src/sagemaker/rl/estimator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ def __init__(
109109
framework (sagemaker.rl.RLFramework): Framework (MXNet or
110110
TensorFlow) you want to be used as a toolkit backed for
111111
reinforcement learning training.
112-
source_dir (str): Path (absolute or relative) to a directory with
113-
any other training source code dependencies aside from the entry
114-
point file (default: None). Structure within this directory is
115-
preserved when training on Amazon SageMaker.
112+
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
113+
with any other training source code dependencies aside from the entry
114+
point file (default: None). If ``source_dir`` is an S3 URI, it must
115+
point to a tar.gz file. Structure within this directory are preserved
116+
when training on Amazon SageMaker.
116117
hyperparameters (dict): Hyperparameters that will be used for
117118
training (default: None). The hyperparameters are made
118119
accessible as a dict[str, str] to the training code on

src/sagemaker/sklearn/estimator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ def __init__(
6969
framework_version (str): Scikit-learn version you want to use for
7070
executing your model training code. List of supported versions
7171
https://github.com/aws/sagemaker-python-sdk#sklearn-sagemaker-estimators
72-
source_dir (str): Path (absolute or relative) to a directory with
73-
any other training source code dependencies aside from the entry
74-
point file (default: None). Structure within this directory are
75-
preserved when training on Amazon SageMaker.
72+
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
73+
with any other training source code dependencies aside from the entry
74+
point file (default: None). If ``source_dir`` is an S3 URI, it must
75+
point to a tar.gz file. Structure within this directory are preserved
76+
when training on Amazon SageMaker.
7677
hyperparameters (dict): Hyperparameters that will be used for
7778
training (default: None). The hyperparameters are made
7879
accessible as a dict[str, str] to the training code on

src/sagemaker/tensorflow/estimator.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,12 @@ def create_model(
567567
should be executed as the entry point to training. If not specified and
568568
``endpoint_type`` is 'tensorflow-serving', no entry point is used. If
569569
``endpoint_type`` is also ``None``, then the training entry point is used.
570-
source_dir (str): Path (absolute or relative) to a directory with any other serving
571-
source code dependencies aside from the entry point file. If not specified and
572-
``endpoint_type`` is 'tensorflow-serving', no source_dir is used. If
573-
``endpoint_type`` is also ``None``, then the model source directory from training
574-
is used.
570+
source_dir (str): Path (absolute or relative or an S3 URI ) to a directory with any
571+
other serving source code dependencies aside from the entry point file. If
572+
``source_dir`` is an S3 URI, it must point to a tar.gz file. If not specified
573+
and ``endpoint_type`` is 'tensorflow-serving', no source_dir is used. If
574+
``endpoint_type`` is also ``None``, then the model source directory from
575+
training is used.
575576
dependencies (list[str]): A list of paths to directories (absolute or relative) with
576577
any additional libraries that will be exported to the container.
577578
If not specified and ``endpoint_type`` is 'tensorflow-serving', ``dependencies`` is

src/sagemaker/xgboost/estimator.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ def __init__(
7575
framework_version (str): XGBoost version you want to use for executing your model
7676
training code. List of supported versions
7777
https://github.com/aws/sagemaker-python-sdk#xgboost-sagemaker-estimators
78-
source_dir (str): Path (absolute or relative) to a directory with any other training
79-
source code dependencies aside from the entry point file (default: None).
80-
Structure within this directory are preserved when training on Amazon SageMaker.
78+
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
79+
with any other training source code dependencies aside from the entry
80+
point file (default: None). If ``source_dir`` is an S3 URI, it must
81+
point to a tar.gz file. Structure within this directory are preserved
82+
when training on Amazon SageMaker.
8183
hyperparameters (dict): Hyperparameters that will be used for training (default: None).
8284
The hyperparameters are made accessible as a dict[str, str] to the training code
8385
on SageMaker. For convenience, this accepts other types for keys and values, but

0 commit comments

Comments
 (0)