Commit graph

6870 commits

Author SHA1 Message Date
Amog Kamsetty
c8b112ec46
[Train] Support amp for models with a custom __getstate__ method (#25335)
The current implementation of amp does not work if the model that is being wrapped defines a custom __getstate__ method. It would fail at the assertion like here: https://discuss.ray.io/t/ray-train-hangs-for-long-time/6333/7.

This PR fixes amp for this case, and adds tests for it.
2022-06-02 18:13:13 -07:00
Antoni Baum
f8551942bf
[AIR] Fix trainer allowed scaling config keys (#25350)
Adds `resources_per_worker` to allowed scaling config keys in `DataParallelTrainer` and `GBDTTrainer`.
2022-06-02 11:20:37 -07:00
shrekris-anyscale
16bdfe6a39
Restore "[Serve] Deploy Serve deployment graphs via REST API" (#25073) (#25333) 2022-06-02 11:06:53 -07:00
Stephanie Wang
ab8785ca5c
Revert "Revert "[core] Support generators for tasks with multiple return values (#25247)" (#25380)" (#25383)
Duplicate for #25247.

Adds a fix for Dask-on-Ray. Previously, for tasks with multiple return values, we implicitly allowed returning a dict with the return index as the key. This was used by Dask-on-Ray, but this is not documented behavior, and we now require task returns to be iterable instead.
2022-06-02 10:50:11 -07:00
Sihan Wang
b024a9543e
[Serve] Support scale replica down to 0 (#24892) 2022-06-02 08:06:46 -07:00
Sven Mika
e4ceae19ef
[RLlib] Move (A/DD)?PPO and IMPALA algos to algorithms dir and rename policy and trainer classes. (#25346) 2022-06-02 16:47:05 +02:00
Antoni Baum
045c47f172
[CI] Check test files for if __name__... snippet (#25322)
Bazel operates by simply running the python scripts given to it in `py_test`. If the script doesn't invoke pytest on itself in the `if _name__ == "__main__"` snippet, no tests will be ran, and the script will pass. This has led to several tests (indeed, some are fixed in this PR) that, despite having been written, have never ran in CI. This PR adds a lint check to check all `py_test` sources for the presence of `if _name__ == "__main__"` snippet, and will fail CI if there are any detected without it. This system is only enabled for libraries right now (tune, train, air, rllib), but it could be trivially extended to other modules if approved.
2022-06-02 10:30:00 +01:00
Qing Wang
64f9a9066f
[doc] Update document on ray start command. (#25306) 2022-06-02 16:42:24 +08:00
Yi Cheng
cb1f08a3c1
[core] Basic end-2-end multi-node tests for GCS HA in CI. (#25114)
In this PR we simulate the case where serve can continue to function even when GCS is down and the reconfig continue to work once GCS is back.

To make it close to the real-world case, the docker is used for isolation:

It starts a head node (0 cpus) and a worker node
It tried the basic function and make sure it's working
It kills GCS and make sure everything is working.
It starts GCS and make sure reconfig continues to work.
This is the basic cases for serve HA. We'll add more once we get better integrations.
2022-06-02 02:41:38 +00:00
Dmitri Gekhtman
e45054c130
[autoscaler][kuberay] Fix autoscaler event driver logs. Clean up entrypoint. (#25240)
This PR 
- enables piping of autoscaler events to the driver's stdout with KubeRay
- cleans up the autoscaler's startup sequence
- removes some redis references
2022-06-01 20:36:47 -04:00
Antoni Baum
70007c004e
[AIR] MultiHotEncoder and list support for encoders (#25319) 2022-06-01 17:34:41 -07:00
Yi Cheng
80168a09a6
Revert "[core] Support generators for tasks with multiple return values (#25247)" (#25380)
This reverts commit 1f9488724a.
2022-06-01 15:31:59 -07:00
SangBin Cho
49efcab4fe
Revert "[core] Remove gcs addr updater in core worker. (#24747)" (#25375)
Turns out https://github.com/ray-project/ray/pull/25342 wasn't the root cause of the ray shutdown flakiness. I realized there's another PR that could affect this test suite. Let's try reverting it and see if things get better.
2022-06-01 15:12:33 -07:00
Stephanie Wang
961b875ab8
[core] Allow user to override global default for max_retries (#25189)
This PR allows the user to override the global default for max_retries for non-actor tasks. It adds an OS env called RAY_task_max_retries which can be passed to the driver or set with runtime envs. Any future tasks submitted by that worker will default to this value instead of 3, the hard-coded default.

It would be nicer if we could have a standard way of setting these defaults, but I think this is fine as a one-off for now (not a clear need for overriding defaults of other @ray.remote options yet).
Related issue number

Closes #24854.
2022-06-01 14:42:18 -07:00
Stephanie Wang
1f9488724a
[core] Support generators for tasks with multiple return values (#25247)
Adds support for Python generators instead of just normal return functions when a task has multiple return values. This will allow developers to cut down on total memory usage for tasks, as they can free previous return values before allocating the next one on the heap.

The semantics for num_returns are about the same as usual tasks - the function will throw an error if the number of values returned by the generator does not match the number of return values specified by the user. The one difference is that if num_returns=1, the task will throw the usual Python exception that the generator cannot be pickled.

As an example, this feature will allow us to reduce memory usage in Datasets shuffle operations (see #25200 for a prototype).
2022-06-01 13:30:52 -07:00
Antoni Baum
9085ea23ab
[AIR] Improve BatchPredictor performance & disk usage (#25101)
This PR attempts to improve `BatchPredictor` performance with directory checkpoints by avoiding unnecessary filesystem operations.

In order to achieve that, the `Checkpoint` class is changed to always use a canonical path for the temporary directory if the Checkpoint has been created form an object ref. The directory is filelocked to prevent concurrent writes.

Tests have been addded.

Co-authored-by: Kai Fricke <krfricke@users.noreply.github.com>
2022-06-01 21:45:39 +02:00
Eric Liang
905258dbc1
Clean up docstyle in python modules and add LINT rule (#25272) 2022-06-01 11:27:54 -07:00
Jiao
97190e4574
[Deployment Graph] Remove _execute_impl and json serde code for DeploymentNode IR (#25331) 2022-06-01 11:26:56 -07:00
Eric Liang
517f78e2b8
[minor] Add a job submission hook by env var (#25343) 2022-06-01 11:15:43 -07:00
SangBin Cho
ca75570f51
Revert "Revert "Revert "[dataset] Use polars for sorting (#24523)" (#24781)" (#25173)" (#25341)
This reverts commit 61676f26d3.
2022-06-01 10:49:12 -07:00
Chen Shen
49b8bbfd5e
[Core] Fix node affinity strategy when resource is empty (#25344)
Why are these changes needed?
Today, Ray scheduler always pick a random node if the resource requirement is empty, regardless of scheduling policy/strategy.

However, for node affinity scheduling policy, we should not pick random policy but try to stick to the node affinity constraints.
2022-06-01 10:38:48 -07:00
siavash119
21f1e8a5c6
[Core] Use newly pushed actor for existing pending tasks (#24980)
Newly pushed actors will never be used with existing pending submits, so the worker will not be used to speed up existing tasks. If _return_actor is called at the end of push instead, the actor is pushed to _idle_actors and immediately used if there are pending submits.
2022-06-01 07:51:02 -07:00
SangBin Cho
44483a6c99
[Test][Windows] Skip test metrics.py in Windows (#25287)
Skip the flaky test_metrics on Windows
2022-06-01 05:37:29 -07:00
valtab
288a81b42e
[Train]fix train callback nested recusive calling issue (#25015)
Move  initialization for `callback.results_preprocessor` property to `callback.start_training()` method which only be called once while training start, currently initialization is triggered per message.
2022-05-31 20:09:01 -07:00
Eric Liang
acf0da63b6
[data] [API] Remove unnecessary public argument in fully_executed() (#25267) 2022-05-31 16:48:35 -07:00
Eric Liang
5545bc5f45
[data] Fix pipeline pre-repeat caching, and improve the documentation (#25265)
Currently the canonical way to cache a pipeline and repeat it: ds.fully_executed().repeat() crashes. Add a test, fix the docs and stats printing here.
2022-05-31 16:01:00 -07:00
shrekris-anyscale
7754645c83
Revert "[Serve] Deploy Serve deployment graphs via REST API (#25073)" (#25330)
This reverts commit 47709b3300.
2022-05-31 15:37:55 -07:00
shrekris-anyscale
47709b3300
[Serve] Deploy Serve deployment graphs via REST API (#25073) 2022-05-31 10:57:08 -07:00
Eric Liang
00a9dfb5d5
[data] [API] Add max_epoch argument to iter_epochs() for AIR 2022-05-31 10:53:49 -07:00
Philipp Moritz
f61997d90b
Fix typing of gcs_utils.py and add check to CI (#25285) 2022-05-31 10:45:42 -07:00
Eric Liang
c93e37aba5
[Datasets] Fix byte size calculation for non-trivial tensors (#25264)
The range datasource was incorrectly calculating tensor sizes if the dimensions != (1,).

Broken out from https://github.com/ray-project/ray/pull/25167/files
2022-05-31 07:30:41 -07:00
Eric Liang
65f908ea31
[Datasets] Dataset pipeline window by bytes fails when read fusion disabled (#25266)
This fixes AttributeError: 'list' object has no attribute 'schema' when read fusion is flag disabled and pipelines are windowed by bytes.

Broken out from https://github.com/ray-project/ray/pull/25167/files
2022-05-31 07:23:23 -07:00
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