1.1. Ray-Key Concepts

1.1. Key Concepts

Key ConceptsKey Concepts

This section outlines the key concepts of Ray. These primitives work together to give Ray the flexibility to support a wide range of distributed applications.

Task Tasks

Ray enables arbitrary functions to be executed asynchronously on independent Python workers. These asynchronous Ray functions are called "tasks". Ray enables tasks to specify their resource requirements in terms of CPU, GPU, and custom resources. These resource requests are used by the cluster scheduler to distribute tasks across the cluster for parallel execution.

See the task's user guide.

Actors

Actors extend Ray's API from functions (tasks) to classes. An actor is essentially a stateful worker (or service). When a new actor is instantiated, a new worker is created, the actor's methods are scheduled on that particular worker, and can access and change the state of that worker. Like tasks, actors support CPU, GPU, and custom resource requirements.

See the user guide for "actors".

Objects

In Ray, tasks and actors create objects and perform computations. We call these objects remote objects because they can be stored anywhere in the Ray cluster, and we refer to them using object references. Remote objects are cached in Ray's distributed shared memory object store, with one object store per node in the cluster. In a cluster setup, a remote object can live on one or more nodes, regardless of who holds the object index.

See Objects User's Guide.

Placement Groups Placement Groups

placement group

Guess you like

Origin blog.csdn.net/u012743772/article/details/130683903