Commit graph

12118 commits

Author SHA1 Message Date
Dmitri Gekhtman
fc4ac71deb
[minor] Fix legacy OSS operator test (#23540)
A legacy K8s test fails due to incorrect usage of @ray.method which only started raising errors after the Ray 1.12.0 branch cut.
This PR removes the use of @ray.method in the test.

Some context in #23271 and #23471

In addition, I noticed some of the test were flakey due to out-of-memory issues. For that reason, I've doubled the memory request and limits in the legacy operator's example files.

I've also added CPU limits in an example file that was missing them -- it makes the most sense for consistency with Ray's resource model to use CPU limits in K8s configs.

Finally, I added an extra note to the instructions for running the tests.
2022-04-18 17:47:42 -07:00
mwtian
ea66192a38
[GCS] Use gRPC instead of socket for GCS client health check (#23939)
A user has reported a crash in GCS client where the client was unable to connect to the GCS server after retries, even when GCS server has always been running. I was not able to reproduce the exact issue, but noticed that the health check logic with socket has unexpected behavior sometimes, e.g. it is much slower to use socket for health check compared to using gRPC (~40s vs < 1s sometimes). The user issue could be related to this slowness, so this PR updates the logic to use gRPC health check.
2022-04-18 16:55:29 -07:00
Gabe Joseph
e402fc0eaa
[Datasets] Fix typo in Std docstring (#20917) 2022-04-18 13:15:37 -07:00
Edward Oakes
669b38a2d6
[serve] Make monitoring section top-level in the docs (#23919) 2022-04-18 14:46:41 -05:00
Clark Zinzow
395a1c9aa2
[Doc] Fix actor fault tolerance link. (#23972) 2022-04-18 11:49:53 -07:00
Clark Zinzow
422bff4c29
[RLlib] [Docs] Fix RLLib example link. (#23948)
This old example was deleted in this commit: c38a29573f (diff-a9306793e50066431972a0fe8ffc788c98fe4fa247a880d274f30ca1bb42aabc), breaking our LinkCheck stage in CI. This updates the link to the new example location: https://github.com/ray-project/ray/blob/master/rllib/examples/recommender_system_with_recsim_and_slateq.py
2022-04-18 11:01:01 -07:00
shrekris-anyscale
fab33fa730
[serve] Handle None in ReplicaConfig's resource_dict (#23851)
This change sets `"memory"`'s default to `0` in the `resource_dict` but keeps the default as `None` in `ray_actor_options`. It adds logic to both problematic lines to handle `None` in case of future settings updates. It also adds unit tests to prevent regressions.
2022-04-18 12:34:20 -05:00
Siyuan (Ryans) Zhuang
a940e643db
[core] Fix DAG options (#23880)
Now we are able to pass correct options to DAGs. Previously it was missing or skewed.
2022-04-18 10:32:43 -07:00
shrekris-anyscale
6151b75d9d
[serve] Move schema helpers out of api.py (#23934) 2022-04-18 12:25:21 -05:00
mwtian
d5d2ef4249
[Core] Add a utility to check GCS / Ray cluster health (#23382)
* Provide a utility to ping a Ray cluster and verify it has the same Ray version. This is useful to check if a Ray cluster is available at a given address, without connecting to the cluster with the more heavyweight ray.init(). This utility is integrated with ray memory to provide a better error message when the Ray cluster is unavailable. There seem to be user demand for exposing this as an API as well.
* Improve the error message when the address provided to Ray does not contain port.
2022-04-18 09:58:45 -07:00
Jun Gong
d3c69ebdb6
[RLlib] Make sure unsquash_action moves user action to proper range (#23941) 2022-04-18 18:55:57 +02:00
Artur Niederfahrenhorst
e57ce7efd6
[RLlib] Replay Buffer API and Training Iteration Fn for DQN. (#23420) 2022-04-18 12:20:12 +02:00
Lingxuan Zuo
b7d148815e
[CoreWorker API] collect mobius used core worker api to internal (#23961)
To remove symbols conflict effect on core worker linked different ray versions. This PR extracts an united core worker api (not all) and collect them into a internal library, so native devs can use them anywhere no matter the core worker implementation changes.
2022-04-18 16:03:20 +08:00
Jiajun Yao
5d7f45fc8f
Unify AddSpilledUrl into UpdateObjectLocationBatch RPC (#23872)
- Logically these two rpcs are about notifying the owner about the object location changes, so we should just have one rpc for that purpose. This prevents out-of-order updates seen by the owner (i.e. receiving object removed from object store before spill update). Also by using UpdateObjectLocationBatch, we get batch update for free.
- Maintain a FIFO order for object location updates so we won't have starvation.
2022-04-17 21:48:29 -07:00
Chen Shen
cb02e2f713
[linter] fix broken link in rllib examples #23959
fix broken link in rllib examples
2022-04-17 19:34:38 -07:00
Akash Patel
8eb99428ce
remove unmaintained blist (#23957)
This PR removes the unused `blist` dep. Causing issues during `py310` upgrade path.
2022-04-17 16:06:04 -07:00
Jiajun Yao
6e2f9dfe53
[CI] Upload mac wheels to buildkite artifacts (#23930)
Upload mac wheels to buildkite artifacts and s3.
2022-04-17 13:10:14 -07:00
Clark Zinzow
93a8fb78ca
[Core] [Tests] Skip memory limit determination test for Windows. (#23955)
Memory limit determination test is not relevant for Windows; we already skip the CPU limit determination tests for Windows, so we skip for the memory limit determination as well.
2022-04-16 20:19:08 -07:00
Siyuan (Ryans) Zhuang
408ac5e537
[Core] Add _metadata to ray.remote keywords (#23884) 2022-04-16 14:18:30 -07:00
Jian Xiao
57f620bd05
[Datasets] Add missing public APIs to Datasets API docs (#23935) 2022-04-16 11:57:38 -07:00
Balaji Veeramani
b06bab8902
[Data] Support more feature_columns types for Dataset.to_tf (#23701)
People use models that accept dictionaries as input. For example, a model might take the following dictionary as input:
{
  "value1": [[7], [8]],
  "value2": [[10], [15]],
}
To facilitate using Ray Datasets with such models and to provide feature parity with to_torch, we should support more feature_columns types.
2022-04-16 11:53:19 -07:00
KepingYan
58f23bb6b4
[Datasets] Add a test case for Spark-on-Ray (raydp) (#23398)
Adds a test case for Spark-on-Ray (raydp).
2022-04-16 11:50:55 -07:00
Clark Zinzow
166cd537d5
[Core] Fix in-container memory limit fetching for cgroups v2 (#23922) 2022-04-15 15:38:01 -07:00
Sven Mika
92781c603e
[RLlib] A2C training_iteration method implementation (_disable_execution_plan_api=True) (#23735) 2022-04-15 18:36:13 +02:00
kourosh hakhamaneshi
c38a29573f
[RLlib] Removed deprecated code with error=True (#23916) 2022-04-15 13:51:12 +02:00
Kai Fricke
bc558eb81d
[docs] Fix link to outdated ci/travis (#23917)
Currently linkcheck is broken because it points to an outdated URI from the recent ci/ folder refactoring.
2022-04-15 07:20:21 +01:00
Clark Zinzow
3b09fdd942
[Datasets] Add vectorized global and grouped aggregations. (#23478)
This PR adds support for vectorized global and grouped aggregations, porting the built-in aggregations to vectorized block aggregations for tabular datasets.
2022-04-14 18:55:12 -07:00
mwtian
a15d6a6260
[Pubsub] remove unnecessary args when creating GcsPublisher #23911 2022-04-14 16:26:19 -07:00
Amog Kamsetty
fb14e82242
Revert "[State Observability] Basic functionality for centralized data (#23744)" (#23918)
This reverts commit 51a4a1a802.

breaking tune multinode tests and kuberay:test_autoscaling_e2e
2022-04-14 14:28:42 -07:00
mwtian
16227683f6
[Core] trim size of Reference struct (#23853)
During large scale shuffle (number of partitions used >= 1000), driver uses significant amount of memory for storing ObjectRefs. On Intel MacOS, each Reference struct currently takes up 592 bytes. We can reduce per-Reference memory footprint:

    - During shuffle, no ObjectRef borrowing or nesting happens. And in this case fields related to borrowing or nesting should not take up memory. This reduces sizeof(Reference) from 592 to 400.
    - Fields in the Reference struct can be reordered to enhance packing. This reduces sizeof(Reference) from 400 to 368.

On Intel MacOS running the shuffle benchmark with 1000 partitions and 10MB partition size, RSS at the end of shuffle drops from ~5GB to ~4.5GB.

Related issue number

#23604
2022-04-14 13:25:06 -07:00
Archit Kulkarni
0673bde594
[Doc] [runtime env] [Serve] Update serve pip runtime_env doc (#23792) 2022-04-14 15:11:14 -05:00
Clark Zinzow
efc5ac5ddf
[Datasets] [Out-of-Band Serialization: 1/3] Refactor LazyBlockList. (#23821)
This PR refactors `LazyBlockList` in service of out-of-band serialization (see [mono-PR](https://github.com/ray-project/ray/pull/22616)) and is a precursor to an execution plan refactor (PR #2) and adding the actual out-of-band serialization APIs (PR #3). The following is included in this refactor:
1. `ReadTask`s are now a first-class concept, replacing calls;
2. read stage progress tracking is consolidated into `LazyBlockList._get_blocks_with_metadta()` and more of the read task complexity, e.g. the read remote function, was pushed into `LazyBlockList` to make `ray.data.read_datasource()` simpler;
3. we are a bit smarter with how we progressively launch tasks and fetch and cache metadata, including fetching the metadata for read tasks in `.iter_blocks_with_metadata()` instead of relying on the pre-read task metadata (which will be less accurate), and we also fix some small bugs in the lazy ramp-up around progressive metadata fetching.

(1) is the most important item for supporting out-of-band serialization and fundamentally changes the `LazyBlockList` data model. This is required since we need to be able to reference the underlying read tasks when rewriting read stages during optimization and when serializing the lineage of the Dataset. See the [mono-PR](https://github.com/ray-project/ray/pull/22616) for more context.

Other changes:
1. Changed stats actor to a global named actor singleton in order to obviate the need for serializing the actor handle with the Dataset stats; without this, we were encountering serialization failures.
2022-04-14 12:35:02 -07:00
Kai Fricke
d96ac251d7
[air] Add Checkpoint.as_directory() for efficient checkpoint fs processing (#23908)
This PR adds a `Checkpoint_as_directory()` context manager that either returns the local path (if checkpoint is already a directory) or a temporary directory path containing the checkpoint data, which is cleaned up after use. The path should be considered as a read-only source for loading data from the checkpoint.

A common use case for processing checkpoint data is to convert it into a directory with `Checkpoint.to_directory()` and then do some read-only processing (e.g. restoring a ML model).

This process has two flaws: First, `to_directory()` creates a temporary directory that has to be explicitly cleaned up by the user after use. Secondly, if the checkpoint is already a directory checkpoint, it is copied over, which is inefficient for large checkpoints (e.g. huggingface models) and then even more prone to unwanted side effects if not cleaned up properly. 

With this context manager that effectively returns a directory that is to be used as a read-only data source, we can avoid manual cleaning up and unnecessary data copies (or avoid internal inspection as e.g. in https://github.com/ray-project/ray/pull/23876/files#diff-47db2f054ca359879f77306e7b054dd8b780aab994961e3b4911330ae15eeae3R57-R60)

See also discussion in https://github.com/ray-project/ray/pull/23850/files#r850036905
2022-04-14 11:43:51 -07:00
Siyuan (Ryans) Zhuang
85542c9911
Revert "Revert "[serialization] Enable debugging into pickle backend (#23854)"(#23877)" (#23878)
* Revert "Revert "[serialization] Enable debugging into pickle backend (#23854)" (#23877)"

This reverts commit 12f0dc1faf.

* fix
2022-04-14 11:07:54 -07:00
xwjiang2010
06a57b20de
[air - preprocessor] Add BatchMapper. (#23700)
Add BatchMapper preprocessor.
Update the semantics of preprocessor.fit() to allow for multiple fit. This is to follow scikitlearn example.
Introduce FitStatus to explicitly incorporate Chain case.
2022-04-14 11:04:30 -07:00
Tomasz Wrona
46e0162441
GcsPublisher is being constructed with unsupported position argument
To avoid this error:

(raylet) Traceback (most recent call last):
(raylet)   File "/home/iamhatesz/.pyenv/versions/alan-brain-py3.9/lib/python3.9/site-packages/ray/dashboard/agent.py", line 407, in <module>
(raylet)     gcs_publisher = GcsPublisher(args.gcs_address)
(raylet) TypeError: __init__() takes 1 positional argument but 2 were given
2022-04-14 10:47:57 -07:00
SangBin Cho
51a4a1a802
[State Observability] Basic functionality for centralized data (#23744)
Support listing actor/pg/job/node/workers

Design doc: https://docs.google.com/document/d/1IeEsJOiurg-zctOcBjY-tQVbsCmURFSnUCTkx_4a7Cw/edit#heading=h.9ub9e6yvu9p2

Note that this PR doesn't contain any output except ids. I will update them in the follow-up PRs.
2022-04-14 07:33:18 -07:00
Kai Fricke
79b154c436
[tune] Fix checkpoint sorting with nan values (#23909)
Following #23862, there was an uncaught bug when comparing nan-priority checkpoints. This is because float("nan") <= float("nan") is always False (unlike e.g. np.nan <= np.nan, which is True).

This PR fixes this bug and adds a new test to ensure correct behavior.
2022-04-14 14:28:12 +01:00
Antoni Baum
52eaf020bc
[tune] Treat checkpoints with nan value as worst (#23862)
Changes the logic in CheckpointManager to consider checkpoints with nan value of the metric as worst values, meaning they will be deleted first if keep_checkpoints_num is set.
2022-04-14 10:11:37 +01:00
Kai Fricke
6e37a48632
[ci/release] Allow for preferring smoke tests when filtering (#23887)
What: Adds a setting "prefer_smoke_tests" to the Buildkite settings. With this, user can specify to kick off smoke tests, if available.

Why: The filtering interface of the release testing dialog is a bit complicated at the moment - in order to kick off smoke tests, users have to know with which frequency they are configured to run. Instead users should usually just filter the tests they want to run (using frequency ANY) and optionally specify to run smoke tests, if available.
2022-04-14 06:12:27 +01:00
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
5e1218aae1
[ci/release] Quote pip installs in client runner (#23888)
What: Quotes pip install packages in local environment setup for client runner.

Why: Strings like pyarrow>=6.0.1<7.0.0 currently don't work as they are interpreted as output redirection.
2022-04-13 11:07:12 +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