Commit graph

6838 commits

Author SHA1 Message Date
SangBin Cho
c9cec443dd
[State Observability] Improve existing state output (#25184)
NOTE: This is not the official API improvement. But this will help dogfooding the feature before finalizing the output.

This PR improves the output state/metadata of existing state APIs.
2022-05-30 07:25:28 -07:00
Stephanie Wang
009df65a57
[core] Fix bug in spilling objects that have empty data field (#25192)
Ray sometimes stores errors as the object value in shared memory. These objects have no data since the error is stored in the metadata field. #25085 describes a bug where these objects fail to spill because the IO worker assumes that the data field must be non-empty. This would cause head-of-line blocking for any other objects to spill and cause the whole job to hang. This PR fixes the issue by spilling these objects anyway.
Related issue number

Closes #25085.
2022-05-27 17:18:45 -07:00
Balaji Veeramani
fb22bc5ae3
[AIR] Fix bug where TensorflowPredictor.predict creates extra axis (#25199) 2022-05-27 13:46:12 -07:00
Stephanie Wang
61676f26d3
Revert "Revert "[dataset] Use polars for sorting (#24523)" (#24781)" (#25173)
Polars is significantly faster than the current pyarrow-based sort. This PR uses polars for the internal sort implementation if available. No API changes needed.

On my laptop, this makes sorting 1GB about 2x faster:

without polars

$ python release/nightly_tests/dataset/sort.py --partition-size=1e7 --num-partitions=100
Dataset size: 100 partitions, 0.01GB partition size, 1.0GB total
Finished in 50.23415923118591
...
Stage 2 sort: executed in 38.59s

        Substage 0 sort_map: 100/100 blocks executed
        * Remote wall time: 864.21ms min, 1.94s max, 1.4s mean, 140.39s total
        * Remote cpu time: 634.07ms min, 825.47ms max, 719.87ms mean, 71.99s total
        * Output num rows: 1250000 min, 1250000 max, 1250000 mean, 125000000 total
        * Output size bytes: 10000000 min, 10000000 max, 10000000 mean, 1000000000 total
        * Tasks per node: 100 min, 100 max, 100 mean; 1 nodes used

        Substage 1 sort_reduce: 100/100 blocks executed
        * Remote wall time: 125.66ms min, 2.3s max, 1.09s mean, 109.26s total
        * Remote cpu time: 96.17ms min, 1.34s max, 725.43ms mean, 72.54s total
        * Output num rows: 178073 min, 2313038 max, 1250000 mean, 125000000 total
        * Output size bytes: 1446844 min, 18793434 max, 10156250 mean, 1015625046 total
        * Tasks per node: 100 min, 100 max, 100 mean; 1 nodes used

with polars

$ python release/nightly_tests/dataset/sort.py --partition-size=1e7 --num-partitions=100
Dataset size: 100 partitions, 0.01GB partition size, 1.0GB total
Finished in 24.097432136535645
...
Stage 2 sort: executed in 14.02s

        Substage 0 sort_map: 100/100 blocks executed
        * Remote wall time: 165.15ms min, 595.46ms max, 398.01ms mean, 39.8s total
        * Remote cpu time: 349.75ms min, 423.81ms max, 383.29ms mean, 38.33s total
        * Output num rows: 1250000 min, 1250000 max, 1250000 mean, 125000000 total
        * Output size bytes: 10000000 min, 10000000 max, 10000000 mean, 1000000000 total
        * Tasks per node: 100 min, 100 max, 100 mean; 1 nodes used

        Substage 1 sort_reduce: 100/100 blocks executed
        * Remote wall time: 21.21ms min, 472.34ms max, 232.1ms mean, 23.21s total
        * Remote cpu time: 29.81ms min, 460.67ms max, 238.1ms mean, 23.81s total
        * Output num rows: 114079 min, 2591410 max, 1250000 mean, 125000000 total
        * Output size bytes: 912632 min, 20731280 max, 10000000 mean, 1000000000 total
        * Tasks per node: 100 min, 100 max, 100 mean; 1 nodes used

Related issue number

Closes #23612.
2022-05-27 10:43:51 -07:00
Jiao
820cf4fdca
[Deployment Graph] Simplify our use of DeploymentSchema (#25202) 2022-05-27 10:35:32 -07:00
Balaji Veeramani
692335440b
[AIR] Directly convert TorchPredictor ndarray inputs to tensors (#25190)
If you pass a multidimensional input to `TorchPredictor.predict`, AIR errors. For more information about the error, see #25194.

Co-authored-by: Amog Kamsetty <amogkamsetty@yahoo.com>
2022-05-27 09:46:47 -07:00
Yi Cheng
0bc04f263e
[core] Remove gcs addr updater in core worker. (#24747)
Since we are using domain name resolution to get the new address of GCS, gcs addr updator is not necessary any more. This PR removed that.
2022-05-26 23:38:19 -07:00
shrekris-anyscale
3234fd3db4
[CI] Bump Bazel version to 4.2.2 (#24242) 2022-05-26 17:09:40 -07:00
Balaji Veeramani
f623c607f2
[AIR] Build model in TensorflowPredictor.predict (#25136)
`TensorflowPredictor.predict` doesn't work right now. For more information, see #25125.

Co-authored-by: Amog Kamsetty <amogkamsetty@yahoo.com>
2022-05-26 16:42:09 -07:00
Antoni Baum
087e356613
[CI] Make certain AIR tests run (#25229)
Fixes certain AIR tests not running and fixes broken tests.
2022-05-26 15:49:39 -07:00
Balaji Veeramani
59e624348e
[AIR] Run test_torch_predictor.py tests and fix failing test_init (#25207)
The tests in `test_torch_predictor.py` weren't in running CI. Also `test_torch_predictor.py::test_init` was failing.

Co-authored-by: Amog Kamsetty <amogkamsetty@yahoo.com>
2022-05-26 15:15:20 -07:00
Balaji Veeramani
1ad5e619e1
[AIR] Run test_tensorflow_predictors.py and fix failing tests (#25208)
`test_tensorflow_predictors` wasn't running in CI. This fixes that and also fixes broken tests.

Co-authored-by: Amog Kamsetty <amogkamsetty@yahoo.com>
2022-05-26 15:15:03 -07:00
Eric Liang
d2f0c3b2f6
Clean up docstyle in data, ml, and tune packages (#25188) 2022-05-26 14:27:20 -07:00
Kai Fricke
d0dfac592a
[tune] Allow iterators in tune.grid_search (#25220)
`tune.choice` already accepts iterables, the same should be true for `tune.grid_search`.
2022-05-26 17:32:39 +02:00
Yi Cheng
7fcea8a8ae
up (#25211) 2022-05-26 07:53:16 -07:00
Kai Fricke
6dac517554
[ci] Protobuf < 4 only in requirements.txt to unblock CI (#25214) 2022-05-26 11:18:14 +02:00
mwtian
fb2933a78f
Revert "Revert "Revert "[Datasets] [Tensor Story - 1/2] Automatically provide tensor views to UDFs and infer tensor blocks for pure-tensor datasets."" (#25031)" (#25057)
Reverts #25031

It looks to be still somewhat flaky.
2022-05-25 19:43:22 -07:00
Yi Cheng
dd3a43b901
[core] Add timeout and asyncio for internal kv. (#25126)
This PR adds timeout and asyncio for internal KV. This only applies to gcs_utils and not ray clients for now since this is purely for ray internal usage.
2022-05-25 18:09:11 -07:00
Stephanie Wang
5cee6135b4
[core] Fix bugs in data locality (#24698) (#25092)
Redo for PR #24698:

This fixes two bugs in data locality:

    When a dependent task is already in the CoreWorker's queue, we ran the data locality policy to choose a raylet before we added the first location for the dependency, so it would appear as if the dependency was not available anywhere.
    The locality policy did not take into account spilled locations.

Added C++ unit tests and Python tests for the above.

Split test_reconstruction to avoid test timeout. I believe this was happening because the data locality fix was causing extra scheduler load in a couple of the reconstruction stress tests.
2022-05-25 10:33:49 -07:00
Jiajun Yao
be93bb340d
Remove MLDataset (#25041)
MLDataset is replaced by Ray Dataset.
2022-05-25 09:33:29 -07:00
Kai Fricke
833e357a1f
[air] Do not use gzip for checkpoint dict conversion (#25177)
Gzipping binary data is inefficient and slows down data transfer significantly.
2022-05-25 17:11:00 +02:00
Kai Fricke
67cd984b92
[tune] Add annotations/set scope for Tune classes (#25077)
This PR adds API annotations or changes the scope of several Ray Tune library classes.
2022-05-25 15:21:28 +02:00
Yi Cheng
af895b3676
[gcs] Fix detached actor fail to restart when GCS restarted. (#25131)
When loading the data from GCS, for detached actors, we treat it the same as normal actors.
But the detached actor lives beyond the job's scope and should be loaded even when the job is finished.
This PR fixed it.
2022-05-25 01:58:52 -07:00
Siyuan (Ryans) Zhuang
f67871c1f7
[workflow] Fast workflow indexing (#24767)
* workflow indexing

* simplify workflow storage API

* Only fix workflow status when updating the status.

* support status filter
2022-05-24 20:21:08 -07:00
mwtian
fa32cb7c40
Revert "[core] Resubscribe GCS in python when GCS restarts. (#24887)" (#25168)
This reverts commit 7cf4233858.
2022-05-24 18:13:40 -07:00
Stephanie Wang
c8765385cb
[datasets] Fix scheduling strategy propagation and stats collection in push-based shuffle (#25108)
This fixes two bugs in Datasets push-based shuffle:

    Scheduling strategy specified by the caller was not getting propagated correctly to the map stage in push-based shuffle. This is because the map and reduce stages shared the same ray.remote options dict, and we deleted the caller-specified scheduling strategy from the reduce stage so that we could specify a NodeAffinitySchedulingStrategy instead.
    We were only reporting partial stats for the merge stage.

Related issue number

Issue 1 is necessary for performance at large-scale (#24480).
2022-05-24 18:01:40 -07:00
Balaji Veeramani
f032849aa2
[AIR] Don't ravel predictions in TensorflowPrediction.predict (#25138)
`TensorflowPredictor.predict` doesn't correctly produce logits. For more information, see #25137.
2022-05-24 17:38:48 -07:00
xwjiang2010
51dbd99a25
[air] Minor Doc updates (#25097)
Update a few docs and param names.
2022-05-24 17:15:03 -07:00
Philipp Moritz
323605d169
Support file:// for runtime_env working directories in jobs (#25062)
This makes it possible to use an NFS file system that is shared on a cluster for runtime_env working directories.

Co-authored-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com>
Co-authored-by: Eric Liang <ekhliang@gmail.com>
2022-05-24 16:17:18 -07:00
Jiao
f27e85cd7d
[Serve][Deployment Graph][Perf] Add minimal executor DAGNode (#24754)
closes #24475

Current deployment graph has big perf issues compare with using plain deployment handle, mostly because overhead of DAGNode traversal mechanism. We need this mechanism to empower DAG API, specially deeply nested objects in args where we rely on pickling; But meanwhile the nature of each execution becomes re-creating and replacing every `DAGNode` instances involved upon each execution, that incurs overhead.

Some overhead is inevitable due to pickling and executing DAGNode python code, but they could be quite minimal. As I profiled earlier, pickling itself is quite fast for our benchmarks at magnitude of microseconds.

Meanwhile the elephant in the room is DeploymentNode and its relatives are doing too much work in constructor that's beyond necessary, thus slowing everything down. So the fix is as simple as 

1) Introduce a new set of executor dag node types that contains absolute minimal information that only preserves the DAG structure with traversal mechanism, and ability to call relevant deployment handles.
2) Add a simple new pass in our build() that generates and replaces nodes with executor dag to produce a final executor dag to run the graph.

Current ray dag -> serve dag mixed a lot of stuff related to deployment generation and init args, in longer term we should remove them but our correctness depends on it so i rather leave it as separate PR.

### Current 10 node chain with deployment graph `.bind()`
```
chain_length: 10, num_clients: 1
latency_mean_ms: 41.05, latency_std_ms: 15.18
throughput_mean_tps: 27.5, throughput_std_tps: 3.2
```

### Using raw deployment handle without dag overhead
```
chain_length: 10, num_clients: 1
latency_mean_ms: 20.39, latency_std_ms: 4.57
throughput_mean_tps: 51.9, throughput_std_tps: 1.04
```

### After this PR:
```
chain_length: 10, num_clients: 1
latency_mean_ms: 20.35, latency_std_ms: 0.87
throughput_mean_tps: 48.4, throughput_std_tps: 1.43
```
2022-05-24 13:23:38 -05:00
shrekris-anyscale
8b3451318c
[Serve] Update Serve status formatting and processing (#24839) 2022-05-24 11:07:41 -07:00
Kai Fricke
aaee8f09f1
[tune/train] Consolidate checkpoint manager 1: Common checkpoint manager class (#24771)
This PR consolidates the Ray Train and Tune checkpoint managers. These concepts previously did something very similar but in different modules. To simplify maintenance in the future, we've consolidated the common core.

- This PR keeps full compatibility with the previous interfaces and implementations. This means that for now, Train and Tune will have separate CheckpointManagers that both extend the common core
- This PR prepares Tune to move to a CheckpointStrategy object
- In follow-up PRs, we can further unify interfacing with the common core, possibly removing any train- or tune-specific adjustments (e.g. moving to setup on init rather on runtime for Ray Train)

The consolidation is split into three PRs:

1. This PR - adds a common checkpoint manager class.
2. #24772 - based on this PR, adds the integration for Ray Train
3. #24430 - based on #24772, adds the integration for Ray Tune
2022-05-24 19:07:12 +01:00
Jimmy Yao
9e3c88d727
[GCP] Update TPU Region (#25123)
changed, there is no `central_f1` now.
2022-05-24 09:38:06 -07:00
SangBin Cho
a7e759317b
[State Observability API] Error handling (#24413)
This improves error handling per https://docs.google.com/document/d/1IeEsJOiurg-zctOcBjY-tQVbsCmURFSnUCTkx_4a7Cw/edit#heading=h.pdzl9cil9e8z (the RPC part).

Semantics
If all queries to the source failed, raise a RayStateApiException.

If partial queries are failed, warnings.warn the partial failure when print_api_stats=True. It is true for CLI. It is false when it is used within Python API or json / yaml format is required.
2022-05-24 03:56:49 -07:00
Adrish Dey
e7e75b46e1
[tune] rolling back wandb service. replacing deprecated wandb methods (#25132)
Follow up: #24017

Briefly, wandb service is still in experimental stage, and is not ready to be released as an integration without extensive testing. Hence, we are interested in rolling back the update to the integration we made recently, until this feature is ready to be shipped.
2022-05-24 11:22:11 +01:00
Gagandeep Singh
5b9b4fa018
Ignore previous tasks before submitting ones via map and map_unordered (#23684) 2022-05-24 00:20:58 -07:00
Dmitri Gekhtman
806c187878
[autoscaler] Flush stdout and stdin when running commands. (#19473)
Flush command stdout/stderr before exiting CommandRunner.run, so that setup command output is less likely to get swallowed.
2022-05-23 23:17:30 -07:00
xwjiang2010
8703d5e9d0
[air preprocessor] Add limit to OHE. (#24893) 2022-05-23 22:37:15 -07:00
Yi Cheng
7cf4233858
[core] Resubscribe GCS in python when GCS restarts. (#24887)
This is a follow-up PRs of https://github.com/ray-project/ray/pull/24813 and https://github.com/ray-project/ray/pull/24628

Unlike the change in cpp layer, where the resubscription is done by GCS broadcast a request to raylet/core_worker and the client-side do the resubscription, in the python layer, we detect the failure in the client-side.

In case of a failure, the protocol is:

1. call subscribe
2. if timeout when doing resubscribe, throw an exception and this will crash the system. This is ok because when GCS has been down for a time longer than expected, we expect the ray cluster to be down.
3. continue to poll once subscribe ok.

However, there is an extreme case where things might be broken: the client might miss detecting a failure.

This could happen if the long-polling has been returned and the python layer is doing its own work. And before it sends another long-polling, GCS restarts and recovered. 

Here we are not going to take care of this case because:
1. usually GCS is going to take several seconds to be up and the python layer's work is simply pushing data into a queue (sync version). For the async version, it's only used in Dashboard which is not a critical component.
2. pubsub in python layer is not doing critical work: it handles logs/errors for ray job;
3. for the dashboard, it can just restart to fix the issue.


A known issue here is that we might miss logs in case of GCS failure due to the following reasons:

- py's pubsub is only doing best effort publishing. If it failed too many times, it'll skip publishing the message (lose messages from producer side)
- if message is pushed to GCS, but the worker hasn't done resubscription yet, the pushed message will be lost (lose messages from consumer side)

We think it's reasonable and valid behavior given that the logs are not defined to be a critical component and we'd like to simplify the design of pubsub in GCS.

Another things is `run_functions_on_all_workers`. We'll plan to stop using it within ray core and deprecate it in the longer term. But it won't cause a problem for the current cases because:

1. It's only set in driver and we don't support creating a new driver when GCS is down.
2. When GCS is down, we don't support starting new ray workers.

And `run_functions_on_all_workers` is only used when we initialize driver/workers.
2022-05-23 13:06:33 -07:00
Antoni Baum
36b1b4ce0c
Fix filelock in _delete_path (#25093) 2022-05-23 20:58:02 +01:00
Balaji Veeramani
50c31b8466
[Data] Add partitioning classes to Data API reference (#24203) 2022-05-23 09:34:41 -07:00
shrekris-anyscale
b9fb902a4b
Revert "[serve] Use soft constraint for placing controller on the head node (#24934)" (#25050)
This reverts commit 737d16328c.
2022-05-23 11:31:23 -05:00
Sven Mika
37799751df
[Serve + RLlib] Fix serve tutorial_rllib for Win. PyGame needs to be installed as of gym==0.23. (#25080) 2022-05-23 17:43:35 +02:00
Archit Kulkarni
a67c8a0739
[runtime_env] Add temporary URI reference to prevent URI deletion before job starts (#24719)
Packages are uploaded to the GCS for `runtime_env`.  These packages are garbage collected when their refcount becomes zero.

The problem is the reference doesn't get incremented until the job starts, which happens after the package is uploaded.  It's possible for the package's refcount to go to zero in between the upload and when the job starts, causing the package to be deleted before it's needed by the job.  It's likely the cause of https://github.com/ray-project/ray/issues/23423.

We can't just increment the refcount at the time of upload, because if the script is killed before the job is started (e.g. via Ctrl-C) then the reference will never be decremented and the package will never be deleted.

The solution in this PR is to increment the refcount at the time of upload, but automatically decrement after a configurable timeout (default 30s).  This should be enough time for the job to start.  When the job starts, it increments the refcount as usual and decrements it when the job finishes or is killed.

Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
2022-05-23 10:25:04 -05:00
mwtian
50d49a2d7a
[Core] use higher niceness for workers (#24928)
Looking at past failures of dataset_shuffle_push_based_random_shuffle_1tb and when running it on my own, I noticed that raylets are killed because GCS was not able to respond to it in time. It seems at the beginning of the run, there is a huge CPU spike which starved GCS out of CPU. With the same spirit of adjusting workers to higher OOM scores, we can give workers higher niceness so they yield CPU to GCS, Raylet and other user processes.

I ran dataset_shuffle_push_based_random_shuffle_1tb a few time which no longer sees raylet death because of GCS CPU starvation. But there are other issues making the test fail which I will continue to investigate.
2022-05-23 08:12:51 -07:00
Guyang Song
c6edfdd2a0
[script] expose options of xxx_port in 'ray start' command (#24919) 2022-05-23 17:18:09 +08:00
Eric Liang
d57cdd19ac
[tune] Fix stray extra log from runtime_env setup (#25071)
commit 40774ac219
Author: Qing Wang <kingchin1218@gmail.com>
Date:   Tue May 17 11:33:59 2022 +0800

    Minor changes for Java runtime env. (#24840)

Introduced an extra log message that spams stdout when running with Tune. Move this log line to debug and add an e2e test check.
2022-05-23 09:54:24 +01:00
Sven Mika
09886d7ab8
[RLlib] Upgrade gym 0.23 (#24171) 2022-05-23 08:18:44 +02:00
Jialing He
c03d0432f3
[core] Fix Object Manager owner address after AssignOwner (#25021)
When assigning an owner for an object (different from the current worker), such as:
```python
ray.put(vaule, _owner = ACTORHANDLE)
```
Object Manager holds the wrong owner's address and updates location info to the wrong worker, making `ray.get` slow. the current master will get Timeout in this new test case.
2022-05-23 13:34:40 +08:00
Eric Liang
55d039af32
Annotate datasources and add API annotation check script (#24999)
Why are these changes needed?
Add API stability annotations for datasource classes, and add a linter to check all data classes have appropriate annotations.
2022-05-21 15:05:07 -07:00