Skip to content

[user-events] Add inductor event types#165390

Closed
mlazos wants to merge 10 commits intogh/mlazos/41/basefrom
gh/mlazos/41/head
Closed

[user-events] Add inductor event types#165390
mlazos wants to merge 10 commits intogh/mlazos/41/basefrom
gh/mlazos/41/head

Conversation

@mlazos
Copy link
Contributor

@mlazos mlazos commented Oct 14, 2025

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 14, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure, 2 Unrelated Failures

As of commit c0ad8c3 with merge base 63776ec (image):

NEW FAILURE - The following job has failed:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

@github-actions
Copy link
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 Dec 14, 2025
@github-actions github-actions bot closed this Jan 13, 2026
@mlazos mlazos reopened this Jan 13, 2026
mlazos added a commit that referenced this pull request Jan 20, 2026
ghstack-source-id: ce34aa6
Pull Request resolved: #165390
mlazos added a commit that referenced this pull request Jan 21, 2026
ghstack-source-id: ce34aa6
Pull Request resolved: #165390
@mlazos mlazos added ciflow/trunk Trigger trunk jobs on your pull request and removed Stale labels Jan 21, 2026
mlazos added a commit that referenced this pull request Jan 21, 2026
ghstack-source-id: ce34aa6
Pull Request resolved: #165390
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo chenyang78

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Jan 21, 2026
ghstack-source-id: ce34aa6
Pull Request resolved: #165390
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo chenyang78

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Jan 22, 2026
ghstack-source-id: a7a6c7d
Pull Request resolved: #165390
suncapitalllc007-star pushed a commit to suncapitalllc007-star/pytorch that referenced this pull request Jan 25, 2026
ghstack-source-id: a7a6c7d
Pull Request resolved: pytorch/pytorch#165390
mlazos added a commit that referenced this pull request Feb 3, 2026
ghstack-source-id: a7a6c7d
Pull Request resolved: #165390
mlazos added a commit that referenced this pull request Feb 3, 2026
ghstack-source-id: a7a6c7d
Pull Request resolved: #165390
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy kadeng muchulee8 amjames chauhang aakhundov coconutruben jataylo chenyang78

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Feb 18, 2026
ghstack-source-id: 0790e88
Pull Request resolved: #165390
mlazos added a commit that referenced this pull request Feb 18, 2026
ghstack-source-id: 0790e88
Pull Request resolved: #165390
mlazos added a commit that referenced this pull request Feb 18, 2026
ghstack-source-id: 0790e88
Pull Request resolved: #165390
This PR adds support for Symbolic events in the TorchInductor scheduler. In short, we create an EventFactory which provides event indices which monotonically increase as compile proceeds and enables reuse of events that are no longer used. It also adds codegen support for events. 




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

[ghstack-poisoned]
Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lil hard to review without tests but i understand we're breaking it up..

"""Initialize a event factory."""
self.symbolic_event_idx: itertools.count = itertools.count(start=1)
self.materialized_event_idx: itertools.count = itertools.count(start=1)
self.available_materialized_events: OrderedSet[str] = OrderedSet()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to not just make these the actual event objects, and not strings ?

code.writeline(f"{event} = torch.cuda.Event()")
return event

def deposit_materialized_event(self, event: str) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to give event a different type than string, with a default repr?

mlazos added a commit that referenced this pull request Mar 2, 2026
ghstack-source-id: 080565b
Pull Request resolved: #165390
This PR adds support for Symbolic events in the TorchInductor scheduler. In short, we create an EventFactory which provides event indices which monotonically increase as compile proceeds and enables reuse of events that are no longer used. It also adds codegen support for events. 




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

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Mar 3, 2026
ghstack-source-id: 8c34851
Pull Request resolved: #165390
mlazos added 3 commits March 3, 2026 11:55
This PR adds support for Symbolic events in the TorchInductor scheduler. In short, we create an EventFactory which provides event indices which monotonically increase as compile proceeds and enables reuse of events that are no longer used. It also adds codegen support for events. 




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

[ghstack-poisoned]
This PR adds support for Symbolic events in the TorchInductor scheduler. In short, we create an EventFactory which provides event indices which monotonically increase as compile proceeds and enables reuse of events that are no longer used. It also adds codegen support for events. 




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

[ghstack-poisoned]
This PR adds support for Symbolic events in the TorchInductor scheduler. In short, we create an EventFactory which provides event indices which monotonically increase as compile proceeds and enables reuse of events that are no longer used. It also adds codegen support for events. 




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

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #165391

This PR adds support for Symbolic events in the TorchInductor scheduler. In short, we create an EventFactory which provides event indices which monotonically increase as compile proceeds and enables reuse of events that are no longer used. It also adds codegen support for events. 




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

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #165391

2 similar comments
@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #165391

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #165391

pytorchmergebot pushed a commit that referenced this pull request Mar 5, 2026
This PR adds utility functions for managing streams and a stream pool.

Pull Request resolved: #165504
Approved by: https://github.com/eellison
ghstack dependencies: #165390
pytorchmergebot pushed a commit that referenced this pull request Mar 5, 2026
This PR implements stream codegen to the SubgraphWrapper Codegen. It supports codegen for enter/exiting stream contexts and calling record_stream on returned tensors.

Pull Request resolved: #165391
Approved by: https://github.com/eellison
ghstack dependencies: #165390, #165504
Vighaneshs pushed a commit to Vighaneshs/pytorch that referenced this pull request Mar 5, 2026
This PR adds support for Symbolic events in the TorchInductor scheduler. In short, we create an EventFactory which provides event indices which monotonically increase as compile proceeds and enables reuse of events that are no longer used. It also adds codegen support for events.

Pull Request resolved: pytorch#165390
Approved by: https://github.com/eellison
Vighaneshs pushed a commit to Vighaneshs/pytorch that referenced this pull request Mar 5, 2026
This PR adds utility functions for managing streams and a stream pool.

Pull Request resolved: pytorch#165504
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#165390
Vighaneshs pushed a commit to Vighaneshs/pytorch that referenced this pull request Mar 5, 2026
…h#165391)

This PR implements stream codegen to the SubgraphWrapper Codegen. It supports codegen for enter/exiting stream contexts and calling record_stream on returned tensors.

Pull Request resolved: pytorch#165391
Approved by: https://github.com/eellison
ghstack dependencies: pytorch#165390, pytorch#165504
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
ghstack-source-id: beed124
Pull Request resolved: pytorch/pytorch#165390
sandy-gags pushed a commit to sandy-gags/pytorch that referenced this pull request Mar 12, 2026
ghstack-source-id: 0790e88
Pull Request resolved: pytorch/pytorch#165390
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.

3 participants