-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Attempt to Fix PauliSumCollector.collect_async warning under notebook(short-term solution) #4004
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
Merged
95-martin-orion
merged 15 commits into
quantumlib:master
from
BichengYing:async_warning
Jul 19, 2021
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6d957d6
add nest_asyncio to solve collector under notebook environment
BichengYing c8604bf
Merge branch 'master' into async_warning
BichengYing c6cbbfc
Merge branch 'master' into async_warning
BichengYing b2d9269
Fix the typo in clifford_gate::test_commutes_pauli
BichengYing 0234dda
Revert "Fix the typo in clifford_gate::test_commutes_pauli"
BichengYing 7596136
Merge remote-tracking branch 'upstream/master' into master
BichengYing 3121748
Merge remote-tracking branch 'upstream/master' into master
BichengYing 566db2f
Merge remote-tracking branch 'upstream/master' into master
BichengYing 8b8125e
Merge branch 'master' into async_warning
BichengYing 3c39402
Add warning above the cell
BichengYing a3de6d3
Fix for nit
BichengYing 17d9408
Merge branch 'master' into async_warning
CirqBot ed9f30c
Merge branch 'master' into async_warning
BichengYing f5d15d5
Merge branch 'master' into async_warning
BichengYing 7e50b9a
Merge branch 'master' into async_warning
BichengYing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I tried to run this cell, but it's taking an unreasonably long time to complete (5+ minutes). To minimize the impact on test times, we should reduce
samples_per_term
to a number that allows this to complete in 30 seconds or less.If this requires choosing an unrealistically low value for
samples_per_term
, please also add a comment explaining why we're using the new value.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.
That is strange. It is super quick to run that. In google colab that line takes less than 300ms.


In the github action, the whole notebook execution is like one and half minutes.
I wonder why it takes you so long time to complete. (I guess maybe related to live lock?) Could you show your test environment?
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.
I'm running this directly from the Colab link (modified to point to the latest commit on this PR) and the execution consistently hangs or crashes - I haven't had a run complete successfully yet.
Logs include
IndexError: pop from an empty deque
, but it's unclear whether that's coming from the Colab restart or from asyncio.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.
For clarity, I've been running the linked colab with the
Runtime > Run all
command.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.
Interesting. Yes, if I click
Run all
, it will fail. But if clickRun before
that Cell and then manuallyshift+Enter
run that cell can be finished quickly. I guessRun all
added another layer of running environment caused this. I will take a look to understand this better.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.
I can reproduce this result -
Run before
and then running this cell also succeeds for me. Thanks for digging into this!Uh oh!
There was an error while loading. Please reload this page.
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.
I still do not understand why this happens. What I found is the TensorFlow Federated colab has encountered similar asynchrony issue and they used nest_asyncio as well for solution. I tried to use
Run all
their colab, and they do not have similar issue :/