Skip to content

Commit a7b539a

Browse files
authored
doc: clarify that entry_point must be in the root of source_dir (if applicable) (#1528)
1 parent af3b54e commit a7b539a

File tree

15 files changed

+64
-46
lines changed

15 files changed

+64
-46
lines changed

src/sagemaker/chainer/estimator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def __init__(
7676
Args:
7777
entry_point (str): Path (absolute or relative) to the Python source
7878
file which should be executed as the entry point to training.
79-
This should be compatible with either Python 2.7 or Python 3.5.
79+
If ``source_dir`` is specified, then ``entry_point``
80+
must point to a file located at the root of ``source_dir``.
8081
use_mpi (bool): If true, entry point is run as an MPI script. By
8182
default, the Chainer Framework runs the entry point with
8283
'mpirun' if more than one instance is used.
@@ -186,11 +187,14 @@ def create_model(
186187
role from the Estimator will be used.
187188
vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on
188189
the model. Default: use subnets and security groups from this Estimator.
190+
189191
* 'Subnets' (list[str]): List of subnet ids.
190192
* 'SecurityGroupIds' (list[str]): List of security group ids.
193+
191194
entry_point (str): Path (absolute or relative) to the local Python source file which
192-
should be executed as the entry point to training. If not specified, the training
193-
entry point is used.
195+
should be executed as the entry point to training. If ``source_dir`` is specified,
196+
then ``entry_point`` must point to a file located at the root of ``source_dir``.
197+
If not specified, the training entry point is used.
194198
source_dir (str): Path (absolute or relative) to a directory with any other serving
195199
source code dependencies aside from the entry point file.
196200
If not specified, the model source directory from training is used.

src/sagemaker/chainer/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def __init__(
8585
might use the IAM role, if it needs to access an AWS resource.
8686
entry_point (str): Path (absolute or relative) to the Python source
8787
file which should be executed as the entry point to model
88-
hosting. This should be compatible with either Python 2.7 or
89-
Python 3.5.
88+
hosting. If ``source_dir`` is specified, then ``entry_point``
89+
must point to a file located at the root of ``source_dir``.
9090
image (str): A Docker image URI (default: None). If not specified, a
9191
default image for Chainer will be used.
9292
py_version (str): Python version you want to use for executing your

src/sagemaker/estimator.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,10 +1467,11 @@ def __init__(
14671467
Args:
14681468
entry_point (str): Path (absolute or relative) to the local Python
14691469
source file which should be executed as the entry point to
1470-
training. This should be compatible with either Python 2.7 or
1471-
Python 3.5. If 'git_config' is provided, 'entry_point' should be
1470+
training. If ``source_dir`` is specified, then ``entry_point``
1471+
must point to a file located at the root of ``source_dir``.
1472+
If 'git_config' is provided, 'entry_point' should be
14721473
a relative location to the Python source file in the Git repo.
1473-
Example
1474+
Example:
14741475
14751476
With the following GitHub repo directory structure:
14761477
@@ -1487,6 +1488,7 @@ def __init__(
14871488
when training on Amazon SageMaker. If 'git_config' is provided,
14881489
'source_dir' should be a relative location to a directory in the Git
14891490
repo.
1491+
14901492
.. admonition:: Example
14911493
14921494
With the following GitHub repo directory structure:
@@ -1968,8 +1970,9 @@ def transformer(
19681970
volume_kms_key (str): Optional. KMS key ID for encrypting the volume
19691971
attached to the ML compute instance (default: None).
19701972
entry_point (str): Path (absolute or relative) to the local Python source file which
1971-
should be executed as the entry point to training. If not specified, the training
1972-
entry point is used.
1973+
should be executed as the entry point to training. If ``source_dir`` is specified,
1974+
then ``entry_point`` must point to a file located at the root of ``source_dir``.
1975+
If not specified, the training entry point is used.
19731976
vpc_config_override (dict[str, list[str]]): Optional override for
19741977
the VpcConfig set on the model.
19751978
Default: use subnets and security groups from this Estimator.

src/sagemaker/model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,11 @@ def __init__(
648648
resources on your behalf.
649649
entry_point (str): Path (absolute or relative) to the Python source
650650
file which should be executed as the entry point to model
651-
hosting. This should be compatible with either Python 2.7 or
652-
Python 3.5. If 'git_config' is provided, 'entry_point' should be
651+
hosting. If ``source_dir`` is specified, then ``entry_point``
652+
must point to a file located at the root of ``source_dir``.
653+
If 'git_config' is provided, 'entry_point' should be
653654
a relative location to the Python source file in the Git repo.
654-
Example
655+
Example:
655656
656657
With the following GitHub repo directory structure:
657658

src/sagemaker/mxnet/estimator.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def __init__(
7171
Args:
7272
entry_point (str): Path (absolute or relative) to the Python source
7373
file which should be executed as the entry point to training.
74-
This should be compatible with either Python 2.7 or Python 3.5.
74+
If ``source_dir`` is specified, then ``entry_point``
75+
must point to a file located at the root of ``source_dir``.
7576
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
7677
with any other training source code dependencies aside from the entry
7778
point file (default: None). If ``source_dir`` is an S3 URI, it must
@@ -186,8 +187,9 @@ def create_model(
186187
* 'SecurityGroupIds' (list[str]): List of security group ids.
187188
188189
entry_point (str): Path (absolute or relative) to the local Python source file which
189-
should be executed as the entry point to training. If not specified, the training
190-
entry point is used.
190+
should be executed as the entry point to training. If ``source_dir`` is specified,
191+
then ``entry_point`` must point to a file located at the root of ``source_dir``.
192+
If not specified, the training entry point is used.
191193
source_dir (str): Path (absolute or relative) to a directory with any other serving
192194
source code dependencies aside from the entry point file.
193195
If not specified, the model source directory from training is used.

src/sagemaker/mxnet/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def __init__(
8484
might use the IAM role, if it needs to access an AWS resource.
8585
entry_point (str): Path (absolute or relative) to the Python source
8686
file which should be executed as the entry point to model
87-
hosting. This should be compatible with either Python 2.7 or
88-
Python 3.5.
87+
hosting. If ``source_dir`` is specified, then ``entry_point``
88+
must point to a file located at the root of ``source_dir``.
8989
image (str): A Docker image URI (default: None). If not specified, a
9090
default image for MXNet will be used.
9191
py_version (str): Python version you want to use for executing your

src/sagemaker/pytorch/estimator.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def __init__(
6767
Args:
6868
entry_point (str): Path (absolute or relative) to the Python source
6969
file which should be executed as the entry point to training.
70-
This should be compatible with either Python 2.7 or Python 3.5.
70+
If ``source_dir`` is specified, then ``entry_point``
71+
must point to a file located at the root of ``source_dir``.
7172
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
7273
with any other training source code dependencies aside from the entry
7374
point file (default: None). If ``source_dir`` is an S3 URI, it must
@@ -150,8 +151,9 @@ def create_model(
150151
* 'Subnets' (list[str]): List of subnet ids.
151152
* 'SecurityGroupIds' (list[str]): List of security group ids.
152153
entry_point (str): Path (absolute or relative) to the local Python source file which
153-
should be executed as the entry point to training. If not specified, the training
154-
entry point is used.
154+
should be executed as the entry point to training. If ``source_dir`` is specified,
155+
then ``entry_point`` must point to a file located at the root of ``source_dir``.
156+
If not specified, the training entry point is used.
155157
source_dir (str): Path (absolute or relative) to a directory with any other serving
156158
source code dependencies aside from the entry point file.
157159
If not specified, the model source directory from training is used.

src/sagemaker/pytorch/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def __init__(
8585
might use the IAM role, if it needs to access an AWS resource.
8686
entry_point (str): Path (absolute or relative) to the Python source
8787
file which should be executed as the entry point to model
88-
hosting. This should be compatible with either Python 2.7 or
89-
Python 3.5.
88+
hosting. If ``source_dir`` is specified, then ``entry_point``
89+
must point to a file located at the root of ``source_dir``.
9090
image (str): A Docker image URI (default: None). If not specified, a
9191
default image for PyTorch will be used.
9292
py_version (str): Python version you want to use for executing your

src/sagemaker/rl/estimator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def __init__(
100100
Args:
101101
entry_point (str): Path (absolute or relative) to the Python source
102102
file which should be executed as the entry point to training.
103-
This should be compatible with Python 3.5 for MXNet or Python
104-
3.6 for TensorFlow.
103+
If ``source_dir`` is specified, then ``entry_point``
104+
must point to a file located at the root of ``source_dir``.
105105
toolkit (sagemaker.rl.RLToolkit): RL toolkit you want to use for
106106
executing your model training code.
107107
toolkit_version (str): RL toolkit version you want to be use for
@@ -187,8 +187,8 @@ def create_model(
187187
188188
entry_point (str): Path (absolute or relative) to the Python source
189189
file which should be executed as the entry point for MXNet
190-
hosting. This should be compatible with Python 3.5 (default:
191-
self.entry_point)
190+
hosting (default: self.entry_point). If ``source_dir`` is specified,
191+
then ``entry_point`` must point to a file located at the root of ``source_dir``.
192192
source_dir (str): Path (absolute or relative) to a directory with
193193
any other training source code dependencies aside from the entry
194194
point file (default: self.source_dir). Structure within this

src/sagemaker/sklearn/estimator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def __init__(
6565
Args:
6666
entry_point (str): Path (absolute or relative) to the Python source
6767
file which should be executed as the entry point to training.
68-
This should be compatible with either Python 2.7 or Python 3.5.
68+
If ``source_dir`` is specified, then ``entry_point``
69+
must point to a file located at the root of ``source_dir``.
6970
framework_version (str): Scikit-learn version you want to use for
7071
executing your model training code. List of supported versions
7172
https://github.com/aws/sagemaker-python-sdk#sklearn-sagemaker-estimators

0 commit comments

Comments
 (0)