Lightning-AI / Lightning-AI/lightning-thunder
Support user-side CUDA graph capturing
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 121
- PR merge metrics
- No merged PRs in 30d
Description
## 🚀 Feature
Let users do their own cuda graph capturing for `thunder.jit(model)`.
### Motivation
While thunder has its own [`thunder.transforms.cudagraph.CUDAGraphTransform`](https://github.com/Lightning-AI/lightning-thunder/blob/7c2735c527bfa7e7b12dc0bdfeed44428bd3128b/thunder/transforms/cudagraph.py#L231-L237), some libraries such as SGLang has its own way of cuda graph capturing.
If I just use [`thunderfx`](https://github.com/Lightning-AI/lightning-thunder/blob/7c2735c527bfa7e7b12dc0bdfeed44428bd3128b/thunder/dynamo/compiler.py#L204) as a drop-in replacement of `torch.compile` in SGLang, then it fails unless I pass `--disable_cuda_graph` (which is one of SGLang debug options https://docs.sglang.ai/backend/server_arguments.html#debug-options).
### Pitch
### Alternatives
### Additional context
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 reading thunder/transforms/cudagraph.py around CUDAGraphTransform and thunder/dynamo/compiler.py around the thunderfx entry point. Reproduce the SGLang failure with thunderfx and its CUDA graph capture path, then determine the user-facing capture boundary and verify that user-managed capture works without requiring --disable_cuda_graph.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100