Commit graph

12546 commits

Author SHA1 Message Date
Kai Fricke
6c5229295e
[ci/release] Support running tests with different python versions (#24843)
OSS release tests currently run with hardcoded Python 3.7 base. In the future we will want to run tests on different python versions. 
This PR adds support for a new `python` field in the test configuration. The python field will determine both the base image used in the Buildkite runner docker container (for Ray client compatibility) and the base image for the Anyscale cluster environments. 

Note that in Buildkite, we will still only wait for the python 3.7 base image before kicking off tests. That is acceptable, as we can assume that most wheels finish in a similar time, so even if we wait for the 3.7 image and kick off a 3.8 test, that runner will wait maybe for 5-10 more minutes.
2022-05-17 17:03:12 +01:00
Amog Kamsetty
fb832c3b1f
[AIR] Don't use df.transform for BatchMapper (#24872)
`df.transform` has undefined behavior when the passed in function mutates the dataframe, as mentioned in the pandas docs. This is because I believe the implementation iterates through slices of the dataframe and passes these slices to the provided function. This "gotcha" exposes an implementation to users who are using `BatchMapper`.

It's pretty common to have preprocessors that mutates the dataframe, for example our own test does the following 
```
    def add_and_modify_udf(df: "pd.DataFrame"):
        df["new_col"] = df["old_column"] + 1
        df["to_be_modified"] *= 2
        return df
```

so instead of using `df.transform`, we instead do `self.fn(df)`. As the `df` is the output of Ray Datasets `iter_batches`, the provided function can safely mutate the dataset.
2022-05-17 16:49:17 +01:00
xwjiang2010
5c8361a92e
[air] Update to use more verbose default config for trainers. (#24850)
Internal user feedback showing that more detailed logging is preferred:
https://anyscaleteam.slack.com/archives/C030DEV6QLU/p1652481961472729
2022-05-17 16:21:11 +01:00
Jun Gong
dea134a472
[RLlib] Clean up Policy mixins. (#24746) 2022-05-17 17:16:08 +02:00
shrekris-anyscale
3a2bd16eca
[Serve] Add deployment graph import_path and runtime_env to ServeApplicationSchema (#24814)
A newly planned version of the Serve schema (used in the REST API and CLI) requires the user to pass in their deployment graph's`import_path` and optionally a runtime_env containing that graph. This new schema can then pick up any `init_args` and `init_kwargs` values directly from the graph, instead of requiring them to be serialized and passed explicitly into the REST request.

This change:
* Adds the `import_path` and `runtime_env` fields to the `ServeApplicationSchema`.
* Updates or disables outdated unit tests.

Follow-up changes should:
* Update the status schemas (i.e. `DeploymentStatusSchema` and `ServeApplicationStatusSchema`).
* Remove deployment-level `import_path`s.
* Process the new `import_path` and `runtime_env` fields instead of silently ignoring them.
    * Remove `init_args` and `init_kwargs` from `DeploymentSchema` afterwards.

Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
2022-05-17 09:51:06 -05:00
Kai Fricke
023f3fe9e9
[ci/release] Add CODEOWNERs for Ray release test package (#24774)
As part of the critical infrastructure, changes to the ray release package should require reviews by code owners.
2022-05-17 13:25:57 +01:00
Kai Fricke
fc07a2565c
[ci/docs] Add doc maintainer to CODEOWNERs for doc (#24778)
e2ee214 broke linter on master. However, reverting the commit or hotfixing the docs requires codeowner approval. It makes sense to include @maxpumperla as a codeowner in doc-related code paths, so this PR adds him.
2022-05-17 13:25:37 +01:00
Max Pumperla
ac850055bf
use absolute url for search, fixes #24808 (#24877)
Signed-off-by: Max Pumperla <max.pumperla@googlemail.com>
2022-05-17 13:22:53 +01:00
Artur Niederfahrenhorst
c2a1e5abd1
[RLlib] Prioritized Replay (if required) in SimpleQ and DDPG. (#24866) 2022-05-17 13:53:07 +02:00
Artur Niederfahrenhorst
fb2915d26a
[RLlib] Replay Buffer API and Ape-X. (#24506) 2022-05-17 13:43:49 +02:00
Antoni Baum
c74886a55e
[CI] Run doc notebooks in CI (#24816)
Currently, we are not running doc notebooks in CI due to a bazel misconfiguration - we are using `glob` in a top level package in order to get the paths for the notebooks, but those are contained inside subpackages, which glob purposefully ignores. Therefore, the lists of notebooks to run are empty. This PR fixes that by:
* Running the `py_test_run_all_notebooks` macro inside the relevant subpackages
* Editing the `test_myst_doc.py` script to allow for recursive search for the target file, allowing to deal with mismatches between `name` and `data` arguments in `py_test_run_all_notebooks`
* Setting the `allow_empty=False` flag inside `glob` calls in our macros to ensure that this oversight is caught early
* Enabling detection of changes in doc folder for `*.ipynb` and `BUILD` files

This PR also adds a GPU runner for doc tests, allowing one of our examples to pass - and setting the infra for more to come. Finally, a misconfigured path for one set of doc tests is also fixed.
2022-05-17 09:50:42 +01:00
Sven Mika
25001f6d8d
[RLlib] APPO Training iteration fn. (#24545) 2022-05-17 10:31:07 +02:00
Clark Zinzow
ea635aecd2
[Datasets] Support tensor columns in to_tf and to_torch. (#24752)
This PR adds support for tensor columns in the to_tf() and to_torch() APIs.

For Torch, this involves an explicit extension array check and (zero-copy) conversion of the tensor column to a NumPy array before converting the column to a Torch tensor.

For TensorFlow, this involves bypassing df.values when converting tensor feature columns to NumPy arrays, instead manually creating a single NumPy array from the column Series.

In both cases, I think that the UX around heterogeneous feature columns and squeezing the column dimension could be improved, but I'm saving that for a future PR.
2022-05-17 01:11:00 -07:00
Clark Zinzow
ef870e936c
[Datasets] Change range_arrow() API to range_table() (#24704)
This PR changes the ray.data.range_arrow() to ray.data.range_table(), making the Arrow representation an implementation detail.
2022-05-17 01:09:45 -07:00
Yi Cheng
379fa634ac
[core][2/2] Worker resubscribe when GCS failed (#24813)
A follow-up PR from this one: https://github.com/ray-project/ray/pull/24628

In the previous PR, it fixed the resubscribing issue for raylet. But there is also core worker which needs to do resubscribing.

There are two ways of doing resubscribe:
1. When the client-side detects any failure, it'll do resubscribing.
2. Server side will ask the client to do resubscribing.

1) is a cleaner and better solution. However, it's a little bit hard due to the following reasons:

- We are using long-polling, so for some extreme cases, we won't be able to detect the failure. For example, the client-side received the message, but before it sends another request, the server-side restarts, and the client will miss the opportunity of detecting the failure. This could happen if we have a standby GCS that starts very fast and somehow the client-side has a lot of traffic and runs very slow.
- The current gRPC framework doesn't give the user a way to handle failure which might need some refactoring on this one.

We can go with this way once we have gRPC streaming.

This PR is implementing 2) which includes three parts:
- raylet: (https://github.com/ray-project/ray/pull/24628)
- core worker: (this pr)
- python

Correctness: whenever when a worker started, it'll register to raylet immediately (sync call) before connecting to GCS. So, we just need to send all restart rpcs to registered workers and it should work because:
- if the worker just started and hasn't registered with the raylet: it's ok, because the worker hasn't connected with GCS yet, so no need to do resubscribing.
- if the worker has registered with the rayelt: it's covered by the code path here.
2022-05-16 23:47:52 -07:00
Eric Liang
a565948094
[docs] After careful consideration, choose the lesser of two evils and set white-space: pre-wrap #24873 2022-05-16 22:49:00 -07:00
Antoni Baum
7158aeda33
[Datasets] Add Dataset.split_proportionately and ray.ml.train_test_split (#24476)
Adds a Dataset.split_proportionately method that allows the user to split a dataset using proportions. This is a very common use-case for eg. train-test splitting. The implementation is a thin wrapper over Dataset.split_at_indices.

Additionally, this PR adds a ray.ml.train_test_split function intended to provide a familiar API to ML practitioners.
2022-05-16 20:47:29 -07:00
Qing Wang
40774ac219
Minor changes for Java runtime env. (#24840) 2022-05-17 11:33:59 +08:00
Yi Cheng
363b7cabec
[core] Remove unused node resource channel (#24857)
GCS_NODE_RESOURCE_CHANNEL is not used anymore. This PR removes this.
2022-05-16 20:16:05 -07:00
Ian Rodney
46a9574c84
[Docker] Explain how to update tagging lambda (#24862)
Explains how to replace the existing lambda when the code changes.
2022-05-16 16:16:49 -07:00
Siyuan (Ryans) Zhuang
2766284b14
[workflow] Update workflow doc and examples (#24804)
* update doc of workflow options

* update examples and make sure they are working
2022-05-16 15:41:14 -07:00
Edward Oakes
86422a5e4b
[minor] Fix black version check in ci/lint/format.sh (#24852)
The `black` version string differs based on installation method. On my (m1) laptop:
```
$ black --version
black, version 21.7b0
```

On @simon-mo's (intel) and @shrekris-anyscale's (m1) laptops:
```
$ black --version
black, 21.12b0 (compiled: no)
```

This adds a conditional in `ci/lint/format.sh` to handle both.
2022-05-16 16:40:21 -05:00
Chen Shen
2e53f48188
[python3.10] build python310 wheels (#24829)
build python3.10 wheels for linux windows and mac.
2022-05-16 12:36:33 -07:00
Sihan Wang
830af1f14d
[Serve/Doc] Add combine nodes with same input in parallel pattern (#24760) 2022-05-16 11:00:54 -07:00
Edward Oakes
5685d2e0b6
[serve][docs] Rework landing page to match Tune's structure (#24693)
Updates the landing page to match the format and content of Tune's. Added some shorter quickstarts and sharpened up the messaging in our "Why choose Serve?" section, those are the main content changes.

I also moved all of the `doc_code` into one directory and added a bazel target that should run all of the examples added there. Split into a separate PR: https://github.com/ray-project/ray/pull/24736.
2022-05-16 11:38:43 -05:00
Edward Oakes
f99aa5cb40
[serve][docs] Unify doc_code directories and add bazel target (#24736)
Split off from https://github.com/ray-project/ray/pull/24693/, unifying the redundant directories we had and making sure all `serve/doc_code` snippets are run in CI.
2022-05-16 09:49:42 -05:00
SangBin Cho
b9c30529d8
[Core/Observability 1/N] Add a "running" state to task status (#24651)
This PR adds 2 more states into TaskStatus

enum TaskStatus {
  // The task is scheduled properly and waiting for execution.
  // It includes time to deliver the task to the remote worker + queueing time
  // from the execution side.
  WAITING_FOR_EXECUTION = 5;
  // The task that is running.
  RUNNING = 6;
}
2022-05-16 05:39:05 -07:00
Sven Mika
0cd7bc4054
[RLlib] Re-establish dashboard performance tests. (#24728) 2022-05-16 13:13:49 +02:00
Kai Fricke
96da5dc776
[rllib] Fix some missing agent->algorithm doc changes (#24841)
#24797 missed some doc changes that popped up in broken linkcheck. Note that there could be others that were not caught by this.
2022-05-16 11:52:49 +01:00
Jiajun Yao
6f14b6a9c3
[Release Test] Add smoke_test field to release test report (#24749)
Distinguish smoke test and normal test.
2022-05-16 10:38:54 +01:00
Jun Gong
68a9a33386
[RLlib] Retry agents -> algorithms. with proper doc changes this time. (#24797) 2022-05-16 09:45:32 +02:00
Qing Wang
d40fa391a5
[RuntimeEnv][Java] Support runtime env jars for job. (#24725)
This PR supports specifying the  jars(or zip packages) for a job, which are used for all workers for this job.

You can specify jars or zips in the config file of your job:
```yml
ray {
  job {
    runtime-env: {
         "jars": [
            "https://my_host/a.jar",
            "https://my_host/b.jar"
         ]
    }
  }
}
```
or via system properties:
```java
System.setProperty("ray.job.runtime-env.jars.0", "https://my_host/a.jar");
System.setProperty("ray.job.runtime-env.jars.1", "https://my_host/a.jar");
Ray.init();
// all workers of this job will add a.jar and b.jar into the classpath.
```
2022-05-16 15:07:02 +08:00
Jiajun Yao
863943a540
Add perf alert for shuffle tests (#24798)
Add perf alert for shuffle tests so we can catch #24740 earlier.
2022-05-15 21:50:18 -07:00
Yi Cheng
6df45f0978
[core][1/2] Resubscribe when GCS restarts for raylet. (#24628)
## Why are these changes needed?

<!-- Please give a short summary of the change and the problem this solves. -->
This PR fixes the path to resubscribe to GCS when GCS restarts.

When GCS restarts, it'll lose all subscription information since everything is stored in memory. Then in the runtime, we need to tell GCS what's currently being subscribed.

The previous method:
- We'll have a thread in core worker/raylet to check whether the GCS restarted or not.
- If it restarted, we'll send resubscribe request to GCS.

However, this is not working in these cases:
- GCS restarts happen so fast so the checker in raylet/core worker missed them.
- GCS doesn't restart, but just being lag due to network issues then, the resubscribe is not necessary.

Actually, GCS knows when a resubscribe is needed: when it restarts. So the PR here is to send a resubscribe request from GCS -> Raylet and Raylet will do the resubscription.

There are two parts for this to work:

- [x] raylet send resubscription
- [ ] raylet ask core worker to send resubscription
2022-05-15 18:25:58 -07:00
Eric Liang
3f5d870541
[minor] Use np.searchsorted to speed up random access dataset (#24825) 2022-05-15 18:10:17 -07:00
Ofey Chan
c6c72a6f89
[Doc] [Core] Enhance actor queue doc code (#24532)
Why are these changes needed?
Current documentation code in Message passing using Ray Queue can be enhanced, for better demonstration of the message queue.

It creates 10 tasks but only 2 consumers, and each consumer consumes one task then exit. Therefore, the output is a bit vague:

(consumer pid=1022727) got work 0
(consumer pid=1022595) got work 1
So I make consumer working until the queue is empty. The output shows consumer 1 and 2 working in parallel:

(consumer pid=1030876) consumer 0 got work 0
(consumer pid=1030876) consumer 0 got work 1
(consumer pid=1030876) consumer 0 got work 3
(consumer pid=1030876) consumer 0 got work 5
(consumer pid=1030876) consumer 0 got work 7
(consumer pid=1030876) consumer 0 got work 9
(consumer pid=1030949) consumer 1 got work 2
(consumer pid=1030949) consumer 1 got work 4
(consumer pid=1030949) consumer 1 got work 6
(consumer pid=1030949) consumer 1 got work 8
P.S. Also fix a typo in doc.
2022-05-15 17:38:21 -07:00
Kai Fricke
3f9eea00af
[ci/linkcheck] Fix broken gym envs link (#24817)
These are currently broken in CI.
2022-05-15 18:59:31 +01:00
Artur Niederfahrenhorst
b1bc435adc
[RLlib] Policy Server/Client metrics reporting fix (#24783) 2022-05-15 17:25:25 +02:00
Steven Morad
6321c3a85c
[RLlib] Simple-Q TrainerConfig (#24583) 2022-05-15 17:24:01 +02:00
Steven Morad
5c96e7223b
[RLlib] SimpleQ (minor cleanups) and DQN TrainerConfig objects. (#24584) 2022-05-15 16:14:43 +02:00
Kai Fricke
de69b0d6d6
[train/release] Fix horovod user test master app config (#24734) 2022-05-14 21:20:45 -07:00
Eric Liang
9381dd174e
[docs] Fix broken code example in docstring for DataParallelTrainer args 2022-05-14 20:48:45 -07:00
Yi Cheng
684e395c5d
Revert "Revert "[core] Move reconnection to RPC layer for GCS client."" (#24764)
* Revert "Revert "[core] Move reconnection to RPC layer for GCS client. (#24330)" (#24762)"

This reverts commit 30f370bf1f.
2022-05-14 20:35:40 -07:00
Clark Zinzow
8e8deaeafd
[Datasets] Add example protocol for reading canned in-package example data. (#24800)
Providing easy-access datasets is table stakes for a good Getting Started UX, but even with good in-package data, it can be difficult to make these paths accessible to the user. This PR adds an "example://" protocol that will resolve passed paths directly to our canned in-package example data.
2022-05-14 11:11:24 -07:00
Kai Yang
f5c6c7d28f
[Core] Allow failing new tasks immediately while the actor is restarting (#22818)
Currently, when an actor has `max_restarts` > 0 and has crashed, the actor will enter RESTARTING state and then ALIVE. Imagine this scenario: an online service provides HTTP service and the proxy actor receives requests, forwards them to worker actors, and replies to clients with the execution results from worker actors.

```
                                                        -> Worker A (actor)
                                                       /
                                                      /
HTTP requests -------> Proxy (actor with HTTP server) ---> Worker B (actor)
                                                      \
                                                       \
                                                        -> ...
```

For each HTTP request, the proxy picks one worker (e.g. worker A) based on some algorithm, sends the request to it, and calls `ray.get()` to wait for the result. If for some reason the picked worker crashed, Ray will restart the actor, and `ray.get()` will throw an error. The proxy may pick another worker (e.g. worker B) and re-send the request to it. This is OK.

But new requests keep coming. The proxy may pick worker A again. But because worker A is still in RESTARTING state, it's not ready to serve requests. `ray.get()` on subsequent requests sent to worker A will hang until worker A is back online (ALIVE state). The proxy won't be able to reschedule these requests to another worker because currently there's no way to know if worker A is alive or not before sending a request. We can't say worker A is not alive just based on whether `ray.get()` hangs either.

To solve this issue, we change the semantics of `max_task_retries`.

* When max_task_retries is 0 (which is the default value), if the callee actor is in the RESTARTING state, subsequently submitted tasks will fail immediately with a RayActorError. Users can catch the RayActorError and implement their own fallback strategies to improve service availability and mitigate service outages.
* When max_task_retries is not 0, subsequently submitted tasks will be queued on the caller side and we only send them to the callee when the callee actor is back to the ALIVE state.

TODO

- [x] Add test cases.
- [ ] Update docs.
- [x] API change review.
2022-05-14 10:48:47 +08:00
Richard Liaw
41de6acd10
[air] fix-docs (#24792)
Signed-off-by: Richard Liaw <rliaw@berkeley.edu>
2022-05-13 15:58:31 -07:00
Clark Zinzow
761cfb9238
[Datasets] Add more example data. (#24795)
This PR adds more example data for ongoing feature guide work. In addition to adding the new datasets, this also puts all example data under examples/data in order to separate it from the example code.
2022-05-13 15:07:49 -07:00
Simon Mo
9f23affdc0
[Hotfix] Unbreak lint in master (#24794) 2022-05-13 15:05:05 -07:00
Yi Cheng
68384ec745
[ci] Add flag for staging tests and disable the unstable one. (#24745)
This PR tries to add a prefix for the staging ci test. This is useful to separate staging tests from stable tests in https://flakey-tests.ray.io/
2022-05-13 13:48:14 -07:00
Jun Gong
bc3a1d35cf
[RLlib] Introduce new policy base classes. (#24742) 2022-05-13 21:48:30 +02:00