question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Many processes spawned for a simple ray code

See original GitHub issue

For this small piece of code,

import ray

ray.init(num_cpus=1)
print('Enter something')
t = input()

Totally 7 processes are spawned. Why is this happening ? Is this intentional ?

Screenshot 2020-08-31 at 10 43 41 PM

And when I don’t set the num_cpus value, since it automatically sets to the number of cores, the processes spawned goes up from 7 to 14

Screenshot 2020-08-31 at 10 46 37 PM

I am using ray version 0.8.7 in MacOS with Python 3.7.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rkooo567commented, Sep 7, 2020

Must be the dashboard if it is a head node

0reactions
wuisawesomecommented, Sep 7, 2020

Btw I checked on this and also count many processes but this is to be expected.

The python processes that I see

  • reporter
  • worker
  • log monitor
  • monitor
  • reaper
  • driver

I’m not sure what the 7th one you’re seeing is, but in general these are to be expected. These are all to be expected, and you shouldn’t need to worry about them (but we can point you to some references if you’re curious).

I will close this issue for now, but feel free to reopen it if this is something problematic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Distributed multiprocessing.Pool — Ray 2.2.0
Ray supports running distributed python programs with the multiprocessing.Pool API using Ray Actors instead of local processes. This makes it easy to scale ......
Read more >
Spawning and Destroying an Actor | Unreal Engine 4.27 ...
In this How-To guide, you will create your own Actor to spawn, and aActor Spawner which will spawn your Actor at the click...
Read more >
Writing Distributed Applications with PyTorch
For the purpose of this tutorial, we will use a single machine and spawn multiple processes using the following template. """run.py:""" #!/usr/bin/env python ......
Read more >
Getting Started with Ray | Domino Data Science Blog
Ray is a general framework that enables quick parallelization of Python code. Our tutorial shows you how to access Ray clusters for distributed...
Read more >
Parallelization with ray not working as expected - Stack Overflow
there are two main problems when it comes to multiprocessing (your code). there's an overhead associated with spawning the new processes to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found