Skip to content

[cuda graphs] Integrate kernel annotations into inductor cudagraph trees - #179769

Closed
yushangdi wants to merge 8 commits into
gh/yushangdi/25/basefrom
gh/yushangdi/25/head
Closed

yushangdi wants to merge 8 commits into
gh/yushangdi/25/basefrom
gh/yushangdi/25/head

Conversation

@yushangdi

@yushangdi yushangdi commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

WIP: current progress: it works, but has bugs, the annotation is not accurate yet
Authored with Claude.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo

Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Apr 8, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/179769

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures, 2 Unrelated Failures

As of commit 2b68f16 with merge base a4a69be (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

yushangdi added a commit that referenced this pull request Apr 8, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: 655bb94
Pull Request resolved: #179769
@pytorch-bot

pytorch-bot Bot commented Apr 8, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@yushangdi
yushangdi marked this pull request as draft April 8, 2026 23:32
…udagraph trees"

Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo

[ghstack-poisoned]
yushangdi added a commit that referenced this pull request Apr 9, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: b41e2ef
Pull Request resolved: #179769
…udagraph trees"


Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.


**WIP: current progress: it works, but has bugs, the annotation is not accurate yet**
Authored with Claude.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo

[ghstack-poisoned]
yushangdi added a commit that referenced this pull request Apr 9, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: 337958e
Pull Request resolved: #179769
…udagraph trees"


Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.


**WIP: current progress: it works, but has bugs, the annotation is not accurate yet**
Authored with Claude.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo

[ghstack-poisoned]
yushangdi added a commit that referenced this pull request Apr 9, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: b9228d7
Pull Request resolved: #179769
…udagraph trees"


Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.


**WIP: current progress: it works, but has bugs, the annotation is not accurate yet**
Authored with Claude.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo

[ghstack-poisoned]
yushangdi added a commit that referenced this pull request Apr 9, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: 2432f63
Pull Request resolved: #179769
…udagraph trees"


Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.


**WIP: current progress: it works, but has bugs, the annotation is not accurate yet**
Authored with Claude.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo

[ghstack-poisoned]
yushangdi added a commit that referenced this pull request Apr 9, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: d9e5db1
Pull Request resolved: #179769
…udagraph trees"


Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.


**WIP: current progress: it works, but has bugs, the annotation is not accurate yet**
Authored with Claude.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo

[ghstack-poisoned]
yushangdi added a commit that referenced this pull request Apr 10, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: f4feccd
Pull Request resolved: #179769
…udagraph trees"


Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.


**WIP: current progress: it works, but has bugs, the annotation is not accurate yet**
Authored with Claude.

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo

[ghstack-poisoned]
yushangdi added a commit that referenced this pull request Apr 10, 2026
Add config.triton.cudagraph_kernel_annotations (default False) and wire
up clear/resolve/remap calls in CUDAGraphNode._record() so that
mark_kernels() scopes firing during cudagraph capture are automatically
processed.

Authored with Claude.

ghstack-source-id: e377c4b
Pull Request resolved: #179769
@alexmsettle

Copy link
Copy Markdown
Contributor

hi @yushangdi - I have been working on something similar over the last few weeks.

I built off of your mark_kernels() implementation and added fully qualified layer name annotations to the inductor / cudagraph trees workflow ,so each kernel can be uniquely identified with a nn.Modules style layer name.

Also I noticed that @ngimel might be working on something related too.

I was getting ready to file a PR, but wanted to check in with you first.

Thanks!
-Alex
llama_3-1_example

@yushangdi

Copy link
Copy Markdown
Contributor Author

hi @yushangdi - I have been working on something similar over the last few weeks.

I built off of your mark_kernels() implementation and added fully qualified layer name annotations to the inductor / cudagraph trees workflow ,so each kernel can be uniquely identified with a nn.Modules style layer name.

Also I noticed that @ngimel might be working on something related too.

I was getting ready to file a PR, but wanted to check in with you first.

Thanks! -Alex llama_3-1_example

@alexmsettle I'm not following up on this PR at the moment. Feel free to file a PR!

@alexmsettle

Copy link
Copy Markdown
Contributor

Thanks @yushangdi !

I'll get started on the PR.

@alexmsettle

Copy link
Copy Markdown
Contributor

Hi @yushangdi - FYI I filed this Issue 186026.
I'm waiting to get some feedback on it before opening a PR.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions Bot added the Stale label Aug 3, 2026
@github-actions github-actions Bot closed this Sep 2, 2026
@github-actions
github-actions Bot deleted the gh/yushangdi/25/head branch October 3, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants