Skip to content

Commit

Permalink
Merge branch 'master' into ray_cg_target
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisearch42 authored Dec 12, 2024
2 parents ef5e014 + 2e4a126 commit 00485b6
Show file tree
Hide file tree
Showing 66 changed files with 1,095 additions and 2,348 deletions.
2 changes: 1 addition & 1 deletion .buildkite/rllib.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ steps:

- label: ":brain: rllib: examples"
tags: rllib
parallelism: 5
parallelism: 6
instance_type: large
commands:
- bazel run //ci/ray_ci:test_in_docker -- //rllib/... rllib
Expand Down
50 changes: 0 additions & 50 deletions .buildkite/rllib_contrib.rayci.yml

This file was deleted.

9 changes: 9 additions & 0 deletions doc/source/data/api/input_output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ Lance

read_lance

ClickHouse
----------

.. autosummary::
:nosignatures:
:toctree: doc/

read_clickhouse

Dask
----

Expand Down
23 changes: 0 additions & 23 deletions doc/source/rllib/rllib-models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,29 +390,6 @@ Take a look at this model example that does exactly that:
:end-before: __sphinx_doc_end__


**Using the Trajectory View API: Passing in the last n actions (or rewards or observations) as inputs to a custom Model**

It is sometimes helpful for learning not only to look at the current observation
in order to calculate the next action, but also at the past n observations.
In other cases, you may want to provide the most recent rewards or actions to the model as well
(like our LSTM wrapper does if you specify: ``use_lstm=True`` and ``lstm_use_prev_action/reward=True``).
All this may even be useful when not working with partially observable environments (PO-MDPs)
and/or RNN/Attention models, as for example in classic Atari runs, where we usually use framestacking of
the last four observed images.

The trajectory view API allows your models to specify these more complex "view requirements".

Here is a simple (non-RNN/Attention) example of a Model that takes as input
the last 3 observations (very similar to the recommended "framestacking" for
learning in Atari environments):

.. literalinclude:: ../../../rllib/examples/_old_api_stack/models/trajectory_view_utilizing_models.py
:language: python
:start-after: __sphinx_doc_begin__
:end-before: __sphinx_doc_end__

A PyTorch version of the above model is also `given in the same file <https://github.com/ray-project/ray/blob/master/rllib/examples/_old_api_stack/models/trajectory_view_utilizing_models.py>`__.


Custom Action Distributions
---------------------------
Expand Down
15 changes: 0 additions & 15 deletions doc/source/train/user-guides/using-gpus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,6 @@ an actor for the :class:`Trainer <ray.train.trainer.BaseTrainer>` object when
you call :meth:`Trainer.fit() <ray.train.trainer.BaseTrainer.fit>`.

This object often only manages lightweight communication between the training workers.
You can still specify its resources, which can be useful if you implemented your own
Trainer that does heavier processing.

.. testcode::

from ray.train import ScalingConfig

scaling_config = ScalingConfig(
num_workers=8,
trainer_resources={
"CPU": 4,
"GPU": 1,
}
)

Per default, a trainer uses 1 CPU. If you have a cluster with 8 CPUs and want
to start 4 training workers a 2 CPUs, this will not work, as the total number
of required CPUs will be 9 (4 * 2 + 1). In that case, you can specify the trainer
Expand Down
11 changes: 7 additions & 4 deletions python/ray/air/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ def equals(value, default_value):
class ScalingConfig:
"""Configuration for scaling training.
For more details, see :ref:`train_scaling_config`.
Args:
trainer_resources: Resources to allocate for the training coordinator.
The training coordinator launches the worker group and executes
Expand All @@ -120,8 +122,9 @@ class ScalingConfig:
argument.
resources_per_worker: If specified, the resources
defined in this Dict is reserved for each worker.
Define the ``"CPU"`` and ``"GPU"`` keys (case-sensitive) to
override the number of CPU or GPUs used by each worker.
Define the ``"CPU"`` key (case-sensitive) to
override the number of CPUs used by each worker.
This can also be used to request :ref:`custom resources <custom-resources>`.
placement_strategy: The placement strategy to use for the
placement group of the Ray actors. See :ref:`Placement Group
Strategies <pgroup-strategy>` for the possible options.
Expand All @@ -142,8 +145,8 @@ class ScalingConfig:
num_workers=2,
# Turn on/off GPU.
use_gpu=True,
# Specify resources used for trainer.
trainer_resources={"CPU": 1},
# Assign extra CPU/GPU/custom resources per worker.
resources_per_worker={"GPU": 1, "CPU": 1, "memory": 1e9, "custom": 1.0},
# Try to schedule workers on different nodes.
placement_strategy="SPREAD",
)
Expand Down
3 changes: 3 additions & 0 deletions python/ray/dashboard/client/src/type/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export enum ServeDeploymentStatus {
UPDATING = "UPDATING",
HEALTHY = "HEALTHY",
UNHEALTHY = "UNHEALTHY",
DEPLOY_FAILED = "DEPLOY_FAILED",
UPSCALING = "UPSCALING",
DOWNSCALING = "DOWNSCALING",
}

export type ServeDeployment = {
Expand Down
8 changes: 8 additions & 0 deletions python/ray/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,14 @@ py_test(
deps = ["//:ray_lib", ":conftest"],
)

py_test(
name = "test_clickhouse",
size = "small",
srcs = ["tests/test_clickhouse.py"],
tags = ["team:data", "exclusive"],
deps = ["//:ray_lib", ":conftest"],
)

py_test(
name = "test_lance",
size = "small",
Expand Down
2 changes: 2 additions & 0 deletions python/ray/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
read_avro,
read_bigquery,
read_binary_files,
read_clickhouse,
read_csv,
read_databricks_tables,
read_datasource,
Expand Down Expand Up @@ -137,6 +138,7 @@
"read_avro",
"read_text",
"read_binary_files",
"read_clickhouse",
"read_csv",
"read_datasource",
"read_delta_sharing_tables",
Expand Down
Loading

0 comments on commit 00485b6

Please sign in to comment.