We are happy to announce that we are adding a Ray Launcher to the Hydra Launchers family. Hydra's Launcher plugins enable launching to different environments without changing your existing workflows or application code. The Hydra Ray Launcher can be used to launch your application to a new or existing Ray cluster, locally or on AWS. In this post we demonstrate the major functionalities of the Launcher. For more details on installation and configuration, please check out the Hydra Ray Launcher documentation. As always, please join our community and give us feedback!
Ray is a simple yet powerful Python library for parallel and distributed programming. Among the many features it provides, Ray comes with a cluster launcher that can be used to provision resources and start a Ray cluster on top of them. Hydra Ray Launcher is built on top of the Ray Tasks API and the Ray cluster launcher.
Hydra Ray Launcher simplifies your experience by allowing the Ray cluster setup to be configured transparently by Hydra (eliminating the need for an external YAML file while maintaining the flexibility). Hydra Ray Launcher comes with reasonable default configurations which can be found here (under the heading, “Discover ray_aws launcher's config”). You can override them in your application config or from the command line to fit your use case. The following Ray Launcher example code (e.g., my_app.py) is runnable and can be found here.
Launch your Hydra application to AWS by simply overriding:
If you want to do a quick local test,
you can spin up a local Ray cluster at application run time by specifying
In this example, we create a new Ray cluster at application time.
You can launch the application on an existing local Ray cluster by configuring the cluster address
hydra/launcher=ray. In the following example we configure the Ray cluster address
to local ray cluster and Hydra Ray Launcher was able to connect to the existing Ray cluster and
execute the application code:
Hydra Ray Launcher is built on top of Hydra 1.0 and you have access to all of the benefits Hydra brings:
Hyperparameter sweeps are common in machine learning research. Hydra has built-in grid search and provides several Sweeper plugins for hyperparameter optimization. Sweepers can be used together with Launchers for sweeping on different computing platforms. Start from our documentation here to find more.
Modern Hydra applications and Hydra Plugins leverage Structured Configs for config validation, and Hydra Ray Launcher is no exception. In the following example, we try to override the Ray cluster’s autoscaling mode with an illegal value: