Skip to content

Multiprocess slow start for ops #7338

Answered by alangenfeld
joshuataylor asked this question in Q&A
Discussion options

You must be logged in to vote

One tool to avoid repeating the cost is to use the start_method forkserver which is available as config on the multiprocess executor. The first op will still pay the init cost to create the template process, but each subsequent op should be faster as it forks that template process instead of starting from scratch. You may need to explicitly set preload_modules in the config if the default behavior doesn't load the necessary modules.

context: https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@prha
Comment options

prha Apr 20, 2022
Maintainer

Comment options

You must be logged in to vote
1 reply
@alangenfeld
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by joshuataylor
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type: troubleshooting Related to debugging and error messages
4 participants