Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting started with Anyscale concepts, code, and clusters

Getting started with Anyscale concepts, code, and clusters

In this webinar, the Anyscale solutions team will guide you through the steps of taking your Python workloads to the cloud. Previous knowledge of Ray is helpful but not required as we demonstrate the concepts behind running distributed loads in the cloud, and how to interact with Ray and Anyscale in your Python code.

Learn about what it takes to run at scale whether you:
- Need help distributing Python
- Want to supercharge a Jupyter notebook
- Have machine learning (ML) processes that you want to operationalize

Anyscale

March 10, 2022
Tweet

More Decks by Anyscale

Other Decks in Technology

Transcript

  1. Getting Started with Anyscale
    Charles Greer
    Solutions Architect, Anyscale
    Javier Redondo
    Product Manager, Anyscale

    View full-size slide

  2. 1. Why Anyscale
    2. Anatomy of a Ray Program
    3. Scaling Ray Applications
    4. Using Anyscale and the Cloud
    Agenda

    View full-size slide

  3. 1. Machine Learning
    2. Ray Libraries
    3. Integrations
    4. Complex Dependencies
    Not Agenda

    View full-size slide

  4. Why Anyscale?
    ● You've got some computational task to be done.
    ● One machine is not enough.
    Writing for more than one machine was hard…
    until Ray

    View full-size slide

  5. Use Ray and Run it on Anyscale
    ● Ray makes distributed computing easy
    ● Ray makes Machine Learning workloads easy to scale
    Ray and Anyscale make it easy compute at massive scale.

    View full-size slide

  6. What is computing at massive scale?
    ● Python functions (Ray Core)
    ○ "I want to run OCR on 5 million documents"
    ○ "I want to run time series forecasting on 100k features"
    ● Machine Learning Tasks
    ○ Hyperparameter tuning
    ○ Distributed training
    ○ Model Serving
    ● Simulations
    ○ Digital Twin
    ○ Video Game Learning

    View full-size slide

  7. Before we get started
    ● Use Anyscale and Ray docs for tutorials and reference
    ○ https://www.ray.io/docs https://docs.anyscale.com
    ● Slides and code will be available on github.
    ○ https://github.com/anyscale/getting-started-webinar
    ● Anyscale has a great series of meetups, summits and webinars
    ○ https://www.anyscale.com/events

    View full-size slide

  8. Pause…
    … Ray Anatomy

    View full-size slide

  9. A Picture
    of Ray

    View full-size slide

  10. What is Anyscale doing? What does your code do?
    Ray and Anyscale Together
    ● Make copies of your code
    ● Manage remote tasks
    ● Hold function return values
    ● Get more machines as needed
    ● Get rid of unused machines
    ● Give you observability tools
    Your Code:
    ● Calculates things
    ● Writes logs
    ● Reads input
    ● Processes data
    ● Writes output
    ● Integrates with 3rd party systems
    ● Has Bugs

    View full-size slide

  11. Cloud
    Ready
    Applications

    View full-size slide

  12. Cloud
    Ready
    Applications

    View full-size slide

  13. Pause…
    … [Any]scaling

    View full-size slide

  14. Scaling Ray
    num_cpus
    ray.init(num_cpus=100)
    Actor.options(num_cpus=0.01)
    @ray.remote(num_cpus=1)
    Cluster resources
    ray.cluster_resources()
    ray.autoscaler.sdk
    .request_resources(
    num_cpus=100)

    View full-size slide

  15. Run Interactively, on Anyscale
    New Cluster Every Time:
    ● ray.init("anyscale://")
    ● ray.init("anyscale://project/")
    Start then re-use an existing Cluster:
    ● ray.init("anyscale://cluster")
    ● ray.init("anyscale://project/cluster")

    View full-size slide

  16. Pause…
    … Your Environment(s)

    View full-size slide

  17. Environments on Anyscale

    View full-size slide

  18. Cluster
    Environment
    ● Docker Image for your
    Anyscale Compute
    ● Build in UI or SDK
    ● Base image selection
    ● Dependencies
    ○ Conda
    ○ Pip
    ○ Debian
    ● Post-install Commands
    ○ Custom setups
    ○ Manipulate .bashrc*
    Cluster Compute
    Config
    ● Machine types
    ● Region
    ● Cloud Provider
    ● Autosuspend
    ● Create in UI or at Runtime
    Runtime
    Environment
    ● Specific to Session, Job, or
    Services
    ● Dependencies
    ○ Conda*
    ○ Pip
    ○ Environment variables
    ○ Working directory
    ● Installed at launch time
    For all: Use by
    ○ ray.init()
    ○ Jobs yaml configuration
    ○ Services yaml configuration

    View full-size slide

  19. Using Cluster Environments and Cluster Compute Configs
    ctx = ray.init("anyscale://getting_started/my_cluster",
    runtime_env={"working_dir" : "."},
    cluster_env="demo-with-aws:3",
    cluster_compute="demos-s3-access",
    )

    View full-size slide

  20. Using Configs - S3 on Fully Managed Anyscale
    ● Create a role in your Amazon Acct that Anyscale can Use
    https://docs.anyscale.com/user-guide/configure/access-resources-from-cloud/overview
    ● Give this role permissions to access S3
    ● Configure a Cluster Compute to leverage this role
    ● (optional) Configure a Cluster Environment to install the AWS CLI
    ● Use them all together

    View full-size slide

  21. Pause…
    … Anyscale Jobs

    View full-size slide

  22. Anyscale Jobs
    ● Your code works - ready to give to operations team.
    ● Hands-off production runs.
    ● Cluster lifecycle management by Anyscale.
    ● Use from Anyscale CLI or SDK
    ● For long-running processes, use Anyscale Services and Ray Serve

    View full-size slide

  23. Jobs
    and
    Services

    View full-size slide

  24. Anyscale Jobs
    anyscale job submit my_job.yaml
    my_job:yaml:
    name: webinar-job
    cloud: anyscale-managed-2
    Runtime_env:
    working_dir:
    "https://github.com/anyscale/getting-started-webinar/archive/refs/hea
    ds/master.zip"
    entrypoint: "python a_script.py 1012"
    max_retries: 3

    View full-size slide

  25. The Adventure Continues
    ● Ray Libraries for ML
    ○ Ray Train
    ○ Ray Tune
    ○ RLlib
    ○ Ray Serve
    ● Anyscale Services
    ○ Scaling Model Serving
    ● Your use case……

    View full-size slide

  26. Supercharge your Ray journey on Anyscale
    Accelerate time to market
    Enterprise ready
    Observability
    Get full visibility into your Ray workloads
    Multi-Cloud
    Diversify and deploy your workloads across
    public clouds with a click of a button.
    Fully-managed service
    Focus on innovation; not infra ops
    From the creators of Ray
    Access to Ray experts
    Built for dev -> prod journey
    Scale from laptop to cloud seamless;
    Easy CI/CD integration

    View full-size slide

  27. Simplify your MLOps with Anyscale
    Effortlessly deploy AI workflows and models into production with your existing CI/CD tools.
    Production jobs & services
    Deploy ML workflows & models
    into production with ease
    Observability
    Monitor health with event logs
    and prebuilt dashboards
    App packaging
    Package apps, incl. all code
    and library dependencies
    APIs & SDKs
    Automate and integrate into
    your workflows (eg. CI/CD)

    View full-size slide