Commit graph

5872 commits

Author SHA1 Message Date
Eric Liang
6f93ea437e
Remove the flaky test tag (#21006) 2021-12-11 01:03:17 -08:00
Jiajun Yao
f04ee71dc7
Fix driver lease request infinite loop when local raylet dies (#20859)
Currently if local lease request fails due to raylet death, direct_task_transport.cc will retry forever for driver.

With this PR, we treat grpc unavailable as non-retryable error (the assumption is that local grpc is always reliable and grpc unavailable error indicates that server is dead) and will just fail the task.

Note: this PR doesn't try to address a bigger problem: don't crash driver when local raylet dies. We have multiple places in the code that assumes the local raylet never fail and have CHECK_STATUS_OK for that. All these places need to be changed so we can properly propagate failures to the user.
2021-12-10 18:02:59 -08:00
Stephanie Wang
3a5dd9a10b
[core] Pin object if it already exists (#20447)
A worker can crash right after putting its return values into the object store. Then, the owner will receive the worker crashed error, but the return objects will still be in the remote object store. Later, if the task is retried, the worker will crash on [this line](https://github.com/ray-project/ray/blob/master/src/ray/core_worker/transport/direct_actor_transport.cc#L105) because the object already exists.

Another way this can happen is if a task has multiple return values, and one of those return values is transferred to another node. If the task is later re-executed on that node, the task will fail because of the same error.

This PR fixes the crash so that:
1. If an object already exists, we try to pin that copy. Ideally, we should destroy the old copy and create the new one to make sure that metadata like the owner address is in sync, but this is pretty complicated to do right now.
2. If the pinning fails, we store an OBJECT_LOST error to throw to the application.
3. On the raylet, we check whether we already have the object pinned, and only subscribe to the owner's eviction message if the object is not pinned.
4. Also fixes bugs in the analogous case for `ray.put` (previously this would hang, now the application will receive an error if a `ray.put` object already exists).
2021-12-10 15:56:43 -08:00
Yi Cheng
6280bc4391
Revert "[core] Ensure failed to register worker is killed and print better log" (#21023)
`linux://python/ray/tests:test_runtime_env_complicated` looks flaky after this pr.
Reverts ray-project/ray#20964
2021-12-10 14:57:32 -08:00
architkulkarni
7fc9a9c227
[CI] bump tasks_finish_quickly timeout from 1s to 2s (#21015) 2021-12-10 14:16:12 -08:00
Chris K. W
27665fdf29
[client][test] skip test_valid_actor_state_2 (#20995)
* skip test_valid_actor_state_2

* rerun
2021-12-10 10:58:42 -08:00
mwtian
d751a242d8
[Core][Dashboard Pubsub 2/n] Add resource reporter and actor to Python GCS pubsub (#21001)
Dashboard contains resource reporter and actor subscribers. Dashboard agent has resource report publisher. So GCS pubsub needs to support these channel types.

Also refactor GCS AIO subscribers to have each subscriber per channel. This matches the API of GCS sync subscribers, and make subscribing with multiple channels easier.
2021-12-09 23:10:10 -08:00
Jiajun Yao
5b21bc5c93
[BUILD] Use bazel-skylib rule to check bazel version (#20990)
Bazel has a rule for enforcing the version so we can just reuse that.

This redundant bazel version check logic in setup.py is also causing issue when building conda package, because conda has its own version of bazel and it doesn't support `--version`.
2021-12-09 15:25:22 -08:00
SangBin Cho
05a302b468
[Internal Observability] [Part 3] Support debug state metrics on all components. (#20957)
This PR adds RecordMetrics and DebugString to all raylet components. 

Some of methods are probably empty now. They are going to be supported in the next PR
2021-12-09 14:24:15 -08:00
Chen Shen
6a274dfd76
CI][Chaos-test] chaos test now can set max-nodes-to-kill #20962 2021-12-09 13:41:46 -08:00
Yi Cheng
83c639ea76
[core] Ensure failed to register worker is killed and print better log (#20964)
Before this PR, then raylet notices there is something wrong with the worker starting, it'll start a new worker but not kill the old one. If the old one is hanging, it'll lead to resource waste.
This PR killed the failed worker if it's still alive and also print useful logs
2021-12-09 12:37:39 -08:00
kk-55
9acf2f954d
[RLlib] Example containing a proposal for computing an adapted (time-dependent) GAE used by the PPO algorithm (via callback on_postprocess_trajectory) (#20850) 2021-12-09 14:48:56 +01:00
Jiajun Yao
655cc584a9
[Scheduler] Support per task/actor SpreadSchedulingStrategy (#20972)
This PR adds per task/actor SpreadSchedulingStrategy which will try to spread the tasks on a best effort basis.
2021-12-08 22:22:07 -08:00
Eric Liang
22ccc6b300
Initial stats framework for datasets (#20867)
This adds an initial Dataset.stats() framework for debugging dataset performance. At a high level, execution stats for tasks (e.g., CPU time) are attached to block metadata objects. Datasets have stats objects that hold references to these stats and parent dataset stats (this avoids stats holding references to parent datasets, allowing them to be gc'ed). Similarly, DatasetPipelines hold stats from recently computed datasets.

Currently only basic ops like map / map_batches are instrumented. TODO placeholders are left for future PRs.
2021-12-08 16:13:57 -08:00
SangBin Cho
5298a9046c
[Internal Observability] [Part 1] Centralize existing metrics to metric_defs.h (#20728)
This PR centralizes all existing metrics to `metric_defs.h`. 

Previously, each file relies on implicit import of metric_def.h within the stats module. After this PR we only precisely import `metric_defs.h` for each file.
2021-12-08 14:06:05 -08:00
Antoni Baum
4c47f56b61
[tune] Add random state to BasicVariantGenerator (#20926)
This PR adds an ability to set a random seed/numpy random generator in BasicVariantGenerator, allowing for reproducibility across separate runs. All the changes are fully backwards compatible.

Co-authored-by: Kai Fricke <krfricke@users.noreply.github.com>
2021-12-08 20:15:53 +00:00
architkulkarni
5593819135
Revert "Revert "[runtime env] Allow working_dir and py_module to be Path type"" (#20853) 2021-12-08 11:17:19 -08:00
architkulkarni
78cd377775
[Serve] Bump test_cluster from small to medium (#20942) 2021-12-08 09:58:27 -08:00
Jiajun Yao
5b168a1515
[Scheduler] Support per task/actor PlacementGroupSchedulingStrategy (#20507)
This PR adds per task/actor scheduling strategy and currently the only strategy are PlacementGroupSchedulingStrategy and DefaultSchedulingStrategy.

Going forward, people should use `scheduling_strategy=PlacementGroupSchedulingStrategy` to define placement group for actor/task. The old way will be deprecated.
2021-12-07 23:11:31 -08:00
Jiajun Yao
6a07f03a6a
[Test] Fix flaky test_failure_2.py (#20949)
There is a race condition between `DestoryActor` (due to handle out of scope) and `CreateActor`. If `DestoryActor` happens first, then `CreateActor` will fail complaining about not being able to find the registered actor.
2021-12-07 19:44:16 -08:00
Hankpipi
67518bdc50
[serve] Reconfiguration bug fix (#20315)
As described in #18884, reconfiguration will mutate state mid-query. I try to solve this problem by adding read/write lock to each replica.

Co-authored-by: yuzihao.2001 <yuzihao.2001@bytedance.com>
2021-12-07 18:53:45 -08:00
Jiajun Yao
2208cf7672
[Ray Client] Pickle task options for ray client (#20930)
We can just pickle task options instead of json so that we don't need to write custom `to_dict` and `from_dict` methods for complex python option objects (e.g. PlacementGroup).
2021-12-07 17:07:19 -08:00
Dmitri Gekhtman
94883f61b1
[autoscaler] Event summarizer reports launch failure (#20814)
Partly addresses #20774 by registering node launcher failures in driver logs, via the event summarizer.
This way, users can tell that the launch failed from the driver logs.

Also pushes the node creation exception to driver logs, but only once per 60 minutes.
2021-12-07 16:23:45 -08:00
Yi Cheng
ea1d081aac
[core] Simple chaos testing for asio (#19970)
Right now in ray, a lot of edge cases related to grpc are not tested. This PR is just a simple try to give the developer some way to delay grpc request. It could be used with manual testing and also e2e test since it's supporting delay for specific grpc method.

To use this feature, just simple set os env `RAY_TESTING_ASIO_DELAY_US="method1=10:20,method2=20:30,*=200:200"`

This means, for `method1` it'll delay 10-20us, for method2 it'll delay 20-30us. For all the rest, it'll delay 200us.
2021-12-07 14:47:07 -08:00
architkulkarni
cd12814975
[Serve] [doc] Fix broken serve metrics doc snippet (#20925)
Was failing with `TypeError: f() missing 1 required positional argument: 'request'
`
2021-12-07 14:02:47 -08:00
Clark Zinzow
336882e32c
[Datasets] Fix boolean tensor column slicing. (#20905)
Arrow byte-packs boolean arrays, with 8 entries per byte, and both Arrow and NumPy utilize bit-based offsets for indexing into data buffers. This PR adds support for properly indexing into boolean tensor columns by using bit-based offsets for such columns.
2021-12-07 12:47:43 -08:00
xwjiang2010
011ae389a6
[tune] minor clean up of executor.restore(). (#20916)
Removes two unneeded parameters that were not used anymore
2021-12-07 16:37:48 +00:00
Eric Liang
5d5ca8fed4
[dataset] Reduce memory usage during .to_pandas() (#20921)
We shouldn't ray.get() all the blocks immediately during the to_pandas call, it's better to do it one by one. That's a little slower but to_pandas() isn't expected to be fast anyways.
2021-12-06 18:17:16 -08:00
Balaji Veeramani
17b6130f9f
[Train] Clarify Session.get_next docstring (#20877)
This PR addresses two issues an issue with the Session.get_next docstring:

It's unclear whether the tense should be imperative or non-imperative. The Ray documentation states that we use Google style (which is non-imperative), but we are formatting using PEP8 (which is imperative). Moreover, we use both imperative and non-imperative summaries across the Ray Train code. I've stuck with a non-imperative summary for consistency with the rest of the Session class.
The docstring doesn't describe the conditions under which the function returns None.
2021-12-06 17:26:25 -08:00
Dmitri Gekhtman
10ed6765c7
[Autoscaler] Add autoscaler update time prometheus metric. (#20831)
It's useful when measuring autoscaler performance to know how long the autoscaler takes for update iterations.
This PR adds a prometheus metric for that. 

The bucket ticks for the histogram are arranged in powers of ten: 
[.001, .01, .1, 1, 10, 100, 1000]. Depending on the situation, we've seen the update time range from .1 second to a few minutes.
2021-12-06 11:55:07 -08:00
shrekris-anyscale
2d58664f98
Add Pydantic validation to Serve AutoscalingConfig class (#20779) 2021-12-06 11:51:02 -08:00
architkulkarni
c024d984e5
[runtime_env] Parse local conda/pip requirements files before sending runtime env to Ray Client Server (#20885) 2021-12-06 12:04:22 -06:00
Siyuan (Ryans) Zhuang
3285bb6b9f
[train] Fix assertion in test (#20893) 2021-12-05 17:47:43 -08:00
Kai Fricke
d4413299c0
Revert "[Core] Support back pressure for actor tasks (#19936)" (#20880)
This reverts commit a4495941c2.
2021-12-03 17:48:47 -08:00
architkulkarni
ac911d6b51
[runtime_env] Change error log to debug log (#20875) 2021-12-03 18:21:43 -06:00
xwjiang2010
b0c56c8f9b
[tune] Fix testResourceScheduler and testMultiStepRun. (#20872)
This commit fixes flaky tests by relaxing strictly deterministic trial runner behavior constraints.
2021-12-03 16:07:52 -08:00
Amog Kamsetty
611bfc1352
[ML] Move find_free_port to ml_utils (#20828)
Small refactoring of common utility used by Train, Tune, and Rllib.
2021-12-03 13:38:42 -08:00
runedog48
c432815b10
Fix argument typo in post_mortem method (#20871) 2021-12-03 10:27:12 -08:00
xwjiang2010
368da1742b
[tune] Enforce one future at a time for any given trial at any given time. (#20783)
Also enforce disabling (instead of allowing user to override this) buffer training when checkpoint_at_end is used.
2021-12-03 08:14:12 -08:00
xwjiang2010
205d1e9d1f
remove on_pause/on_unpause (#20822) 2021-12-03 08:13:17 -08:00
Matti Picus
442943572b
DOC, BUILD: limit bazel resource usage with BAZEL_LIMIT_CPUS and document it (#20845)
So I have a AMD machine with many cores and 32GB of memory. When I do `pip install -e .`, my machine crashes since bazel tries to use all the cores, but quickly runs out of memory. It seems there is no native way to set environment variables to tell bazel to limit its resource consumption, but there is a `--local_cpu_resources` command-line option.

This PR exposes that to the `pip install` via an environment variable. I also went through the setup.py and documented all the environment variables I could find.
2021-12-02 16:39:36 -08:00
mwtian
c01fa39d84
[Cleanup] delete remaining protos related to ObjectLocation in GCS (#20823)
Object metadata are fully managed by workers now, so the related protos and logic in GCS are obsolete. Most of the logic has been removed in https://github.com/ray-project/ray/pull/19963. This PR removes some remaining obsolete protos.
2021-12-02 15:24:43 -08:00
WanXing Wang
a4495941c2
[Core] Support back pressure for actor tasks (#19936)
Support back pressure in core worker.
Job config added for python worker and java worker.
2021-12-02 14:41:30 -08:00
xwjiang2010
e8ce1edfdc
[tune] move on_no_available_trials to a subclass under runner (#20809)
Separates out warning logic to a different submodule.
2021-12-02 12:54:45 -08:00
architkulkarni
725480ad7e
Revert "[runtime_env] Allow working_dir and py_module to be Path type (#20810)" (#20852)
This reverts commit fb3d57fb71.
2021-12-02 10:17:16 -08:00
Chu Xiangyang
93732231cb
[Core] Update job id to hex in JOB_LOG_PATTERN (#20612) (#20816)
* [Core] Update job id to hex in JOB_LOG_PATTERN (#20612)

* Add test to log pid with hex job id
2021-12-02 16:47:26 +09:00
mwtian
8716ae9fdc
[Core][Pubsub] deflake test_gcs_pubsub (#20812)
In `test_gcs_pubsub.py`, ensure subscribers subscribe before data is published to the channel.
2021-12-01 19:11:18 -08:00
mwtian
b3264138b5
[cli] Use 8 Ansi colors for ray command output (#20485) 2021-12-01 16:44:52 -08:00
iasoon
7546ea452f
[serve] Catch errors caused by bad deployment configurations (#20617) 2021-12-01 17:20:25 -07:00
hckuo
fb3d57fb71
[runtime_env] Allow working_dir and py_module to be Path type (#20810) 2021-12-01 16:39:39 -07:00