Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change NodeLocalTransformation Pool to use spawn instead of fork #117

Open
bwintermann opened this issue Jun 6, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@bwintermann
Copy link

Prerequisites

Current main commit: db969e6

Quick summary

The use of mp.Pool in qonnx/transformation/base.py for NodeLocalTransform can cause deadlocks in certain cases.

Details

During work on FINN, I encountered an issue where calling HLSSynthIP() (which inherits from NodeLocalTransform) in a multithreaded context could deadlock the processes from the MP pool. This is very likely caused by Python's start method defaulting to 'fork'. It is a well known issue and the solution is mostly to change the start method either globally or locally using get_context("spawn").Pool(...). Arguably a transform designed to be parallelized should not be multithreaded as well normally, however the default start method will be switched to spawn in Python 3.14 anyways, and changing it to spawn manually for earlier versions does not have any negative impacts and might prevent issues in the best case.

@bwintermann bwintermann added the bug Something isn't working label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant