-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[Data] Remove ActorPoolStrategy from documentation #41948
Conversation
Signed-off-by: Cheng Su <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some style nits. In the future, consider using Vale (go/vale) for automated linting. It will report most of the corrections I made, like:
- avoid future tense
- avoid using first person ("we")
- avoid using "please"
@@ -919,7 +919,7 @@ | |||
"source": [ | |||
"Then we use the {meth}`map_batches <ray.data.Dataset.map_batches>` API to apply the model to the whole dataset. \n", | |||
"\n", | |||
"The first parameter of `map` and `map_batches` is the user-defined function (UDF), which can either be a function or a class. Function-based UDFs will run as short-running [Ray tasks](https://docs.ray.io/en/latest/ray-core/key-concepts.html#tasks), and class-based UDFs will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, we use the `compute` argument to specify {class}`ActorPoolStrategy <ray.data.dataset_internal.compute.ActorPoolStrategy>` with the number of parallel actors. And the `batch_size` argument indicates the number of images in each batch.\n", | |||
"The first parameter of `map` and `map_batches` is the user-defined function (UDF), which can either be a function or a class. Function-based UDFs will run as short-running [Ray tasks](https://docs.ray.io/en/latest/ray-core/key-concepts.html#tasks), and class-based UDFs will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors. And the `batch_size` argument indicates the number of images in each batch.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The first parameter of `map` and `map_batches` is the user-defined function (UDF), which can either be a function or a class. Function-based UDFs will run as short-running [Ray tasks](https://docs.ray.io/en/latest/ray-core/key-concepts.html#tasks), and class-based UDFs will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors. And the `batch_size` argument indicates the number of images in each batch.\n", | |
"The first parameter of `map` and `map_batches` is the user-defined function (UDF), which can either be a function or a class. Function-based UDFs run as short-running [Ray tasks](https://docs.ray.io/en/latest/ray-core/key-concepts.html#tasks), and class-based UDFs run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, use the `concurrency` argument to specify the number of parallel actors. The `batch_size` argument indicates the number of images in each batch.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
@@ -353,7 +353,7 @@ | |||
"source": [ | |||
"Then we use the {meth}`map_batches <ray.data.Dataset.map_batches>` API to apply the model to the whole dataset. \n", | |||
"\n", | |||
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, we use the `compute` argument to specify {class}`ActorPoolStrategy <ray.data.dataset_internal.compute.ActorPoolStrategy>` with the number of parallel actors. And the `batch_size` argument indicates the number of images in each batch.\n", | |||
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors. And the `batch_size` argument indicates the number of images in each batch.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors. And the `batch_size` argument indicates the number of images in each batch.\n", | |
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Because this case uses a class, the UDF runs as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/key-concepts.html#actors). For class-based UDFs, use the `concurrency` argument to specify the number of parallel actors. The `batch_size` argument indicates the number of images in each batch.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
@@ -439,7 +439,7 @@ | |||
"source": [ | |||
"Then we use the {meth}`~ray.data.Dataset.map_batches` API to apply the model to the whole dataset.\n", | |||
"\n", | |||
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](actor-guide). For class-based UDFs, we use the `compute` argument to specify {class}`~ray.data.ActorPoolStrategy` with the number of parallel actors.\n", | |||
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](actor-guide). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](actor-guide). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors.\n", | |
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Because this case uses a class, the UDF runs as long-running [Ray actors](actor-guide). For class-based UDFs, use the `concurrency` argument to specify the number of parallel actors.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
@@ -439,7 +439,7 @@ | |||
"source": [ | |||
"Then we use the [`map_batches`](https://docs.ray.io/en/latest/data/api/doc/ray.data.Dataset.map_batches.html) API to apply the model to the whole dataset.\n", | |||
"\n", | |||
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/actors.html). For class-based UDFs, we use the `compute` argument to specify [`ActorPoolStrategy`](https://docs.ray.io/en/latest/data/api/doc/ray.data.ActorPoolStrategy.html) with the number of parallel actors.\n", | |||
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/actors.html). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Since we are using a class in this case, the UDF will run as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/actors.html). For class-based UDFs, we use the `concurrency` argument to specify the number of parallel actors.\n", | |
"The first parameter of `map_batches` is the user-defined function (UDF), which can either be a function or a class. Because this class uses a class, the UDF runs as long-running [Ray actors](https://docs.ray.io/en/latest/ray-core/actors.html). For class-based UDFs, use the `concurrency` argument to specify the number of parallel actors.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
@@ -103,7 +103,7 @@ class ExecutionOptions: | |||
operators under the streaming executor. The bulk executor always preserves | |||
order. Off by default. | |||
actor_locality_enabled: Whether to enable locality-aware task dispatch to | |||
actors (on by default). This applies to both ActorPoolStrategy map and | |||
actors (on by default). This applies to both stateful map and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actors (on by default). This applies to both stateful map and | |
actors (on by default). This parameter applies to both stateful map and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
python/ray/data/dataset.py
Outdated
compute: Either "tasks" (default) to use Ray Tasks or an | ||
:class:`~ray.data.ActorPoolStrategy` to use an autoscaling actor pool. | ||
This argument is deprecated. Please use ``concurrency`` argument instead. | ||
compute: This argument is deprecated. Please use ``concurrency`` argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compute: This argument is deprecated. Please use ``concurrency`` argument. | |
compute: This argument is deprecated. Use ``concurrency`` argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much easier!
…ns.py Co-authored-by: angelinalg <[email protected]> Signed-off-by: Cheng Su <[email protected]>
…on_options.py" This reverts commit 5ed4c8a.
Signed-off-by: Cheng Su <[email protected]>
doc/source/data/batch_inference.rst
Outdated
@@ -73,9 +73,9 @@ For how to configure batch inference, see :ref:`the configuration guide<batch_in | |||
|
|||
# Use 2 parallel actors for inference. Each actor predicts on a | |||
# different partition of data. | |||
scale = ray.data.ActorPoolStrategy(size=2) | |||
concurrency = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new API (which is much better) I don't think putting this on a separate line makes a lot of sense. Maybe inline it below and say Step 3: Map the Predictor over the dataset to get predictions. Use 2 parallel actors for inference. Each actor predicts on a different partition of data.
as the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, updated.
Signed-off-by: Cheng Su <[email protected]>
This PR is to remove `ActorPoolStrategy`, and replace it with `concurrency` parameter in all documentations. Signed-off-by: Cheng Su <[email protected]>
This PR is to remove `ActorPoolStrategy`, and replace it with `concurrency` parameter in all documentations. Signed-off-by: Cheng Su <[email protected]>
Why are these changes needed?
This PR is to remove
ActorPoolStrategy
, and replace it withconcurrency
parameter in all documentations.Related issue number
#40725
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.