Lightning-AI / Lightning-AI/lightning-thunder

`CUDAGraphExecutor` - limited to static graphs only

Open
#433 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

## 🐛 Bug

With https://github.com/Lightning-AI/lightning-thunder/pull/430 merged we enable the usage of `thunder.jit(..., use_cudagraphs=True)`. This makes sure that the forward callable is wrapped into `thunder.cudagraphs.CUDAGraphExecutor`. This executor, however, assumes a static structure of the code. We might consider `torch.cuda.make_graphed_callables` as a safer option.

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 at thunder.cudagraphs.CUDAGraphExecutor, which wraps the forward callable when thunder.jit(..., use_cudagraphs=True); reproduce a case with a non-static graph and inspect how the executor handles it. Compare that behavior with torch.cuda.make_graphed_callables and define tests showing that dynamic structures are handled safely.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.