Skip to content

doc: clarify that entry_point must be in the root of source_dir (if applicable) #1528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/sagemaker/chainer/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def __init__(
Args:
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to training.
This should be compatible with either Python 2.7 or Python 3.5.
If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
use_mpi (bool): If true, entry point is run as an MPI script. By
default, the Chainer Framework runs the entry point with
'mpirun' if more than one instance is used.
Expand Down Expand Up @@ -186,11 +187,14 @@ def create_model(
role from the Estimator will be used.
vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on
the model. Default: use subnets and security groups from this Estimator.

* 'Subnets' (list[str]): List of subnet ids.
* 'SecurityGroupIds' (list[str]): List of security group ids.

entry_point (str): Path (absolute or relative) to the local Python source file which
should be executed as the entry point to training. If not specified, the training
entry point is used.
should be executed as the entry point to training. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
If not specified, the training entry point is used.
source_dir (str): Path (absolute or relative) to a directory with any other serving
source code dependencies aside from the entry point file.
If not specified, the model source directory from training is used.
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/chainer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def __init__(
might use the IAM role, if it needs to access an AWS resource.
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to model
hosting. This should be compatible with either Python 2.7 or
Python 3.5.
hosting. If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
image (str): A Docker image URI (default: None). If not specified, a
default image for Chainer will be used.
py_version (str): Python version you want to use for executing your
Expand Down
13 changes: 8 additions & 5 deletions src/sagemaker/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,10 +1467,11 @@ def __init__(
Args:
entry_point (str): Path (absolute or relative) to the local Python
source file which should be executed as the entry point to
training. This should be compatible with either Python 2.7 or
Python 3.5. If 'git_config' is provided, 'entry_point' should be
training. If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
If 'git_config' is provided, 'entry_point' should be
a relative location to the Python source file in the Git repo.
Example
Example:

With the following GitHub repo directory structure:

Expand All @@ -1487,6 +1488,7 @@ def __init__(
when training on Amazon SageMaker. If 'git_config' is provided,
'source_dir' should be a relative location to a directory in the Git
repo.

.. admonition:: Example

With the following GitHub repo directory structure:
Expand Down Expand Up @@ -1968,8 +1970,9 @@ def transformer(
volume_kms_key (str): Optional. KMS key ID for encrypting the volume
attached to the ML compute instance (default: None).
entry_point (str): Path (absolute or relative) to the local Python source file which
should be executed as the entry point to training. If not specified, the training
entry point is used.
should be executed as the entry point to training. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
If not specified, the training entry point is used.
vpc_config_override (dict[str, list[str]]): Optional override for
the VpcConfig set on the model.
Default: use subnets and security groups from this Estimator.
Expand Down
7 changes: 4 additions & 3 deletions src/sagemaker/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,10 +648,11 @@ def __init__(
resources on your behalf.
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to model
hosting. This should be compatible with either Python 2.7 or
Python 3.5. If 'git_config' is provided, 'entry_point' should be
hosting. If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
If 'git_config' is provided, 'entry_point' should be
a relative location to the Python source file in the Git repo.
Example
Example:

With the following GitHub repo directory structure:

Expand Down
8 changes: 5 additions & 3 deletions src/sagemaker/mxnet/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def __init__(
Args:
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to training.
This should be compatible with either Python 2.7 or Python 3.5.
If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
with any other training source code dependencies aside from the entry
point file (default: None). If ``source_dir`` is an S3 URI, it must
Expand Down Expand Up @@ -186,8 +187,9 @@ def create_model(
* 'SecurityGroupIds' (list[str]): List of security group ids.

entry_point (str): Path (absolute or relative) to the local Python source file which
should be executed as the entry point to training. If not specified, the training
entry point is used.
should be executed as the entry point to training. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
If not specified, the training entry point is used.
source_dir (str): Path (absolute or relative) to a directory with any other serving
source code dependencies aside from the entry point file.
If not specified, the model source directory from training is used.
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/mxnet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def __init__(
might use the IAM role, if it needs to access an AWS resource.
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to model
hosting. This should be compatible with either Python 2.7 or
Python 3.5.
hosting. If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
image (str): A Docker image URI (default: None). If not specified, a
default image for MXNet will be used.
py_version (str): Python version you want to use for executing your
Expand Down
8 changes: 5 additions & 3 deletions src/sagemaker/pytorch/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def __init__(
Args:
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to training.
This should be compatible with either Python 2.7 or Python 3.5.
If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
source_dir (str): Path (absolute, relative or an S3 URI) to a directory
with any other training source code dependencies aside from the entry
point file (default: None). If ``source_dir`` is an S3 URI, it must
Expand Down Expand Up @@ -150,8 +151,9 @@ def create_model(
* 'Subnets' (list[str]): List of subnet ids.
* 'SecurityGroupIds' (list[str]): List of security group ids.
entry_point (str): Path (absolute or relative) to the local Python source file which
should be executed as the entry point to training. If not specified, the training
entry point is used.
should be executed as the entry point to training. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
If not specified, the training entry point is used.
source_dir (str): Path (absolute or relative) to a directory with any other serving
source code dependencies aside from the entry point file.
If not specified, the model source directory from training is used.
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/pytorch/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def __init__(
might use the IAM role, if it needs to access an AWS resource.
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to model
hosting. This should be compatible with either Python 2.7 or
Python 3.5.
hosting. If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
image (str): A Docker image URI (default: None). If not specified, a
default image for PyTorch will be used.
py_version (str): Python version you want to use for executing your
Expand Down
8 changes: 4 additions & 4 deletions src/sagemaker/rl/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def __init__(
Args:
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to training.
This should be compatible with Python 3.5 for MXNet or Python
3.6 for TensorFlow.
If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
toolkit (sagemaker.rl.RLToolkit): RL toolkit you want to use for
executing your model training code.
toolkit_version (str): RL toolkit version you want to be use for
Expand Down Expand Up @@ -187,8 +187,8 @@ def create_model(

entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point for MXNet
hosting. This should be compatible with Python 3.5 (default:
self.entry_point)
hosting (default: self.entry_point). If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
source_dir (str): Path (absolute or relative) to a directory with
any other training source code dependencies aside from the entry
point file (default: self.source_dir). Structure within this
Expand Down
3 changes: 2 additions & 1 deletion src/sagemaker/sklearn/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def __init__(
Args:
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to training.
This should be compatible with either Python 2.7 or Python 3.5.
If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
framework_version (str): Scikit-learn version you want to use for
executing your model training code. List of supported versions
https://github.com/aws/sagemaker-python-sdk#sklearn-sagemaker-estimators
Expand Down
6 changes: 3 additions & 3 deletions src/sagemaker/sklearn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ def __init__(
might use the IAM role, if it needs to access an AWS resource.
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to model
hosting. This should be compatible with either Python 2.7 or
Python 3.5.
hosting. If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
image (str): A Docker image URI (default: None). If not specified, a
default image for Scikit-learn will be used.
py_version (str): Python version you want to use for executing your
model training code (default: 'py2').
model training code (default: 'py3').
framework_version (str): Scikit-learn version you want to use for
executing your model training code.
predictor_cls (callable[str, sagemaker.session.Session]): A function
Expand Down
23 changes: 14 additions & 9 deletions src/sagemaker/tensorflow/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,19 +558,22 @@ def create_model(
model_server_workers (int): Optional. The number of worker processes used by the
inference server. If None, server will use one worker per vCPU.
vpc_config_override (dict[str, list[str]]): Optional override for VpcConfig set on the
model.
Default: use subnets and security groups from this Estimator.
model. Default: use subnets and security groups from this Estimator.

* 'Subnets' (list[str]): List of subnet ids.
* 'SecurityGroupIds' (list[str]): List of security group ids.

endpoint_type (str): Optional. Selects the software stack used by the inference server.
If not specified, the model will be configured to use the default
SageMaker model server. If 'tensorflow-serving', the model will be configured to
use the SageMaker Tensorflow Serving container.
entry_point (str): Path (absolute or relative) to the local Python source file which
should be executed as the entry point to training. If not specified and
``endpoint_type`` is 'tensorflow-serving', no entry point is used. If
``endpoint_type`` is also ``None``, then the training entry point is used.
source_dir (str): Path (absolute or relative or an S3 URI ) to a directory with any
should be executed as the entry point to training. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
If not specified and ``endpoint_type`` is 'tensorflow-serving',
no entry point is used. If ``endpoint_type`` is also ``None``,
then the training entry point is used.
source_dir (str): Path (absolute or relative or an S3 URI) to a directory with any
other serving source code dependencies aside from the entry point file. If
``source_dir`` is an S3 URI, it must point to a tar.gz file. If not specified
and ``endpoint_type`` is 'tensorflow-serving', no source_dir is used. If
Expand Down Expand Up @@ -828,9 +831,11 @@ def transformer(
If 'tensorflow-serving', the model will be configured to
use the SageMaker Tensorflow Serving container.
entry_point (str): Path (absolute or relative) to the local Python source file which
should be executed as the entry point to training. If not specified and
``endpoint_type`` is 'tensorflow-serving', no entry point is used. If
``endpoint_type`` is also ``None``, then the training entry point is used.
should be executed as the entry point to training. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
If not specified and ``endpoint_type`` is 'tensorflow-serving',
no entry point is used. If ``endpoint_type`` is also ``None``,
then the training entry point is used.
vpc_config_override (dict[str, list[str]]): Optional override for
the VpcConfig set on the model.
Default: use subnets and security groups from this Estimator.
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/tensorflow/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def __init__(
might use the IAM role, if it needs to access an AWS resource.
entry_point (str): Path (absolute or relative) to the Python source
file which should be executed as the entry point to model
hosting. This should be compatible with either Python 2.7 or
Python 3.5.
hosting. If ``source_dir`` is specified, then ``entry_point``
must point to a file located at the root of ``source_dir``.
image (str): A Docker image URI (default: None). If not specified, a
default image for TensorFlow will be used.
py_version (str): Python version you want to use for executing your
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/xgboost/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def __init__(

Args:
entry_point (str): Path (absolute or relative) to the Python source file which should
be executed as the entry point to training.
This should be compatible with either Python 2.7 or Python 3.5.
be executed as the entry point to training. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
framework_version (str): XGBoost version you want to use for executing your model
training code. List of supported versions
https://github.com/aws/sagemaker-python-sdk#xgboost-sagemaker-estimators
Expand Down
4 changes: 2 additions & 2 deletions src/sagemaker/xgboost/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def __init__(
training data and model artifacts. After the endpoint is created, the inference
code might use the IAM role, if it needs to access an AWS resource.
entry_point (str): Path (absolute or relative) to the Python source file which should
be executed as the entry point to model hosting.
This should be compatible with either Python 2.7 or Python 3.5.
be executed as the entry point to model hosting. If ``source_dir`` is specified,
then ``entry_point`` must point to a file located at the root of ``source_dir``.
image (str): A Docker image URI (default: None). If not specified, a default image for
XGBoos will be used.
py_version (str): Python version you want to use for executing your model training code
Expand Down