Lightning-AI / Lightning-AI/lightning-thunder
Inject stack frame into traceback when the push_stack_frame ctx pops the stack frame during an exception state
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
*Note*: If you have a model or program that is not supported yet but should be, please use the program coverage template.
## 🐛 Bug
The cause exceptions in things like the bug in #2300 currently contain only the CPython interpreter frames in the backtrace.
This means that valuable information from the Thunder Interpreter frame stack (i.e. the user code is causing this) is lost.
### To Reproduce
```
def fn():
list.__getitem__(int) # raises
thunder.jit(fn)()
```
This will error regardless, but it should have a frame stack including the Thunder Interpreter frames in the stacktrace for
```
TypeError: SequenceWrapperMethods.__getitem__() missing 1 required positional argument: 'idx'
The above exception was the direct cause of the following exception:
```
cc @borda
Contributor guide
No contributing guide indexed for this repository
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 running the provided fn and thunder.jit(fn)() reproduction to inspect the current traceback. Trace how the push_stack_frame context handles an exception while its frame is popped, then verify that the resulting traceback includes the Thunder Interpreter frames as well as the CPython frames.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100