Commit graph

6741 commits

Author SHA1 Message Date
mwtian
7c1934dc40
[Core] cleanup pickle5 version check (#23885)
* cleanup
2022-04-13 22:11:08 -07:00
Siyuan (Ryans) Zhuang
9c81a97fd9
[core] Simplify options handling [Part 2] (#23882)
* cleanup

* keep the original semantics
2022-04-13 22:09:14 -07:00
shrekris-anyscale
f400c20246
[serve] Use controller namespace when getting actors (#23896)
Serve gets actors using the current Ray namespace. However, the Ray namespace and the controller namespace may not match when using the `_override_controller_namespace` argument in `serve.start()`. This change ensures that the `get_actor()` calls in `ActorReplicaWrapper` use the controller namespace. This also allows `num_replicas` to be scaled up and down properly when using `_override_controller_namespace`.
2022-04-13 17:04:52 -05:00
Kai Fricke
e3bd59882d
[air] Move storage handling to pyarrow.fs.FileSystem (#23370) 2022-04-13 14:31:30 -07:00
Kai Fricke
65d9a410f7
[ci] Clean up ci/ directory (refactor ci/travis) (#23866)
Clean up the ci/ directory. This means getting rid of the travis/ path completely and moving the files into sensible subdirectories.

Details:

- Moves everything under ci/travis into subdirectories, e.g. ci/build, ci/lint, etc.
- Minor adjustments to some scripts (variable renames)
- Removes the outdated (unused) asan tests
2022-04-13 18:11:30 +01:00
Kai Fricke
40d3a62aa1
[air/wip] Add batch predictor class (#23808)
What: This class adds a generic BatchPredictor class that offers an interface to run batch inference on Ray datasets. It takes a Predictor class and checkpoint as an input, and provides a predict(dataset) method to run scalable scoring inference.

Why: Currently users have to implement scorers themselves. This is mostly boilerplate and prone to errors, so we should provide a simple solution instead.

Note that this predictor also implements the Predictor interface.
2022-04-13 08:58:08 +01:00
mwtian
a85baac3b4
[Core] do not add Ray's pickle5 path to sys.path when running Python >= 3.8 (#23879) 2022-04-12 22:06:25 -07:00
Jiajun Yao
95714cc281
Node affinity scheduling strategy (#23381)
Instead of relying on the node-ip custom resource for static task-to-node placement, this PR introduces an explicit NodeAffinitySchedulingStrategy with the following benefits:

1. Specify node using id instead of ip since ip may not be unique for each node.
2. Support soft constraint so the task can be tolerant to node failures.

After this PR, the node-ip custom resource can be deprecated.
2022-04-12 21:31:26 -07:00
Clark Zinzow
983ef1f2a7
[Datasets] Make from_numpy() more user-friendly. (#23871)
`ray.data.from_numpy()` currently expects to be given a list of ndarray futures, instead of handling concrete ndarrays, as expected (and as allowed by other `from_*` APIs, e.g. `from_pandas`). This PR renames the existing `from_numpy` API to `from_numpy_refs`, and exposes `ray.data.from_numpy`, which takes concrete ndarrays (not object references).
2022-04-12 18:37:59 -07:00
Clark Zinzow
12f0dc1faf
Revert "[serialization] Enable debugging into pickle backend (#23854)" (#23877)
This reverts commit ef7180365d.
2022-04-12 16:53:20 -07:00
Edward Oakes
de227ac407
[serve] Add component logger + basic access logging (#23558)
Adds a "component logger" to standardize logging across the HTTP proxy, controller, and deployment replicas.
2022-04-12 18:16:58 -05:00
Jian Xiao
00bdee1290
Add test case for merging empty and non-empty results of map_groups (#23545)
In some cases, the UDF for map_groups() may return value of different types, which should be disallowed.

This PR is to add unit test to make sure we do raise error if such case happens.
2022-04-12 15:30:27 -07:00
Sriram Sankar
608aa771b9
Clean up interaction between Autoscaler and Kuberay (#23428)
This PR updates the KuberayNodeProvider for a more robust interaction with the KubeRay operator.
2022-04-12 14:31:27 -07:00
Siyuan (Ryans) Zhuang
ef7180365d
[serialization] Enable debugging into pickle backend (#23854)
* enable debugging cloudpickle
2022-04-12 13:48:35 -07:00
Kai Fricke
4cb6205726
[tune] Fix empty CSV headers on trial restart (#23860)
What: Only open (create) CSV files when actually reporting results.
Why: When trials crash before they report first (e.g. on init), they will have created an empty CSV file. When results are subsequently written, the CSV header is then missing.
2022-04-12 21:05:29 +01:00
Antoni Baum
ff60ebd4b3
[tune] Fix memory resources for head bundle (#23861)
Fixes memory and object_store_memory actor options not being set properly for the Tune trainable.
2022-04-12 20:56:05 +01:00
Kai Fricke
c30491d6ef
[tune] Skip tmp checkpoints in analysis and read iteration from metadata (#23859)
What: Skips left-over checkpoint_tmp* directories when loading experiment analysis. Also loads iteration number from metadata file rather than parsing the checkpoint directory name.

Why: Sometimes temporary checkpoint directories are not deleted correctly when restoring (e.g. when interrupted). In these cases, they shouldn't be included in experiment analysis. Parsing their iteration number also failed, and should generally be done by reading the metadata file, not by inferring it from the directory name.
2022-04-12 17:09:03 +01:00
Kai Fricke
416cfb8753
[tune] Fix syncing between nodes in placement groups (#23864)
Break out of placement groups to make syncing work in tune/train trials.
2022-04-12 17:06:19 +01:00
Kai Fricke
7eb3543e93
[tune] Chunk file transfers in cross-node checkpoint syncing (#23804)
What: This introduces a general utility to synchronize directories between two nodes, derived from the RemoteTaskClient. This implementation uses chunked transfers for more efficient communication.

Why: Transferring files over 2GB in size leads to superlinear time complexity in some setups (e.g. local macbooks). This could be due to memory limits, swapping, or gRPC limits, and is explored in a different thread. To overcome this limitation, we use chunked data transfers which show quasi-linear scalability for larger files.
2022-04-12 13:45:07 +01:00
Clark Zinzow
7d262f886d
[data] Preserve block order when batch mapping using the actor compute model. (#23837)
This PR preserves block order when transforming under the actor compute model. Before this PR, we were submitting block transformations in reverse order and creating the output block list in completion order.
2022-04-12 08:42:27 +01:00
Siyuan (Ryans) Zhuang
e0a68f5076
[workflow] skip flaky tests (#23848)
* skip flaky tests
2022-04-11 23:08:56 -07:00
Siyuan (Ryans) Zhuang
d7ef546352
[core] Simplify options handling [Part 1] (#23127)
* handle options

* update doc

* fix serve
2022-04-11 20:49:58 -07:00
Antoni Baum
40646eecd4
[AIR] SklearnTrainer & Predictor interfaces (#23803)
Co-authored-by: Amog Kamsetty <amogkam@users.noreply.github.com>
2022-04-11 15:11:42 -07:00
shrekris-anyscale
87d1f97e2e
[runtime_env] Add print statements to TestGC tests (#23716)
The tests in `TestGC` are flaky due to timeout ([example 1](https://buildkite.com/ray-project/ray-builders-branch/builds/6868#5540f19e-3669-46eb-a4ee-c71a1252f9ae), [example 2](https://buildkite.com/ray-project/ray-builders-branch/builds/6872#8912eb47-eb63-40c9-949f-a020a5f8f42d)):

<img width="1304" alt="Screen Shot 2022-04-05 at 11 30 04 AM" src="https://user-images.githubusercontent.com/92341594/161825080-c2fe3887-f87c-4175-924f-80ae9b371157.png">

This change adds print statements to the `TestGC` tests to detect where they're hanging.
2022-04-11 16:09:41 -05:00
Amog Kamsetty
d33483de3d
[Tune] Don't include nan metrics for best checkpoint (#23820)
Nan values do not have a well defined ordering. When sorting metrics to determine the best checkpoint, we should always filter out checkpoints that are associated with nan values.

Closes #23812
2022-04-11 12:51:00 -07:00
Balaji Veeramani
394e5ec1c2
[Train] Raise helpful error when required backend isn't installed (#23583)
Closes #22347
2022-04-11 10:46:32 -07:00
Antoni Baum
5dc958037e
[air] Refactor most_frequent SimpleImputer (#23706)
Takes care of the TODO left for SimpleImputer with most_frequent strategy by refactoring and optimising the logic for computing the most frequent value.

Co-authored-by: Clark Zinzow <clarkzinzow@gmail.com>
2022-04-11 18:20:44 +01:00
Eric Liang
1ff874e8e8
[spelling] Add linter rule for mis-capitalizations of RLLib -> RLlib (#23817) 2022-04-10 16:12:53 -07:00
Qing Wang
c1dee15613
[xlang] Hotly fix the importing error for python call Java. (#23734)
The PR https://github.com/ray-project/ray/pull/22820 introduced a API breakage for xlang usage, causing that `ray.java_actor_class` has not been available any longer from then on.

I'm fixing it in this PR. We should remove these top level APIs in 2.0 instead of minor versions.
2022-04-10 15:36:12 +08:00
Eric Liang
858d607b19
[data] Fix small doc issues (#23813) 2022-04-09 12:09:08 -07:00
Yi Cheng
9655851f32
[ray] Remove RAY_USER_SETUP_FUNCTION (#23780)
`RAY_USER_SETUP_FUNCTION` is not a public API and is also not used by ray internally. This PR removes this feature.
2022-04-08 22:43:57 -07:00
Kai Fricke
8c2e471265
[AIR] Add RLTrainer interface, implementation, and examples (#23465)
This PR adds a RLTrainer to Ray AIR. It works for both offline and online use cases. In offline training, it will leverage the datasets key of the Trainer API to specify a dataset reader input, used e.g. in Behavioral Cloning (BC). In online training, it is a wrapper around the rllib trainables making use of the parameter layering enabled by the Trainer API.
2022-04-08 17:16:42 -07:00
Siyuan (Ryans) Zhuang
6dc74f5808
[workflow] Deprecate "workflow.step" [Part 3 - events] (#23796)
* update workflow events
2022-04-08 16:09:55 -07:00
Jiajun Yao
e910f0abcf
[Test] Don't send usage data to server for unit tests (#23800)
There are two tests that are accidentally sending usage data to the server. This pr fixes that.
2022-04-08 16:02:30 -07:00
Amog Kamsetty
029517a037
[Train] Fix train.torch.get_device() for fractional GPU or multiple GPU per worker case (#23763)
Using the local rank as the device id only works if there is exactly 1 GPU per worker. Instead we should be using ray.get_gpu_ids() to determine which GPU device to use for the worker.
2022-04-08 14:35:06 -07:00
xwjiang2010
615bb7a503
[tuner] add kwargs to be compatible with tune.run offerings. (#23791) 2022-04-08 14:30:40 -07:00
Qing Wang
42b4cc4e72
[ray collective] Use Ray internal kv for gloo group. (#23633)
Ray use gcs in memory store by default instead of Redis, which cause gloo group doesn't work by default.
In this PR, we use Ray internal kv for the store of gloo group to replace the RedisStore by default, to make gloo group work well.

This PR depends on another PR in pygloo https://github.com/ray-project/pygloo/pull/10
2022-04-08 19:39:58 +08:00
Keshi Dai
c143391b34
Expose A100 in accelerators module (#23751)
NVIDIA_TESLA_A100 is added here but it's not exposed in accelerators module's __init__ file.
2022-04-07 11:29:27 -07:00
xwjiang2010
7c67a4f1d0
[tuner] update tuner doc (#23753) 2022-04-07 11:10:17 -07:00
Antoni Baum
434d457ad1
[tune] Improve missing search dependency info (#23691)
Replaces FLAML searchers with a dummy class that throws an informative error on init if FLAML is not installed, removes ConfigSpace import in BOHB example code, adds a note to examples using external dependencies.
2022-04-07 08:53:27 -07:00
shrekris-anyscale
a6bcb6cd1e
[serve] Create application.py (#23759)
The `Application` class is stored in `api.py`. The object is relatively standalone and is used as a dependency in other classes, so this change moves `Application` (and `ImmutableDeploymentDict`) to a new file, `application.py`.
2022-04-07 10:34:24 -05:00
shrekris-anyscale
0902ec537d
[serve] Include full traceback in deployment update error message (#23752)
When deployments fail to update, [Serve sets their status to UNHEALTHY and logs the error message](46465abd6d/python/ray/serve/deployment_state.py (L1507-L1511)). However, the message lacks a traceback, making it impossible to find what caused it. [For example](https://console.anyscale.com/o/anyscale-internal/projects/prj_2xR6uT6t7jJuu1aCwWMsle/clusters/ses_SfGPJq8WWJUhAvmHHsDgJWUe?command-history-section=command_history):

```
File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/serve/api.py", line 328, in _wait_for_deployment_healthy
    raise RuntimeError(f"Deployment {name} is UNHEALTHY: {status.message}")
RuntimeError: Deployment echo is UNHEALTHY: Failed to update deployment:
'>' not supported between instances of 'NoneType' and 'int'.
```

It's not clear where `'>' not supported between instances of 'NoneType' and 'int'.` is being triggered.

The change includes the full traceback for this type of update failure. The new status message is easier to debug:

```
File "/Users/shrekris/Desktop/ray/python/ray/serve/api.py", line 328, in _wait_for_deployment_healthy
    raise RuntimeError(f"Deployment {name} is UNHEALTHY: {status.message}")
RuntimeError: Deployment A is UNHEALTHY: Failed to update deployment:
Traceback (most recent call last):
  File "/Users/shrekris/Desktop/ray/python/ray/serve/deployment_state.py", line 1503, in update
    running_replicas_changed |= self._check_and_update_replicas()
  File "/Users/shrekris/Desktop/ray/python/ray/serve/deployment_state.py", line 1396, in _check_and_update_replicas
    a = 1/0
ZeroDivisionError: division by zero
```

(I forced a divide-by-zero error to get this traceback).
2022-04-07 10:34:00 -05:00
shrekris-anyscale
64d98fb385
[serve] Add unit tests and better error messages to _store_package_in_gcs() (#23576)
This change adds new unit tests and error message to _store_package_in_gcs(). In particular, it tests the function's behavior when it fails to connect to the GCS.
2022-04-06 17:34:10 -07:00
Kai Fricke
d27e73f851
[ci] Pin prometheus_client to fix current test outages (#23749)
What: Pins prometheus_client to < 0.14.0, hopefully fixing today's CI outages
Why: New version of the python client (https://github.com/prometheus/client_python/releases) breaks our CI
2022-04-06 14:22:22 -07:00
Amog Kamsetty
8becbfa927
[Train] MLflow start run under correct experiment (#23662)
Start Mlflow run under correct mlflow experiment
2022-04-06 11:50:32 -07:00
Siyuan (Ryans) Zhuang
46465abd6d
[workflow] Deprecate "workflow.step" [Part 2 - most nested workflows] (#23728)
* remove workflow.step

* convert examples
2022-04-06 00:47:43 -07:00
Kai Fricke
c0e38e335c
Revert "Revert "[air] Better exception handling"" (#23733)
This reverts commit 5609f438dc.
2022-04-05 21:45:24 -07:00
Kai Fricke
5609f438dc
Revert "[air] Better exception handling (#23695)" (#23732)
This reverts commit fb50e0a70b.
2022-04-05 20:20:40 -07:00
xwjiang2010
99f64821b1
[tune] add tuner test (#23726)
Adds test for TorchTrainer+Tuner
2022-04-05 19:42:51 -07:00
Kai Fricke
fb50e0a70b
[air] Better exception handling (#23695)
What: Raise meaningful exceptions when invalid parameters are passed.
Why: We want to catch invalid parameters and guide users to use the API in the correct way.
2022-04-05 19:11:55 -07:00