Skip to content

Commit

Permalink
Force DHT to be mp.context.ForkProcess (#589)
Browse files Browse the repository at this point in the history
This doesn't change anything on Linux but helps macOS users. Specifically, it's helps to:

- Avoid [this error](bigscience-workshop/petals#405 (comment)) for people who don't use `if __name__ == "__main__"` in simple scripts on macOS (that uses spawn for processes by default).
- Make DHT consistent with other code that inherits from `mp.context.ForkProcess` directly.

(cherry picked from commit 1eb5d18)
  • Loading branch information
borzunov authored and mryab committed Aug 31, 2023
1 parent 0bbe4a5 commit 95772be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hivemind/dht/dht.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ReturnType = TypeVar("ReturnType")


class DHT(mp.Process):
class DHT(mp.context.ForkProcess):
"""
A high-level interface to a hivemind DHT that runs a single DHT node in a background process.
* hivemind servers periodically announce their experts via declare_experts (dht_handler.py)
Expand Down

0 comments on commit 95772be

Please sign in to comment.