Skip to content

Commit 2b0dd0f

Browse files
author
Dipankar Patro
committed
documentation: fixes with remote functions documentation
1 parent 98134d2 commit 2b0dd0f

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

doc/remote_function/sagemaker.remote_function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Remote function classes and methods specification
88
.. automethod:: sagemaker.remote_function.client.remote
99

1010

11-
RemoteExcutor
11+
RemoteExecutor
1212
-------------
1313

1414
.. autoclass:: sagemaker.remote_function.RemoteExecutor

src/sagemaker/remote_function/client.py

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def remote(
8787
This decorator wraps the annotated code and runs it as a new SageMaker job synchronously
8888
with the provided runtime settings.
8989
90-
Unless mentioned otherwise, the decorator first looks up the value from the SageMaker
90+
In case a parameter value is not set, the decorator first looks up the value from the SageMaker
9191
configuration file. If no value is specified in the configuration file or no configuration file
9292
is found, the decorator selects the default as specified below. For more information, see
9393
`Configuring and using defaults with the SageMaker Python SDK <https://sagemaker.readthedocs.io/
@@ -131,7 +131,7 @@ def remote(
131131
annotated with the remote decorator is invoked using the Python runtime available
132132
in the system path.
133133
134-
* The parameter dependencies is set to auto_capture. SageMaker will automatically
134+
* The parameter dependencies is set to ``auto_capture``. SageMaker will automatically
135135
generate an env_snapshot.yml corresponding to the current active conda environment’s
136136
snapshot. You do not need to provide a dependencies file. The following conditions
137137
apply:
@@ -204,7 +204,7 @@ def remote(
204204
downloaded in the previous runs.
205205
206206
max_retry_attempts (int): The max number of times the job is retried on
207-
```InternalServerFailure``` Error from SageMaker service. Defaults to 1.
207+
``InternalServerFailure`` Error from SageMaker service. Defaults to 1.
208208
209209
max_runtime_in_seconds (int): The upper limit in seconds to be used for training. After
210210
this specified amount of time, SageMaker terminates the job regardless of its current
@@ -475,10 +475,10 @@ def __init__(
475475
):
476476
"""Constructor for RemoteExecutor
477477
478-
Unless mentioned otherwise, the constructor first looks up the value from the SageMaker
479-
configuration file. If no value is specified in the configuration file or no configuration
480-
file is found, the constructor selects the default as specified below. For more
481-
information, see `Configuring and using defaults with the SageMaker Python SDK
478+
In case a parameter value is not set, the constructor first looks up the value from the
479+
SageMaker configuration file. If no value is specified in the configuration file or
480+
no configuration file is found, the constructor selects the default as specified below.
481+
For more information, see `Configuring and using defaults with the SageMaker Python SDK
482482
<https://sagemaker.readthedocs.io/en/stable/overview.html
483483
#configuring-and-using-defaults-with-the-sagemaker-python-sdk>`_.
484484
@@ -520,7 +520,7 @@ def __init__(
520520
annotated with the remote decorator is invoked using the Python runtime available
521521
in the system path.
522522
523-
* The parameter dependencies is set to auto_capture. SageMaker will automatically
523+
* The parameter dependencies is set to ``auto_capture``. SageMaker will automatically
524524
generate an env_snapshot.yml corresponding to the current active conda environment’s
525525
snapshot. You do not need to provide a dependencies file. The following conditions
526526
apply:
@@ -595,7 +595,7 @@ def __init__(
595595
max_parallel_jobs (int): Maximum number of jobs that run in parallel. Defaults to 1.
596596
597597
max_retry_attempts (int): The max number of times the job is retried on
598-
```InternalServerFailure``` Error from SageMaker service. Defaults to 1.
598+
``InternalServerFailure`` Error from SageMaker service. Defaults to 1.
599599
600600
max_runtime_in_seconds (int): The upper limit in seconds to be used for training. After
601601
this specified amount of time, SageMaker terminates the job regardless of its current
@@ -1012,7 +1012,8 @@ def wait(
10121012
timeout (int): Timeout in seconds to wait until the job is completed before it is
10131013
stopped. Defaults to ``None``.
10141014
1015-
Returns: None
1015+
Returns:
1016+
None
10161017
"""
10171018

10181019
with self._condition:
@@ -1022,14 +1023,15 @@ def wait(
10221023
if self._state == _RUNNING:
10231024
self._job.wait(timeout=timeout)
10241025

1025-
def cancel(self):
1026+
def cancel(self) -> bool:
10261027
"""Cancel the function execution.
10271028
10281029
This method prevents the SageMaker job being created or stops the underlying SageMaker job
10291030
early if it is already in progress.
10301031
1031-
Returns: ``True`` if the underlying SageMaker job created as a result of the remote function
1032-
run is cancelled.
1032+
Returns:
1033+
``True`` if the underlying SageMaker job created as a result of the remote function
1034+
run is cancelled.
10331035
"""
10341036
with self._condition:
10351037
if self._state == _FINISHED:
@@ -1042,18 +1044,27 @@ def cancel(self):
10421044
self._state = _CANCELLED
10431045
return True
10441046

1045-
def running(self):
1046-
"""Returns ``True`` if the underlying sagemaker job is still running."""
1047+
def running(self) -> bool:
1048+
"""
1049+
Returns:
1050+
``True`` if the underlying sagemaker job is still running.
1051+
"""
10471052
with self._condition:
10481053
return self._state == _RUNNING
10491054

10501055
def cancelled(self):
1051-
"""Returns ``True`` if the underlying sagemaker job was cancelled. ``False``, otherwise."""
1056+
"""
1057+
Returns:
1058+
``True`` if the underlying sagemaker job was cancelled. ``False``, otherwise.
1059+
"""
10521060
with self._condition:
10531061
return self._state == _CANCELLED
10541062

10551063
def done(self):
1056-
"""Returns ``True`` if the underlying sagemaker job finished running."""
1064+
"""
1065+
Returns:
1066+
``True`` if the underlying sagemaker job finished running.
1067+
"""
10571068
with self._condition:
10581069
if self._state == _RUNNING and self._job.describe()["TrainingJobStatus"] in [
10591070
"Completed",

0 commit comments

Comments
 (0)