Commit graph

6536 commits

Author SHA1 Message Date
Antoni Baum
ca6dfc8bb7
[AIR] Interface for HuggingFaceTorchTrainer (#23615)
Initial draft of the interface for HuggingFaceTorchTrainer.

One alternative for limiting the number of datasets in datasets dict would be to have the user pass train_dataset and validation_dataset as separate arguments, though that would be inconsistent with TorchTrainer.
2022-04-05 10:32:13 -07:00
liuyang-my
bdd3b9a0ab
[Serve] Unified Controller API for Cross Language Client (#23004) 2022-04-05 09:20:02 -07:00
jon-chuang
9c950e8979
[Core] Placement Group: Fix Flakey Test placement_group_test_5 and Typo (#23350)
placement_group_test_5 is flakey. Reason is requesting PG with exact object store memory as node. If object store has object, then PG scheduling fails.

Also fix bug - typo.
2022-04-05 05:33:43 -07:00
Gagandeep Singh
11baa22c1e
Split test_advanced_n.py and enabled cluster tests (#23524) 2022-04-05 01:34:57 -07:00
Gagandeep Singh
8c87117bc3
Uniformly distributed tasks among actors to utilize full concurrency (#23416)
* Uniformly distributed tasks among actors to utilize full concurrency

* Added test to ensure all tasks are launched at the same time

* Applied linting format
2022-04-05 01:05:41 -07:00
Matti Picus
96948a4a30
WINDOWS: skip flaky test (#23557)
Continuation of #23462 to try to get test_ray_init to pass consistently in CI. The skipped test passes locally, so only skip it on CI.
2022-04-05 00:56:43 -07:00
Jiajun Yao
5f37231842
Remove yapf dependency (#23656)
Yapf has been replaced by black.
2022-04-04 21:50:04 -07:00
Clark Zinzow
08159eb668
[Datasets] Disallow callable classes for task compute strategy. (#23708) 2022-04-04 21:12:36 -07:00
Siyuan (Ryans) Zhuang
ae86fb258e
[workflow] Fix workflow continuation resolving (#23682)
* update test

* return StaticWorkflowRef

* reformat test
2022-04-04 17:39:24 -07:00
Amog Kamsetty
4530349506
[AIR] Set name of Trainable to match with Trainer #23697 2022-04-04 16:23:21 -07:00
shrekris-anyscale
4aaa895137
[runtime_env] Reorganize tests in test_runtime_env_working_dir_2.py and test_runtime_env_working_dir_3.py (#23618) 2022-04-04 17:35:49 -05:00
Kai Fricke
b3b1498eba
[tune] Beautify Optional typehints (#23692)
What: Changes `Union[None, type1, ..., typeN]` type hints to `Optional[type1, ..., typeN]`
Why: Better readability, consistency across library, consistency with code style guides.
2022-04-04 19:48:34 +01:00
Edward Oakes
09123e3452
[serve][minor] Remove "statuses" key from serve status output (#23642) 2022-04-04 11:11:26 -05:00
Kai Fricke
7e0c63ab9c
[tune] Simplify experiment tag formatting, clean directory names (#23672)
Experiment tags are not always rendered in a sane way for all operating systems. For instance,  a config of

```
            "a": tune.choice([(3, 4), (5, 6)]),
            "b": tune.choice([[7, 8], [6, 5]]),
```

will lead to an experiment dir like `lambda_53737_00000_0_a=_3, 4_,b=[7, 8]_2022-04-02_10-21-27/`. This can lead to problems with utilities such as gsutil (which misinterprets some characters as wildcards, see #23670), but also with e.g. MacOS which doesn't like `[` brackets in filenames. 

This PR adds an improvement to the `_clean_value` function used to sanitize values. We specify a valid alphabet which includes a limited set of characters that is broadly usable in most operating systems. We also simplify the `format_vars` function - even though it was previously a bit more sophisticated in handling list items, this was error-prone, and can be replaced in favor of a better readable and simpler implementation that yields the same results in almost all cases.
2022-04-04 16:05:47 +01:00
Andrew Bauer
3e7c8231a8
Apply 'Incorrect pickles for subclasses of generic classes #448' from cloudpickle (#22553)
Co-authored-by: Chen Shen <scv119@gmail.com>
2022-04-04 00:06:39 -07:00
shrekris-anyscale
071e1dd20f
[serve] Create deployment.py and deployment_graph.py (#23578)
`api.py` has accumulated classes and functions that aren't purely public APIs, causing circular dependencies. This change pulls `Deployment` and deployment graph-related features out of `api.py` and puts them in two new files: `deployment.py` and `deployment_graph.py`.
2022-04-01 13:40:13 -07:00
shrekris-anyscale
d4747d28eb
[serve] Set "memory" to None in ray_actor_options by default (#23619)
* Make default memory 1

* Add test to validate that ReplicaConfig's default memory cannot be lower than minimum

* Add a new option to memory_omitted_options

* Update if branch in test_replica_config_default_memory_minimum

* Make memory default value None
2022-04-01 09:14:44 -07:00
Kai Fricke
fe27dbcd9a
[air/release] Improve file packing/unpacking (#23621)
We use tarfile to pack/unpack directories in several locations. Instead of using temporary files, we can just use io.BytesIO to avoid unnecessary disk writes.

Note that this functionality is present in 3 different modules - in Ray (AIR), in the release test package, and in a specific release test. The implementations should live in the three modules independently, so we don't add a common utility for this (e.g. the ray_release package should be independent of the Ray package).
2022-04-01 07:38:14 -07:00
Lingxuan Zuo
4510c2df90
[Python] export cython module for external project (#23579)
A lot of cython data types have been defined in ray cython module, but outside project cannot reuse these since ray doesn't export all of *.pxd files.

To fix mobius python building error (https://github.com/ray-project/mobius/runs/5740167581?check_suite_focus=true) : no found ray common.pxd, etc. , 

According to cython document https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html
we might add this package_data parameter in setup.py
```python
setup(
    package_data = {
        'my_package': ['*.pxd'],
        'my_package/sub_package': ['*.pxd'],
    },
    ...
)
```

Co-authored-by: 林濯 <lingxuzn.zlx@antgroup.com>
2022-04-01 10:31:33 +08:00
xwjiang2010
378b66984f
[air] reduce unnecessary stacktrace (#23475)
There are a few changes:
1. Between runner thread and main thread: The same stacktrace is raised in `_report_thread_runner_error` in main thread. So we could spare this raise in runner thread.
2. Between function runner and Tune driver: Do not wrap RayTaskError in TuneError.
3. Within Tune driver code: Introduces a per errored trial error.pkl and uses that to populate ResultGrid.

Plus some cleanups to facilitate propagating exception in runner and executor code.

Final stacktrace looks like: (omitted)

In Tune, we are capturing `traceback.format_exc` at the time the exception is caught and just pass the string around. This PR slightly changes that only in the case of when RayTaskError is raised, and we pass that object around.
It may be worthwhile to settle down on a practice of error handling in Tune in general.
I am also curious to learn how other ray library does that and any good lessons to learn. 

In particular, we should watch out for memory leaking in exception handling. Not sure if it is still a problem in python 3, but here are some articles I came across for reference
https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
2022-03-31 22:59:58 +01:00
Andrew Sedler
853f6d6de3
[Bug][Tune] Fix bugs that cause hanging PAUSED trials with PopulationBasedTrainingScheduler (#23472)
As discussed in #23424, the synch=True mode of PopulationBasedTrainingScheduler is (1) not compatible with burn_in_period and (2) causes the presence of TERMINATED trials to hang PAUSED trials indefinitely.

This change addresses (1) by setting the initial _next_perturbaton_sync to the max of burn_in_period and perturbation_interval in the constructor and (2) by checking only whether live trials have reached the _next_perturbation_sync before resuming PAUSED trials.
2022-03-31 08:33:51 -07:00
Chen Shen
944e8e1053
Revert "[Python Worker] load actor dependency without importer thread (#23383)" (#23601)
This reverts commit d1ef498638.
2022-03-30 15:45:00 -07:00
Kai Fricke
3b3f271c3c
[tune] Fix tensorflow distributed trainable docstring (#23590)
The current docstring was copied from horovod and still refers to it.
2022-03-30 11:36:45 -07:00
Kai Fricke
e8abffb017
[tune/release] Improve Tune cloud release tests for durable storage (#23277)
This PR addresses recent failures in the tune cloud tests.

In particular, this PR changes the following:

    The trial runner will now wait for potential previous syncs to finish before syncing once more if force=True is supplied. This is to make sure that the final experiment checkpoints exist in the most recent version on remote storage. This likely fixes some flakiness in the tests.
    We switched to new cloud buckets that don't interfere with other tests (and are less likely to be garbage collected)
    We're now using dated subdirectories in the cloud buckets so that we don't interfere if two tests are run in parallel. Objects are cleaned up afterwards. The buckets are configured to remove objects after 30 days.
    Lastly, we fix an issue in the cloud tests where the RELEASE_TEST_OUTPUT file was unavailable when run in Ray client mode (as e.g. in kubernetes).

Local release test runs succeeded.

https://buildkite.com/ray-project/release-tests-branch/builds/189
https://buildkite.com/ray-project/release-tests-branch/builds/191
2022-03-30 09:28:33 -07:00
Eric Liang
5aead0bb91
Warn if the dataset's parallelism is limited by the number of files (#23573)
A common user confusion is that their dataset parallelism is limited by the number of files. Add a warning if the available parallelism is much less than the specified parallelism, and tell the user to repartition() in that case.
2022-03-29 18:54:54 -07:00
xwjiang2010
6443f3da84
[air] Add horovod trainer (#23437) 2022-03-29 18:12:32 -07:00
Matti Picus
e58b784ac7
WINDOWS: fix pip activate command (#23556)
Continuation of #22449 

Fix pip activation so something like this will not crash
```
ray.init(runtime_env={"pip": ["toolz", "requests"]})
```

Also enable test that hit this code path.
2022-03-29 17:51:20 -07:00
Amog Kamsetty
0b8c21922b
[Train] Improvements to fault tolerance (#22511)
Various improvements to Ray Train fault tolerance.

Add more log statements for better debugging of Ray Train failure handling.
Fixes [Bug] [Train] Cannot reproduce fault-tolerance, script hangs upon any node shutdown #22349.
Simplifies fault tolerance by removing backend specific handle_failure. If any workers have failed, all workers will be restarted and training will continue from the last checkpoint.
Also adds a test for fault tolerance with an actual torch example. When testing locally, the test hangs before the fix, but passes after.
2022-03-29 15:36:46 -07:00
Gagandeep Singh
3856011267
[Serve] [Test] Bytecode check to verify imported function correctness in test_pipeline_driver::test_loading_check (#23552) 2022-03-29 13:18:25 -07:00
Linsong Chu
2a6cbc5202
[workflow]align the behavior of workflow's options() with remote function's options() (#23469)
The current behavior of workflow's `.options()` is to **completely rewrite all the options** rather than **update options**, this is less intuitive and inconsistent with the behavior of `.options()` in remote functions.

For example:
```
# Remote Function
@ray.remote(num_cpus=2, max_retries=2)
f.options(num_cpus=1)
```
`options()` here **updated** num_cpus while **the rest options are untouched**, i.e. max_retires is still 2. This is the expected behavior and more intuitive.

```
# Workflow Step
@workflow.step(num_cpus=2, max_retries=2)
f.options(num_cpus=1)
```
`options()` here **completely drop all existing options** and only set num_cpus, i.e. previous value of max_retires (2) is dropped and reverted to default (3).  This will also drop other fields like `name` and `metadata` if name and metadata are given in the decorator but not in the options().
2022-03-29 12:35:04 -07:00
Yi Cheng
61c9186b59
[2][cleanup][gcs] Cleanup GCS client options. (#23519)
This PR cleanup GCS client options.
2022-03-29 12:01:58 -07:00
Simon Mo
cb1919b8d0
[Doc][Serve] Add minimal docs for model wrappers and http adapters (#23536) 2022-03-29 11:33:14 -07:00
Matti Picus
0cb2847e2f
WINDOWS: make default node startup timeout longer (#23462)
Timeouts when starting nodes rank high on https://flakey-tests.ray.io/#owner=core. The default timeout should be longer on windows. For instance, [here](https://buildkite.com/ray-project/ray-builders-branch/builds/6720#d4cf497e-13d5-4b6b-9354-2dd8828bd0e7/2835-3259) is one such error.
2022-03-29 01:01:43 -07:00
Matti Picus
84026ef55d
WINDOWS: make timeout longer in test_metrics (#23461)
`test_metrics` scales quite high on https://flakey-tests.ray.io/#owner=core. This test is often hitting the timeout limit. Making it larger should help the test pass.
2022-03-29 00:59:13 -07:00
Matti Picus
77c4c1e48e
WINDOWS: enable and fix failures in test_runtime_env_complicated (#22449) 2022-03-29 00:56:42 -07:00
Chen Shen
44114c8422
[CI] pin click version to fix broken test. #23544 2022-03-29 00:44:48 -07:00
Chen Shen
1d0fe1e1c3
[doc/linter] fix broken deepmind link #23542 2022-03-28 22:35:53 -07:00
Yi Cheng
7de751dbab
[1][core][cleanup] remove enable gcs bootstrap in cpp. (#23518)
This PR remove enable_gcs_bootstrap flag in cpp.
2022-03-28 21:37:24 -07:00
Jian Xiao
cc0db8b92a
Fix Dataset zip for pandas (#23532)
Dataset zip cannot work for Pandas.
2022-03-28 17:58:31 -07:00
Kai Fricke
62414525f9
[tune] Optuna should ignore additional results after trial termination (#23495)
In rare cases (#19274) (and possibly old versions of Ray), buffered results can lead to calling on_trial_complete multiple times with the same trial ID. In these cases, Optuna should gracefully handle this case and discard the results.
2022-03-28 20:07:41 +01:00
shrekris-anyscale
aae144d7f9
[serve] Make Serve CLI and serve.build() non-public (#23504)
This change makes `serve.build()` non-public and hides the following Serve CLI commands:
* `deploy`
* `config`
* `delete`
* `build`
2022-03-28 10:40:57 -07:00
Kai Fricke
1465eaa306
[tune] Use new Checkpoint interface internally (#22801)
Follow up from #22741, also use the new checkpoint interface internally. This PR is low friction and just replaces some internal bookkeeping methods.

With the new Checkpoint interface, there is no need to revamp the save/restore APIs completely. Instead, we will focus on the bookkeeping part, which takes place in the Ray Tune's and Ray Train's checkpoint managers. These will be consolidated in a future PR.
2022-03-28 18:33:40 +01:00
mwtian
d1ef498638
[Python Worker] load actor dependency without importer thread (#23383)
Import actor dependency when not found, so actor dependencies can be imported without the importer thread.

Remaining blockers to remove importer thread are to support running a function on all workers `run_function_on_all_workers()`, and raising a warning when the same function / class is exported too many times.
2022-03-27 15:09:08 -07:00
shrekris-anyscale
65d72dbd91
[serve] Make serve.shutdown() shut down remote Serve applications (#23476) 2022-03-25 18:27:34 -05:00
Amog Kamsetty
7fd7efc8d9
[AIR] Do not deepcopy RunConfig (#23499)
RunConfig is not a tunable hyperparameter, so we do not need to deep copy it when merging parameters with Ray Tune's param_space.
2022-03-25 13:12:17 -07:00
Edward Oakes
cf7b4e65c2
[serve] Implement serve.build (#23232)
The Serve REST API relies on YAML config files to specify and deploy deployments. This change introduces `serve.build()` and `serve build`, which translate Pipelines to YAML files.

Co-authored-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
2022-03-25 13:36:59 -05:00
shrekris-anyscale
be216a0e8c
[serve] Raise error in test_local_store_recovery (#23444) 2022-03-25 13:36:51 -05:00
dependabot[bot]
e69f7f33ee
[tune](deps): Bump optuna in /python/requirements/ml (#19669)
Bumps [optuna](https://github.com/optuna/optuna) from 2.9.1 to 2.10.0.
- [Release notes](https://github.com/optuna/optuna/releases)
- [Commits](https://github.com/optuna/optuna/compare/v2.9.1...v2.10.0)

---
updated-dependencies:
- dependency-name: optuna
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kai Fricke <kai@anyscale.com>
2022-03-25 17:58:22 +00:00
Jan Weßling
f78404da4a
[serve] Add ensemble model example to docs (#22771)
Added ensemble model examples to the Documentation. That was needed, due to a user request and there was no methodology outlining the creation of higher level ensemble models.

Co-authored-by: Jiao Dong <sophchess@gmail.com>
2022-03-25 11:17:54 -05:00
ddelange
e109c13b83
[ci] Clean up ray-ml requirements (#23325)
In https://github.com/ray-project/ray/blob/ray-1.11.0/docker/ray-ml/Dockerfile, the order of pip install commands currently matters (potentially a lot). It would be good to run one big pip install command to avoid ending up with a broken env.

Co-authored-by: Kai Fricke <krfricke@users.noreply.github.com>
2022-03-25 15:59:54 +00:00