-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix conflicting multithreading and fork management #4169
Fix conflicting multithreading and fork management #4169
Conversation
Details about this issueIn compilation Triton creates native triton/python/triton/compiler/compiler.py Line 271 in f04df24
This object is not removed instantly after compilation ends. I've tried to remove it by python If program forks right after compiling one kernel, |
@binarman Then why this is not an issue on nv backend? |
@zhanglx13 My conclusion is that we were just lucky this issue did not showed before. P.s. pay attention that I've disabled automatic GC in test, otherwise this test is flickering |
@antiagainst please, take a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome findings! Just some nits around comments.
This PR disables multithreading in MLIR context after compilation ends. This is done to safely finalize thread pool implemented in MLIRContext. Not properly finalized thread pool can hang or crash in child process after fork.
ff4de99
to
6e8483e
Compare
@antiagainst added more comments, PTAL |
how would you reproduce the problem? |
hi! |
Drop the change in |
@ThomasRaoux kind reminder |
…-lang#4169) This PR disables multithreading in MLIR context after compilation ends. This is done to safely finalize thread pool implemented in MLIRContext. Not properly finalized thread pool can hang or crash in child process after fork. --------- Co-authored-by: Lei Zhang <[email protected]>
This PR disables multithreading in MLIR context after compilation ends. This is done to safely finalize thread pool implemented in MLIRContext. Not properly finalized thread pool can hang or crash in child process after fork.