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

Avoiding mp.Pool in case of using only 1 worker for easier pdb debugging #127

Merged

Conversation

lstasytis
Copy link
Contributor

Problem:
When debugging QONNX model transformations which can make use of applyNodeLocal using pdb, the use of multiprocessing.Pool stops the debugger from being able to stop at the exact stack frame which is created by the process forked using the multiprocessing library if the error happened there.

The stack frame can still be accessed by breakpointing right before the actual error occurs, however this would require prior knowledge of where the code breaks, which can be highly undesirable.

Solution:
Intuitively, the user would expect that if they simply set their num_workers to 1, that multiprocessing will not be called and pdb will work as expected. Thus, I propose to simply check for this case and run the applyNodeLocal() function 'as is' without mp.Pool if the worker count is set to 1.

@maltanar
Copy link
Collaborator

maltanar commented Aug 9, 2024

@lstasytis can you please run pre-commit run --all to run the linter and push an update to the PR? I added some instructions here:

https://github.com/fastmachinelearning/qonnx?tab=readme-ov-file#linting

@maltanar maltanar merged commit 2281a77 into fastmachinelearning:main Aug 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants