Commit graph

12778 commits

Author SHA1 Message Date
Clark Zinzow
0b6505e8c6
[Datasets] Miscellaneous GA docs P0s. (#24891)
This PR knocks off a few miscellaneous GA docs P0s given in our docs tracker. Namely:

- Documents Datasets resource allocation model.
- De-emphasizes global/windowed shuffling.
- Documents lazy execution mode, and expands our execution model docs in general.
2022-05-18 16:17:48 -07:00
mwtian
b17cbd825f
[Core] fix prometheus export error and move GCS client heartbeat to a dedicated thread. (#24867)
I have seen errors where the prometheus view data dictionary is changed when iterating over it. So make a copy (which is atomic) before iterating.

Also, use a separate thread for GCS client heartbeat RPC. This avoids the issue of missing heartbeat when raylet is too busy.
2022-05-18 15:04:04 -07:00
SangBin Cho
2fa7a00588
[State Observability] Support output formatting (#24847)
This PR supports various output formatting. By default, we support yaml format. But this can be changed depending on the UX research we will conduct in the future.

1cb0f4b51a5799e0360a66db01000000:
  actor_id: 1cb0f4b51a5799e0360a66db01000000
  class_name: A
  state: ALIVE
f90ba34fa27f79a808b4b5aa01000000:
  actor_id: f90ba34fa27f79a808b4b5aa01000000
  class_name: A
  state: ALIVE
Table format is not supported yet. We will support this once we enhance the API output (which I will create an initial API review soon).
2022-05-18 15:00:40 -07:00
Dmitri Gekhtman
448f5273bc
[KubeRay][Autoscaler] Enable launching nodes in the main thread. (#24718)
This PR adds a flag to enable creating nodes in the main thread in the autoscaler. The flag is turned on for the KubeRay node provider. KubeRay already uses a flag to disable node updater threads -- with the changes from this PR, the autoscaler becomes single-threaded when launching on KubeRay.
2022-05-18 14:37:19 -07:00
Jian Xiao
9fe4dba4ad
Revamp the Getting Started page for Dataset (#24860)
This is part of the Dataset GA doc fix effort to update/improve the documentation.
This PR revamps the Getting Started page.

What are the changes:
- Focus on basic/core features that are bread-and-butter for users, leave the advanced features out
- Focus on high level introduction, leave the detailed spec out (e.g. what are possible batch_types for map_batches() API)
- Use more realistic (yet still simple) data example that's familiar to people (IRIS dataset in this case)
- Use the same data example throughout to make it context-switch free
- Use runnable code rather than faked
- Reference to the code from doc, instead of inlining them in the doc

Co-authored-by: Ubuntu <ubuntu@ip-172-31-32-136.us-west-2.compute.internal>
Co-authored-by: Eric Liang <ekhliang@gmail.com>
2022-05-18 13:46:23 -07:00
Jiajun Yao
5128029644
Fix pull manager deadlock due to object reconstruction (#24791)
When an object is under reconstruction, pull manager keeps the bundle request active with no timeout, which may block the next bundle request that's needed for the object reconstruction. As a result, we have deadlock.

For example, task 1 takes object A as argument and returns object B, task 2 takes object B as argument. When we run task 2, pull manager will add B to the queue and then B is lost. In this case, task 1 is re-submitted and A is added the the pull manager queue after B (assuming both tasks are scheduled to the same node). Due to limited available object store memory, A cannot be activated until B is pulled but B cannot be pulled until A is pulled and B is reconstructed.

The solution is that if an active pull request has pending-creation objects, pull manager will deactivates it until creation is done. This way, we will free object store memory occupied by the current active pull request so that next requests can proceed and potentially unblock the object creation.
2022-05-18 13:43:23 -07:00
Kai Fricke
41b98b1b61
[ci/py310] Fix docker image build/tag (#24922)
We're currently not building the 3.9/3.10 ray-ml docker images, but we're still trying to tag/push them.
2022-05-18 18:36:37 +01:00
Sven Mika
628ee4b5f0
[RLlib] Bandit tf2 fix (+ add tf2 to test cases). (#24908) 2022-05-18 18:58:42 +02:00
SangBin Cho
fb60d68bbb
[WIP] Run minimal tests against all supported python version (#24830)
Run minimal CI tests to all Python versions.
2022-05-18 09:42:26 -07:00
SangBin Cho
f228245520
[Placement group] Update the old placement group API usage to the new scheduling_strategy based API (#24544)
Documentation should use the new API, not the old one that will be deprecated
2022-05-18 09:41:51 -07:00
Qing Wang
eb29895dbb
[Core] Remove multiple core workers in one process 1/n. (#24147)
This is the 1st PR to remove the code path of multiple core workers in one process. This PR is aiming to remove the flags and APIs related to `num_workers`.
After this PR checking in, we needn't to consider the multiple core workers any longer.

The further following PRs are related to the deeper logic refactor, like eliminating the gap between core worker and core worker process,  removing the logic related to multiple workers from workerpool, gcs and etc.

**BREAK CHANGE**
This PR removes these APIs:
- Ray.wrapRunnable();
- Ray.wrapCallable();
- Ray.setAsyncContext();
- Ray.getAsyncContext();

And the following APIs are not allowed to invoke in a user-created thread in local mode:
- Ray.getRuntimeContext().getCurrentActorId();
- Ray.getRuntimeContext().getCurrentTaskId()

Note that this PR shouldn't be merged to 1.x.
2022-05-19 00:36:22 +08:00
Antoni Baum
1d5e6d908d
[AIR] HuggingFace Text Classification example (#24402) 2022-05-18 09:35:12 -07:00
Chen Shen
1325cf7876
[python3.10] Build py310 images (#24859)
Build python 3.10 images so we can run release tests.
2022-05-18 08:48:20 -07:00
Kai Fricke
c3d54de9ee
[ci] Fix runtime env tests (#24912)
This fixes failing tests from #24894
2022-05-18 11:51:07 +01:00
Amog Kamsetty
d73572dde3
[AIR] Add trainer_resources as a valid scaling config key for all Trainers
trainer_resources should be a valid scaling config key for all Trainers.
2022-05-18 11:15:53 +01:00
Max Pumperla
3ffcb81bd3
[docs] remove non-functional lbfgs example (#24727)
This example simply doesn't run as is. We can bring it back up again later, if it makes sense. But it's not clear what the variables used there, like actor are. Fixes #21328

Signed-off-by: Max Pumperla <max.pumperla@googlemail.com>
2022-05-18 10:53:14 +01:00
Max Pumperla
7844aeafde
[docs] add robots txt (#24726)
as per discussion on slack, this should avoid having old versions of the docs indexed by search engines, see readthedocs/readthedocs.org#2430 for reference.

Signed-off-by: Max Pumperla <max.pumperla@googlemail.com>
2022-05-18 10:52:22 +01:00
Sven Mika
8f50087908
[RLlib] AlphaZero uses training_iteration API. (#24507) 2022-05-18 09:58:25 +02:00
Nathan Matare
012a4c8667
[RLlib] Allow passing **kwargs to action distribution. (#24692) 2022-05-18 09:22:37 +02:00
Simon Mo
9b2086c726
[Serve] Alias ray.serve.dag.InputNode (#24630) 2022-05-17 22:35:51 -07:00
Clark Zinzow
26ea82d3a6
[Datasets] Add basic data ecosystem overview, user guide links, other data processing options card. (#23346) 2022-05-17 20:57:42 -07:00
Simon Mo
c3ac6fcf3f
Bump Ray Version from 2.0.0.dev0 to 3.0.0.dev0 (#24894) 2022-05-17 19:31:05 -07:00
Clark Zinzow
4444150c29
[Datasets] Overhaul of "Creating Datasets" feature guide. (#24831)
This PR is a general overhaul of the "Creating Datasets" feature guide, providing complete coverage of all (public) dataset creation APIs and highlighting features and quirks of the individual APIs, data modalities, storage backends, etc. In order to keep the page from getting too long and keeping it easy to navigate, tabbed views are used heavily.
2022-05-17 16:23:42 -07:00
Clark Zinzow
68d4dd3a8b
[Datasets] Add explicit resource allocation option via a top-level scheduling strategy (#24438)
Instead of letting Datasets implicitly use cluster resources in the margins of explicit allocations of other libraries, such as Tune, Datasets should provide an option for explicitly allocating resources for a Datasets workload for users that want to box Datasets in. This PR adds such an explicit resource allocation option, via exposing a top-level scheduling strategy on the DatasetContext with which a placement group can be given.
2022-05-17 15:01:15 -07:00
Jian Xiao
f86d5461c6
[Datasets] [CI] fix CI of dataset test (#24883)
CI test is broken by f61caa3. This PR fixes it.
2022-05-17 14:00:01 -07:00
SangBin Cho
6d978ab10e
[Core/Metrics] Accurately record used memory. (#24648)
Why are these changes needed?
used_memory_ includes the fallback allocation, so we should subtract it here to calculate the exact available memory.
2022-05-17 13:21:24 -07:00
Eric Liang
437df9431c
[docs] Remove bad suggestions to use local_mode or num_cpus in init (#24827) 2022-05-17 12:55:04 -07:00
Clark Zinzow
b1acf69a8a
Map progress bar title; pretty repr for rows. (#24672) 2022-05-17 12:24:36 -07:00
Kai Fricke
a0bba30153
[tune/release] Make long running distributed PBT cheaper (#24782)
The test currently uses 6 GPUs out of 8 available, so we can get rid of one instance.

Savings will be 25% for one instance less (3 instead of 4).
2022-05-17 18:23:31 +01:00
Kai Fricke
01af9c8c77
[tune] Fix has_resources_for_trial, leading to trials stuck in PENDING mode (#24878)
Tune resource bookkeeping was broken. Specifically, this is what happened in the repro provided in #24259:

- Only one PG can be scheduled per time
- We staged resources for trial 1
- We run trial 1
- We stage resources for trial 2
- We pause trial 1, caching the placement group
- This removes the staged PG for trial 2 (as we return the PG for trial 1)
- However, now we `reconcile_placement_groups`, which re-stages a PG
- both trial 1 and trial 2 are now not in `RayTrialExecutor._staged_trials`
- A staging future is still there because of the reconciliation

This PR fixes this problem in two ways. `has_resources_per_trial` will check a) also for staging futures for the specific trial, and b) will also consider cached placement groups.

Generally, resource management in Tune is convoluted and hard to debug, and several classes share bookkeeping responsibilities (runner, executor, pg manager). We should refactor this.
2022-05-17 18:21:45 +01:00
mwtian
36d6d59169
[Datasets] mark nightly test dataset_shuffle_random_shuffle_1tb_small_instances stable #24861 2022-05-17 09:56:05 -07:00
Robert
f61caa349c
Implement random_sample() (#24492) 2022-05-17 09:47:53 -07:00
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