@@ -7,28 +7,37 @@ To use Ray, you need to understand the following:
7
7
8
8
## Overview
9
9
10
- Ray is a distributed extension of Python. When using Ray, several processes are
11
- involved.
12
-
13
- - A ** scheduler** : The scheduler assigns tasks to workers. It is its own
14
- process.
15
- - Multiple ** workers** : Workers execute tasks and store the results in object
16
- stores. Each worker is a separate process.
17
- - One ** object store** per node: The object store enables the sharing of Python
18
- objects between worker processes so each worker does not have to have a separate
19
- copy.
20
- - A ** driver** : The driver is the Python process that the user controls and
21
- which submits tasks to the scheduler. For example, if the user is running a
22
- script or using a Python shell, then the driver is the process that runs the
23
- script or the shell.
10
+ Ray is a Python-based distributed execution engine. It can be used on a single
11
+ machine to achieve effective multiprocessing, and it can be used on a cluster
12
+ for large computations.
13
+
14
+ When using Ray, several processes are involved.
15
+
16
+ - Multiple ** worker** processes execute tasks and store results in object stores.
17
+ Each worker is a separate process.
18
+ - One ** object store** per node stores immutable objects in shared memory and
19
+ allows workers to efficiently share objects on the same node with minimal
20
+ copying and deserialization.
21
+ - One ** local scheduler** per node assigns tasks to workers on the same node.
22
+ - A ** global scheduler** receives tasks from local schedulers and assigns them
23
+ to other local schedulers.
24
+ - A ** driver** is the Python process that the user controls. For example, if the
25
+ user is running a script or using a Python shell, then the driver is the Python
26
+ process that runs the script or the shell. A driver is similar to a worker in
27
+ that it can submit tasks to its local scheduler and get objects from the object
28
+ store, but it is different in that the local scheduler will not assign tasks to
29
+ the driver to be executed.
30
+ - A ** Redis server** maintains much of the system's state. For example, it keeps
31
+ track of which objects live on which machines and of the task specifications. It
32
+ can also be queried directly for debugging purposes.
24
33
25
34
## Starting Ray
26
35
27
36
To start Ray, start Python, and run the following commands.
28
37
29
38
``` python
30
39
import ray
31
- ray.init(start_ray_local = True , num_workers = 10 )
40
+ ray.init(num_workers = 10 )
32
41
```
33
42
34
43
That command starts a scheduler, one object store, and ten workers. Each of
0 commit comments