Commit graph

12292 commits

Author SHA1 Message Date
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
Jian Xiao
6d93e9f0f5
Cleanup the DatasetPipeline references in Getting Started; rename Exchanging to Accessing (#23786) 2022-04-12 17:10:14 -07:00
Stephanie Wang
6d52abe2a2
Add "issue severity" back to GitHub bug template #23793 (#23846) 2022-04-12 17:06:36 -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
Eric Liang
191c83305b
[minor] Fix minor spelling issue on actor task execution 2022-04-12 16:18:25 -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
Kinal Mehta
758e758c32
[rllib] Fix incorrect sequence length for rnn (#23830)
Update the torch policy to find the seq_lens using state_batches instead of input_dict. This helps handle the complex inputs to the model when the inbuilt preprocessing API is disabled.
2022-04-12 21:07:18 +01: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
Stephanie Wang
71e142b1fa
[core][tests] Add nightly test for datasets random_shuffle and sort (#23807)
Copied from #23784.

Adding a large-scale nightly test for Datasets random_shuffle and sort. The test script generates random blocks and reports total run time and peak driver memory.

Modified to fix lint.
2022-04-12 12:53:57 -07:00
Tao Wang
6aefe9b36e
[Core]Save task spec in separate table (#22650)
This is a rebase version of #11592. As task spec info is only needed when gcs create or start an actor, so we can remove it from actor table and save the serialization time and memory/network cost when gcs clients get actor infos from gcs.

As internal repository varies very much from the community. This pr just add some manual check with simple cherry pick. Welcome to comment first and at the meantime I'll see if there's any test case failed or some points were missed.
2022-04-12 12:24:26 -07: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
Sven Mika
a8494742a3
[RLlib] Memory leak finding toolset using tracemalloc + CI memory leak tests. (#15412) 2022-04-12 07:50:09 +02: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
Qing Wang
77b0015ea0
[Java] Add NO_RESTART and INFINITE_RESTART constants. (#23771) 2022-04-12 10:40:44 +08: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
Stephanie Wang
984e704207
Revert "Add "issue severity" back to GitHub bug template (#23838)" (#23841)
This reverts commit de7c0339ec.
2022-04-11 14:54:34 -07:00
Stephanie Wang
de7c0339ec
Add "issue severity" back to GitHub bug template (#23838)
Adds back the "Issue severity" dropdown to the bug template so that Ray users can have a way of reporting UX problems. Made some changes to try to streamline issue reporting:

- made this field optional
- moved the field to be last
- slightly changed some of the wording
2022-04-11 14:47:57 -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
Jun Gong
500cf7dcef
[RLlib] Run test_policy_client_server_setup.sh tests on different ports. (#23787) 2022-04-11 22:07:07 +02:00