Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ray: Enterprise-Grade, Distributed Python

216 views

Published on

Ray (ray.io) is an open-source, distributed framework from U.C. Berkeley’s RISELab that easily scales Python applications from a laptop to a cluster.

Published in: Data & Analytics
  • Be the first to comment

  • Be the first to like this

Ray: Enterprise-Grade, Distributed Python

  1. 1. Ray: Enterprise-Grade, Distributed Python Dean Wampler Anyscale
  2. 2. @deanwampler Feedback Your feedback is important to us. Don’t forget to rate and review the sessions.
  3. 3. Agenda Why Ray? Demo When to use Spark? When to use Ray? How to get started with Ray
  4. 4. Why Ray?
  5. 5. @deanwampler Usage% 2012 2014 2016 Ti 05 Hence, there is a pressing need for robust, easy to use solutions for distributed Python Model sizes and therefore compute requirements outstripping Moore’s Law Moore’s Law (2x every 18 months) 35x every 18 months! Python growth driven by ML/AI and other data science workloads
  6. 6. Reinforcement Learning: Motivation for Ray
  7. 7. @deanwampler Decisions (actions) Consequences (observations, rewards) environmentagent
  8. 8. @deanwampler Beating Lee Sedol…
  9. 9. @deanwampler ▪Observations ▪ Board state ▪Actions ▪ Where to place stones ▪Rewards ▪ 1 if win ▪ 0 otherwise AlphaGo (Silver et al. 2016)
  10. 10. @deanwampler
  11. 11. @deanwampler Diverse Compute Requirements Motivated Creation of Ray! Simulator (game engine, robot sim, factory floor sim…) Neural network “stuff” And repeated play, over and over again, to train for achieving the best reward Complex agent?
  12. 12. The Ray Ecosystem
  13. 13. @deanwampler Hyperparameter Tuning Training Simulation Model Serving
  14. 14. @deanwampler Microservices (simulators, too) REST API Gateway µ-service 1 µ-service 2 µ-service 3 Nice! (In theory…)
  15. 15. @deanwampler Microservices (simulators, too) REST API Gateway µ-service 1 µ-service 2 µ-service 3 Production is a pain API GatewayAPI Gateway µ-service 1 µ-service 2µ-service 2µ-service 2µ-service 2µ-service 2 µ-service 3µ-service 3µ-service 3 ! Each microservice has a different number of instances for scalability & resiliency ! But they have to be managed explicitly
  16. 16. @deanwampler Ray Cluster task/ actortask/ actor task/ actor task/ actortask/ actor task/ actor task/ actor task/ actor task/ actor task/ actor task/ actor task/ actor task/ actor task/ actor Microservices (simulators, too) REST API Gateway µ-service 1 µ-service 2 µ-service 3 Back to simplicity ! Back to one “logical” instance ! Ray handles scaling transparently
  17. 17. Demo!
  18. 18. When to use Spark When to use Ray
  19. 19. @deanwampler Where Spark Excels ▪ Massive-scale data sets ▪ Uniform, records with a schema ▪ Efficient, parallelized transformations ▪ SQL ▪ Batch analytics ▪ Stream processing ▪ Intuitive, high-level abstractions for data science & engineering tasks
  20. 20. @deanwampler Where Ray Excels ▪ Highly non-uniform data graphs ▪ Think typical “in-memory object models”, but distributed ▪ Handles distributed state intuitively ▪ Highly non-uniform task graphs ▪ Small to large scale tasks ▪ Intuitive API for the “90%” of cases ▪ Supports compute problems ranging from ▪ general services, games, and simulators ▪ to ▪ stochastic gradient descent, HPO, …
  21. 21. Getting started with Ray
  22. 22. @deanwampler If you’re already using these… ▪ asyncio ▪ joblib ▪ multiprocessing.Pool ▪ Use Ray’s implementations ▪ Drop-in replacements ▪ Change import statements ▪ Break the one-node limitation! For example, from this: from multiprocessing.pool import Pool To this: from ray.util.multiprocessing.pool import Pool
  23. 23. @deanwampler Ray Community and Resources ▪ ray.io - entry point for all things Ray ▪ Tutorials: anyscale.com/academy ▪ github.com/ray-project/ray ▪ anyscale.com/events
  24. 24. @deanwampler Feedback Your feedback is important to us. Don’t forget to rate and review the sessions.

×