Commit graph

6741 commits

Author SHA1 Message Date
Simon Mo
ee528957c7
[Serve][Doc] Update docs about input schema, and json_request adapter (#24191) 2022-04-27 14:51:07 -07:00
Simon Mo
b4d9fcdbf8
[Serve] Fix surprious __call__ invocation in Deployment DAG's exec_impl (#24199) 2022-04-27 13:59:31 -07:00
Clark Zinzow
5dbcedbbf4
[Datasets] Expose DatasetPipeline in ray.data module (#24261)
Referencing the DatasetPipeline class currently requires ray.data.dataset_pipeline.DatasetPipeline; we should expose it directly in the ray.data module, as we do for Dataset.
2022-04-27 13:06:57 -07:00
Stephanie Wang
c1054a0baa
[Datasets] Implement push-based shuffle (#23758)
The simple shuffle currently implemented in Datasets does not reliably scale past 1000+ partitions due to metadata and I/O overhead.

This PR adds an experimental shuffle implementation for a "push-based shuffle", as described in this paper draft. This algorithm should see better performance at larger data scales. The algorithm works by merging intermediate map outputs at the reducer side while other map tasks are executing. Then, a final reduce task merges these merged outputs.

Currently, the PR exposes this option through the DatasetContext. It can also be set through a hidden OS environment variable (RAY_DATASET_PUSH_BASED_SHUFFLE). Once we have more comprehensive benchmarks, we can better document this option and allow the algorithm to be chosen at run time.

Related issue number

Closes #23758.
2022-04-27 11:59:41 -07:00
Siyuan (Ryans) Zhuang
309fef68c5
[core] Fix internal storage S3 bugs (#24167)
* fix storage

* fix windows
2022-04-27 09:57:14 -07:00
Siyuan (Ryans) Zhuang
895fdb5a4f
[workflow] Enable setting workflow options on Ray DAGs (#24210)
* workflow options
2022-04-27 09:51:45 -07:00
Kai Fricke
4a30ae0ab6
[tune] De-clutter log outputs in trial runner (#24257)
There are currently some debug logs left logging to INFO scope. This PR demotes them to DEBUG and cleans up the messages.
2022-04-27 17:13:09 +01:00
Simon Tindemans
77d79f9e32
IMapIterator fix when using iterator inputs (#24117)
In the current code base, `multiprocessing.Pool.imap_unordered` fails when it is called with an iterator (for which the length is not known on the first call). For example, the following code would fail:
```
import ray.util.multiprocessing as raymp

# test function
def func(input):
    print('run func [{}]'.format(input))
    return input

with raymp.Pool() as pool:
    
    # this fails with a TypeError (could not serialize)
    print('use an iterator')
    for x in pool.imap_unordered(func, iter(range(5))):
        print('Finished [{}]'.format(x))
```

## Summary of changes

* I made changes to the `ResultThread` class that enable it to work with argument `total_object_refs=0`. This will let it run until a call to `stop()` is received.
* I have adapted the `IMapIterator` class to better check input arguments and distinguish between iterables and iterators.
* The super classes `OrderedIMapIterator` and `UnorderedIMapIterator` have been updated to stop appropriately when iterators are used, and explicitly stop the `_result_thread`.

Co-authored-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com>
2022-04-27 09:31:15 -05:00
Kai Fricke
b138bab85a
[air/rllib] Add RLPredictor class (#24172)
This adds the RLPredictor implementation as the counter part for the RLTrainer. An evaluation using the predictor was added to the rl trainer end to end example.
2022-04-27 12:03:12 +01:00
Kai Fricke
772b9abbcb
[tune] Enable AsyncHyperband to continue training for last trials after max_t (#24222)
Adds a new flag `stop_last_trials` to AsyncHyperband that allows the last trials of each bracket to continue training after `max_t`. This feature existed for synchronous hyperband before, and the extension had been requested in #14235.
2022-04-27 11:45:23 +01:00
Kai Fricke
0d123ba90d
[ci/hotfix] Fix race condition in pytest reporting (#24253)
The AWS test seems to try to create the directory multiple times.
2022-04-27 09:06:55 +01:00
Sihan Wang
c8bf650826
[Serve] [CI] Update the test_pipeline_ingress_deployment size to small (#24236) 2022-04-26 16:56:07 -07:00
Yi Cheng
f112b521b2
[core] move function and actor importer away from pubsub (#24132)
This PR moves function import to a lazy way. Several benefits of this:
- worker start up is faster since it doesn't need to go through all functions exported
- gcs pressure is smaller since 1) we don't need to export key and 2) all loads are done when needed.
- get rid of function table channel
2022-04-26 15:07:29 -07:00
Kai Fricke
8a46001b14
[tune] Make Timeout stopper work after restoring in the future (#24217)
Previously, the `TimeoutStopper` did not work after recovery from checkpoints in the future, as the start time + budget was exceeded. Instead, we're now tracking a timeout budget that gets decreased and properly saved in checkpoints, so that recovery in the future works.
2022-04-26 22:18:50 +01:00
Kai Fricke
fc1cd89020
[ci] Add short failing test summary for pytests (#24104)
It is sometimes hard to find all failing tests in buildkite output logs - even filtering for "FAILED" is cumbersome as the output can be overloaded. This PR adds a small utility to add a short summary log in a separate output section at the end of the buildkite job.

The only shared directory between the Buildkite host machine and the test docker container is `/tmp/artifacts:/artifact-mount`. Thus, we write the summary file to this directory, and delete it before actually uploading it as an artifact in the `post-commands` hook.
2022-04-26 22:18:07 +01:00
Amog Kamsetty
c3cea7ad5d
[Train/Tune] Warn pending deprecation for ray.train.Trainer and ray.tune DistributedTrainableCreators (#24056)
ray.train.Trainer and ray.tune.integration.*.DistributedTrainableCreator will be deprecated in Ray 2.0 in favor of Ray AIR. In Ray 1.13, we should warn about this pending deprecation.

First step towards #23014
2022-04-26 13:38:34 -07:00
Yi Cheng
d6b0b9a209
Revert "Revert "[grpc] Upgrade grpc to 1.45.2"" (#24201)
* Revert "Revert "[grpc] Upgrade grpc to 1.45.2 (#24064)" (#24145)"

This reverts commit f1a1f97992.
2022-04-26 10:49:54 -07:00
Clark Zinzow
07112b4146
[Datasets] Add basic stats instrumentation of split_at_indices(). (#24179)
This PR adds basic stats instrumentation of split_at_indices(), the first stage in fully instrumenting split operations. See https://github.com/ray-project/ray/issues/24178 for future steps.
2022-04-26 09:49:48 -07:00
Kai Fricke
4b6e79d713
[ci/serve] Fix Serve minimal install silent failure (#24183)
Previously `sys.exit()` wasn't called, so bazel wouldn't fail because of the faulty match pattern.

Uncovered here: https://buildkite.com/ray-project/ray-builders-pr/builds/30291#_
2022-04-26 13:16:48 +01:00
Kai Fricke
c0ec20dc3a
[tune] Next deprecation cycle (#24076)
Rolling out next deprecation cycle:

- DeprecationWarnings that were `warnings.warn` or `logger.warn` before are now raised errors
- Raised Deprecation warnings are now removed
- Notably, this involves deprecating the TrialCheckpoint functionality and associated cloud tests
- Added annotations to deprecation warning for when to fully remove
2022-04-26 09:30:15 +01:00
Amog Kamsetty
ae9c68e75f
[Train] Fully deprecate Ray SGD v1 (#24038)
Ray SGD v1 has been denoted as a deprecated API for a while. This PR fully deprecates Ray SGD v1. An error will be raised if ray.util.sgd package is attempted to be imported.

Closes #16435
2022-04-25 16:12:57 -07:00
Jiajun Yao
3fb63847e2
Show usage stats prompt (#23822)
Show usage stats prompt when it's enabled.

Current UX are:

* The usage stats enabled or disabled message is shown every time in both terminal and dashboard.
* If users don't explicitly enable or disable usage stats, the first time they start a ray cluster interactively, they will be asked to confirm and will enable if no user action within 10s. If it's non-interactive, collection is enabled by default without confirmation.
* ray.init() doesn't collect usage stats
* Usage stats can be disabled via three approaches: 1. RAY_USAGE_STATS_ENABLED env var, 2. ray xxx --disable-usage-stats, 3. ray disable-usage-stats
2022-04-25 16:01:24 -07:00
Clark Zinzow
e6718ec136
[Datasets] Add test for reading CSV files without reading the first line as the header. (#24161)
This PR adds a test confirming that the user can manually supply column names as an alternative to reading a header line.
2022-04-25 15:17:30 -07:00
matthewdeng
cc08c01ade
[ml] add more preprocessors (#23904)
Adding some more common preprocessors:
* MaxAbsScaler
* RobustScaler
* PowerTransformer
* Normalizer
* FeatureHasher
* Tokenizer
* HashingVectorizer
* CountVectorizer

API docs: https://ray--23904.org.readthedocs.build/en/23904/ray-air/getting-started.html

Co-authored-by: Kai Fricke <krfricke@users.noreply.github.com>
2022-04-25 21:12:59 +01:00
Takeshi Yoshimura
e115545579
[ray client] enable ray.get with >2 sec timeout (#21883) (#22165)
Commit 2cf4c72 ("[ray client] Fix ctrl-c for ray.get() by setting a
short-server side timeout") introduced a short server-side timeout not
to block later operations.

However, the fix implicitly assumes that get() is complete within
MAX_BLOCKING_OPERATION_TIME_S (two seconds). This becomes a problem
when apps use heavy objects or limited network I/O bandwidth that
require more than two seconds to push all chunks. The current retry
logic needs to re-push from the beginning of chunks and block clients
with the infinite re-push.

I updated the logic to directly pass timeout if it is explicitly given.
Without timeout, it still uses MAX_BLOCKING_OPERATION_TIME_S for
polling with the short server-side timeout.
2022-04-25 13:06:52 -07:00
Clark Zinzow
3673b8c33b
[Datasets] [Out-of-Band Serialization: 3/3] Add out-of-band serialization. (#23932)
This PR adds support for out-of-band serialization of datasets, i.e. for serializing and deserializing datasets across Ray clusters by serializing the dataset lineage. This PR is the final PR in a set to add such support (3/3).
2022-04-25 12:47:06 -07:00
Jiao
55b1d857ab
[Serve] Fix deployment func no args called with python (#24096)
Our current behavior is dropping all args / kwargs for both http and python, if user deployment function doesn't take any input. But in the meantime we didn't throw anything if user tries to invoke the function in python with actual args.

This PR adds this back, and added a bit special handling for http case with in-line comments.
2022-04-25 11:15:44 -05:00
Jiao
2124087828
[Serve][Deployment Graph] Add test for ray core and serve dag class method call chain (#24115)
Now given we directly return `ClassMethodNode` on `deployment_cls.bind()`, add a test to ensure chain of ClassMethod calls is consistent across ray dag and serve dag.

Note this only works on single replica, since if the class method mutates replica state, and there're multiple replicas running, replica states / result won't be consistent if request are routed to different ones.
2022-04-25 11:15:06 -05:00
Clark Zinzow
a539a01145
[Datasets] Add support for write task remote options. (#24160)
Users may want to provide Ray task option overrides for write tasks, e.g. having write tasks retried on application-level exceptions (retry_exceptions=True) or change the default number of retries (max_retries=8). This commit adds support for providing such task options for write tasks.
2022-04-25 07:52:53 -07:00
ZhuSenlin
edf058d4f7
improve exponential backoff when connecting to the redis (#24150) 2022-04-25 16:10:24 +08:00
Qing Wang
a7a6465936
[Ray Collective] Fix the incorrect Redis password issue. (#24111)
This PR fixes the issue that we are not able to use GLOO as collective lib for the Ray cluster which is set Redis password.
2022-04-24 16:23:41 +08:00
Yi Cheng
f1a1f97992
Revert "[grpc] Upgrade grpc to 1.45.2 (#24064)" (#24145)
This reverts commit 3c0a3f4cc1.
2022-04-23 23:47:11 -07:00
Siyuan (Ryans) Zhuang
e507780c3b
[serve] Remove unnecessary code (#24131)
* cleanup
2022-04-23 23:29:59 -07:00
ZhuSenlin
0196694629
Fix the failure of sort_main in the case of num_cpus > 1 and not an integer (#24099)
The exception of 'ValueError("Resource quantities >1 must be whole numbers.")' will be raised if the `num_cpus` > 1 and not an integer.

Co-authored-by: 黑驰 <senlin.zsl@antgroup.com>
2022-04-24 11:54:08 +08:00
Travis Addair
c64afc672e
[train] Copy resources_per_worker to avoid modifying user input 2022-04-23 15:01:35 -07:00
Kai Fricke
03601007c9
[air] Use checkpoint.as_directory() instead of cleaning up manually (#24113)
Follow-up from #23908

Instead of manually deleting checkpoint paths after calling `to_directory()`, we should utilize `Checkpoint.as_directory()` when possible.
2022-04-23 14:52:30 +01:00
Yi Cheng
3c0a3f4cc1
[grpc] Upgrade grpc to 1.45.2 (#24064)
Upgrade grpc to the newest version to use grpc internal implementation of retry.
2022-04-22 19:15:15 -07:00
Clark Zinzow
ea791ab0a0
[Datasets] Print hierarchical stats for multi-stage operations. (#24119)
The total execution time for multi-stage operations being logged twice in the dataset stats is [confusing to users](https://github.com/ray-project/ray/issues/23915), making it seem like each stage in the operation took the same amount of time. This PR modifies the stats output for multi-stage operations, such that the total execution time is printed out once as a top-level op stats line, with the stats for each of the (sub)stages indented and devoid of the total execution time repeat.

This also opens the door for other op-level stats (e.g. peak memory utilization) and per-substage stats (e.g. total substage execution time).
2022-04-22 16:33:11 -07:00
Clark Zinzow
9ee24530ab
[Datasets] [Out-of-Band Serialization: 2/3] Refactor ExecutionPlan to maintain complete lineage and eagerly unlink block references. (#23931)
This PR refactors ExecutionPlan to maintain complete stage lineage, even for eagerly computed datasets, while ensuring that block references are unlinked as early as possible in order to more eagerly release block memory. This PR is the final precursor to adding the actual out-of-band serialization APIs (PR 3/3).

The fully lineage has to be maintained, even for eagerly computed datasets, since the lineage is needed for out-of-band serialization of datasets.
2022-04-22 16:07:24 -07:00
SangBin Cho
73ed67e9e6
[State API] State api limit + Removing unnecessary modules (#24098)
This PR does

Move all routes into the same module, state_head.py
Support a limit feature.
2022-04-22 15:59:46 -07:00
Patrick Ames
9f4cb9b3c9
[Datasets] Add Path Partitioning Support for All Content Types (#23624)
Adds a content-type-agnostic partition parser with support for filtering files. Also adds some corner-case bug fixes and usability improvements for supporting more robust input path types.
2022-04-22 15:48:31 -07:00
Kai Fricke
bb341eb1e4
Revert "Revert "[tune] Also interrupt training when SIGUSR1 received"" (#24101)
* Revert "Revert "[tune] Also interrupt training when SIGUSR1 received" (#24085)"

This reverts commit 00595653ed.

Failure in windows has been addressed by conditionally registering the signal handler if available.
2022-04-22 11:27:38 +01:00
Kai Fricke
0e2dd40451
[tune] reuse_actors per default for function trainables (#24040)
Function trainables don't carry state, so they should be reused per default for performance optimization.
2022-04-22 10:53:54 +01:00
jon-chuang
e6a458a31e
[CI] Create zip of ray session_latest/logs dir on test failure and upload to buildkite via /artifact-mount (#23783)
Creates a zip of session_latest dir with test name and timestamp upon python test failure. Writes to dir specified by env var `RAY_TEST_FAILURE_LOGS_DIR`. Noop if env var does not exist.

Downstream consumer (e.g. CI) can upload all created artifacts in this dir. Thereby, PR submitters can more easily debug their CI failures, especially if they can't repro locally.

Limitations:
- a conftest.py file importing the main ray conftest.py needs to be present in same dir as test. This presents a challenge for e.g. dashboard tests which are highly scattered
2022-04-22 09:48:53 +01:00
SangBin Cho
30ab5458a7
[State Observability] Tasks and Objects API (#23912)
This PR implements ray list tasks and ray list objects APIs.

NOTE: You can ignore the merge conflict for now. It is because the first PR was reverted. There's a fix PR open now.
2022-04-21 18:45:03 -07:00
Amog Kamsetty
f500997a65
[AIR] GNN example cleanup (#24080)
Minor cleanup for GNN example
2022-04-21 17:00:31 -07:00
shrekris-anyscale
b51d0aa8b1
[serve] Introduce context.py and client.py (#24067)
Serve stores context state, including the `_INTERNAL_REPLICA_CONTEXT` and the `_global_client` in `api.py`. However, these data structures are referenced throughout the codebase, causing circular dependencies. This change introduces two new files:

* `context.py`
    * Intended to expose process-wide state to internal Serve code as well as `api.py`
    * Stores the `_INTERNAL_REPLICA_CONTEXT` and the `_global_client` global variables
* `client.py`
    * Stores the definition for the Serve `Client` object, now called the `ServeControllerClient`
2022-04-21 18:35:09 -05:00
Dmitri Gekhtman
8c5fe44542
[KubeRay] Fix autoscaling with GPUs and custom resources, with e2e tests (#23883)
- Closes #23874 by fixing a typo ("num_gpus" -> "num-gpus").
- Adds end-to-end test logic confirming the fix.
- Adds end-to-end test logic confirming autoscaling with custom resources works.
- Slightly refines developer instructions.
- Deflakes test logic a bit by allowing for the event that the head pod changes its identity as the Ray cluster starts up.
2022-04-21 14:54:37 -07:00
xwjiang2010
00595653ed
Revert "[tune] Also interrupt training when SIGUSR1 received" (#24085) 2022-04-21 13:27:34 -07:00
iasoon
c9f0e486ad
[Serve] ensure replica reconfigure runs after allocation check (#24052)
Since remote calls provide no ordering guarantees, it could happen that `reconfigure` gets called before `is_allocated` Since `reconfigure` then runs the user initialization code, the replica actor could get blocked and never provide its allocation check.
This PR ensures that the allocation proof has been received before we run the replica initialization.
2022-04-21 15:24:21 -05:00