-
Notifications
You must be signed in to change notification settings - Fork 569
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
Async / asynchronous execution #1092
Comments
Do you mean for the ExecutePreprocessor or any template conversion in general? From #1045 we were planning on pulling the execute preprocessor code out of nbconvert, which would be a good opportunity to make it async aware. For other conversions async would probably also be possible in nbconvert 6.0 as we'll be jumping to python 3 only and able to make more dramatic changes in that process. |
Seems like using tornado's run_on_executor or a pool, as on nbviewer, might
be appropriate for the voila case.
Having said that, async nbconvert is a whacking good idea, and just expect
everything in the pipeline to potentially be async... while still providing
the sync API for a while.
…On Fri, Aug 23, 2019, 12:50 Matthew Seal ***@***.***> wrote:
Do you mean for the ExecutePreprocessor or any template conversion in
general?
From #1045 <#1045> we were
planning on pulling the execute preprocessor code out of nbconvert, which
would be a good opportunity to make it async aware. For other conversions
async would probably also be possible in nbconvert 6.0 as we'll be jumping
to python 3 only and able to make more dramatic changes in that process.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1092?email_source=notifications&email_token=AAALCRH55DYDTWYUHUXNUNTQGAILRA5CNFSM4IPACJEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5AX37I#issuecomment-524385789>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAALCRF6TS7T447EXMQPIODQGAILRANCNFSM4IPACJEA>
.
|
Interesting. FWIW - @takluyver asked me to look into getting ExecutePreprocessor (relative to #809) working in a synchronous manner given that we decided to make the new kernel management package only async (see this comment). But, given this conversation, would it be more worthwhile to see how this behaves in an async manner anyway (also relative to work done in takluyver/jupyter_kernel_mgmt#23)? Not sure how this effort, in either case, would be affected by #1045 but I think some good data points can be learned in any event. |
@mpacer had the most interest in spearheading a separate execute package that nbconvert and papermill both imported. I believe she also wanted to support async and synchronous use-cases in this change. |
great. I've been doing some experimentation with using asyncio with voila, and it seems to be working great (tornado is much more responsive). I requires changes/features in jupyter_client, and I think we'd want to not develop this inside of nbconvert. (No PR's open yet) |
I'm definitely interested in this, and appreciate folks bringing up this exciting topic! I am not sure how many cycles I will have free to spearhead it in a reasonable time-frame. @maartenbreddels I realize you don't have any PRs in nbconvert or jupyter_client, but is there somewhere where we all could look at the code to more fully grok how you're using asyncio with voila? |
I think that might be a decent stop-gap measure, @bollwyvl could you link to the code on nbviewer that could give folks a starting place for how to implement this for voila? |
Yes, I plan to open a WIP PR for that on Friday, I have to clean up the code a bit, it's a lot of copy/paste + adding async and await at many places. But I'd rather have a bad PR open to start experimenting/discussing. |
@jtpio had a nice PR on that: https://github.com/QuantStack/voila/pull/364/files But this solution will not work for us since we want to execute cell by cell (async) to allow progressive rendering. What is done in that PR will return the execution after it's done, not after each cell execution. |
A POC for an async jupyter client is jupyter/jupyter_client#471 |
In voila, we run into a performance problem because nbconvert blocks during the execution of cells voila-dashboards/voila#363. This execution is handled in the tornado handler, causing all other trafic to stop/block.
Are there plans to have nbconvert use the tornado/zmq/ioloop and have a async way of generating cells results?
The text was updated successfully, but these errors were encountered: