Skip to content

doc: document that Local Mode + local code doesn't support dependencies arg #1608

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 3 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions doc/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ If you want to keep everything local, and not use Amazon S3 either, you can enab

# pass sagemaker_session to your estimator or model

.. note::
If you enable "local code," then you cannot use the ``dependencies`` parameter in your estimator or model.

We can take the example in `Using Estimators <#using-estimators>`__ , and use either ``local`` or ``local_gpu`` as the instance type.

.. code:: python
Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/chainer/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def create_model(
dependencies (list[str]): A list of paths to directories (absolute or relative) with
any additional libraries that will be exported to the container.
If not specified, the dependencies from training are used.
This is not supported with "local code" in Local Mode.
**kwargs: Additional kwargs passed to the ChainerModel constructor.

Returns:
Expand Down
14 changes: 10 additions & 4 deletions src/sagemaker/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1528,11 +1528,16 @@ def __init__(
copied to SageMaker in the same folder where the entrypoint is
copied. If 'git_config' is provided, 'dependencies' should be a
list of relative locations to directories with any additional
libraries needed in the Git repo. .. admonition:: Example
libraries needed in the Git repo.

The following call >>> Estimator(entry_point='train.py',
dependencies=['my/libs/common', 'virtual-env']) results in
the following inside the container:
.. admonition:: Example

The following call

>>> Estimator(entry_point='train.py',
... dependencies=['my/libs/common', 'virtual-env'])

results in the following inside the container:

>>> $ ls

Expand All @@ -1541,6 +1546,7 @@ def __init__(
>>> |------ common
>>> |------ virtual-env

This is not supported with "local code" in Local Mode.
enable_network_isolation (bool): Specifies whether container will
run in network isolation mode. Network isolation mode restricts
the container access to outside networks (such as the internet).
Expand Down
15 changes: 11 additions & 4 deletions src/sagemaker/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,18 +709,25 @@ def __init__(
list of relative locations to directories with any additional
libraries needed in the Git repo. If the ```source_dir``` points
to S3, code will be uploaded and the S3 location will be used
instead. .. admonition:: Example
instead.

The following call >>> Estimator(entry_point='inference.py',
dependencies=['my/libs/common', 'virtual-env']) results in
the following inside the container:
.. admonition:: Example

The following call

>>> Model(entry_point='inference.py',
... dependencies=['my/libs/common', 'virtual-env'])

results in the following inside the container:

>>> $ ls

>>> opt/ml/code
>>> |------ inference.py
>>> |------ common
>>> |------ virtual-env

This is not supported with "local code" in Local Mode.
git_config (dict[str, str]): Git configurations used for cloning
files, including ``repo``, ``branch``, ``commit``,
``2FA_enabled``, ``username``, ``password`` and ``token``. The
Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/mxnet/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def create_model(
dependencies (list[str]): A list of paths to directories (absolute or relative) with
any additional libraries that will be exported to the container.
If not specified, the dependencies from training are used.
This is not supported with "local code" in Local Mode.
image_name (str): If specified, the estimator will use this image for hosting, instead
of selecting the appropriate SageMaker official image based on framework_version
and py_version. It can be an ECR url or dockerhub image and tag.
Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/pytorch/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def create_model(
dependencies (list[str]): A list of paths to directories (absolute or relative) with
any additional libraries that will be exported to the container.
If not specified, the dependencies from training are used.
This is not supported with "local code" in Local Mode.
**kwargs: Additional kwargs passed to the :class:`~sagemaker.pytorch.model.PyTorchModel`
constructor.

Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/rl/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def create_model(
folders will be copied to SageMaker in the same folder where the
entry_point is copied. If the ```source_dir``` points to S3,
code will be uploaded and the S3 location will be used instead.
This is not supported with "local code" in Local Mode.
**kwargs: Additional kwargs passed to the :class:`~sagemaker.model.FrameworkModel`
constructor.

Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/sklearn/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def create_model(
dependencies (list[str]): A list of paths to directories (absolute or relative) with
any additional libraries that will be exported to the container.
If not specified, the dependencies from training are used.
This is not supported with "local code" in Local Mode.
**kwargs: Additional kwargs passed to the :class:`~sagemaker.sklearn.model.SKLearnModel`
constructor.

Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/tensorflow/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ def create_model(
If not specified and ``endpoint_type`` is 'tensorflow-serving', ``dependencies`` is
set to ``None``.
If ``endpoint_type`` is also ``None``, then the dependencies from training are used.
This is not supported with "local code" in Local Mode.
**kwargs: Additional kwargs passed to :class:`~sagemaker.tensorflow.serving.Model`
and :class:`~sagemaker.tensorflow.model.TensorFlowModel` constructors.

Expand Down
1 change: 1 addition & 0 deletions src/sagemaker/xgboost/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def create_model(
dependencies (list[str]): A list of paths to directories (absolute or relative) with
any additional libraries that will be exported to the container.
If not specified, the dependencies from training are used.
This is not supported with "local code" in Local Mode.
**kwargs: Additional kwargs passed to the :class:`~sagemaker.xgboost.model.XGBoostModel`
constructor.

Expand Down