Open MilesCranmer opened 1 year ago
I forget if this is Julia specific or Jupyter, but there's a different behavior if you click stop once vs. 5 times in succession within a couple of seconds. Does the latter work?
We would need to make sure the interrupt signal gets propagated. Does this work properly if we are running a Julia kernel directly?
Clicking stop quickly in succession does not seem enough to break out of the Julia call, unfortunately. @mkitti do you mean would
I wonder whether this behavior is seen in libraries which make lengthy and synchronous python calls to C++ backends? And if so, how they deal with it… Maybe it’s different because it is CPython and all.
I mean does interrupt work correctly from a Jupyter IJulia kernel? https://github.com/JuliaLang/IJulia.jl
We would need to make sure the interrupt signal gets propagated
I guess by this, @mkitti means the interrupt signal must pass through the interface without vanishing. It seems that it vanishes somehow. I am not familiar with the codebase of PyCall :(
I mean does interrupt work correctly from a Jupyter IJulia kernel? https://github.com/JuliaLang/IJulia.jl
That will be besides the point because the MWE above is in the Python REPL...
Right now it seems impossible to stop early within Jupyter notebooks. If one enters a search that takes a long time, the only way to quit is to restart the Jupyter kernel entirely. How might we be able to get early stopping working in Jupyter, through PyCall.jl? Ideally, hitting the stop button should be enough. However, hitting
<ctl-c>
in any PyJulia call does not work.Would any of you happen to have ideas for implementing this; @mkitti @ngam @marius311?
A MWE is:
this cannot be stopped early inside IPython/Jupyter. It only can be stopped early within Python itself.
Maybe something like releasing the GIL after calling Julia... But that seems a bit dangerous.