The emergence of a variety of new workloads in machine learning and artificial intelligence has pushed the limits of existing systems for distributed computing. We introduce Ray, a new system designed to support these workloads and to provide the required scalability, flexibility, and fault tolerance. Ray provides a lightweight API based on dynamic task graphs and actors to flexibly express a wide range of applications. We discuss architectural and API design decisions and show how to build high-performance applications on top of Ray. The code is available at https://github.com/ray-project/ray.