Uninterruptible Execution Upon Error in Google Colab
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 455
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 165
Description
Required prerequisites
- Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
- If possible, make a PR with a failing test to give us a starting point to work on!
Describe the bug
If any error occurs when using CUDA-Q in Google Colab, the execution often becomes uninterruptible, and would require restarting the entire Colab session. This makes REPL trial-and-error editing difficult on Colab.
This issue doesn't seem to occur when running a python script on a local machine, or using a self-hosted jupyter lab.
Potentially related: https://github.com/NVIDIA/cuda-quantum/issues/244, https://github.com/NVIDIA/cuda-quantum/issues/1764
Thanks @Squirtle007 and @y-h-Lin for helping confirm this issue.
Steps to reproduce the bug
- Open a New Notebook on Colab
- Create and Execute Cell 1:
!pip install cudaq - Create and Execute Cell 2:
import cudaq print(A) - Observe the uninterruptible execution.
Full Error Message:
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
NameError: name 'A' is not defined
During handling of the above exception, another exception occurred:
AttributeError: 'NameError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
AssertionError
NameError: name 'A' is not defined
During handling of the above exception, another exception occurred:
AttributeError: 'NameError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
TypeError: object of type 'NoneType' has no len()
During handling of the above exception, another exception occurred:
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
AssertionError
NameError: name 'A' is not defined
During handling of the above exception, another exception occurred:
AttributeError: 'NameError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
TypeError: object of type 'NoneType' has no len()
During handling of the above exception, another exception occurred:
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
TypeError: object of type 'NoneType' has no len()
During handling of the above exception, another exception occurred:
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
AssertionError
Expected behavior
When an error occurred, the execution should be interruptible by clicking the Stop button, and should not require a session restart.
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
- CUDA-Q version: 0.9.1
(!pip install cudaqon Google Colab) - Python version: Python 3.10.12
(!python --versionon Google Colab) - C++ compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
(!gcc --versionon Google Colab) - Operating system: Ubuntu 22.04.3 LTS
(!lsb_release -aon Google Colab)
Suggestions
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure in a fresh Google Colab notebook with CUDA-Q 0.9.1, using the two cells and traceback shown in the issue; compare it with a local Python script or self-hosted JupyterLab. Trace the error-handling path around the inspect and render_traceback failures, and consider related issues 244 and 1764. Done means a cell error remains interruptible through Colab’s Stop button without restarting the session.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100