Hydra Ray Launcher
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.
#
Launching to a new or existing AWS clusterHydra 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: hydra/launcher=ray_aws
:
#
Launching to a new local Ray ClusterIf you want to do a quick local test,
you can spin up a local Ray cluster at application run time by specifying hydra/launcher=ray
.
In this example, we create a new Ray cluster at application time.
#
Launching to an existing local Ray ClusterYou can launch the application on an existing local Ray cluster by configuring the cluster address
and overriding 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:
#
Parameter sweeps and optimizationHyperparameter 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.
#
Config type safetyModern 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:
That’s it for now! Please try out the new Hydra Ray Launcher and let us know what you think. We are always happy to connect with you via GitHub or the Hydra Chat.