Lightning-AI / Lightning-AI/lightning-thunder

Make trace introspection available as methods or attribute accesses on functions returned by Thunder

Open
#1,418 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.5k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature

Make trace introspection available as methods or attribute accesses on functions returned by `thunder.jit`.

Looking at the last traces of a thunder callable currently requires importing Thunder explicitly. They are currently hidden behind `._lc_cs` attribute:
https://github.com/Lightning-AI/lightning-thunder/blob/a0a61518a70d80ab5ce4d1b6e44bcae159d81bb0/thunder/__init__.py#L836

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in thunder/__init__.py around line 836, where the hidden _lc_cs trace access is exposed on functions returned by thunder.jit. Review the existing callable behavior and define the supported method or attribute access for retrieving recent traces; done means callers can introspect traces without importing Thunder explicitly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.