Skip to content

[user-streams] Fix stream graph output semantics - #164819

Closed
mlazos wants to merge 30 commits into
gh/mlazos/36/basefrom
gh/mlazos/36/head
Closed

mlazos wants to merge 30 commits into
gh/mlazos/36/basefrom
gh/mlazos/36/head

Conversation

@mlazos

@mlazos mlazos commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor

Preivously, we would stash a single stream value we constructed at trace time in a global and return the same value from repeated calls to the graph.

With this PR, we construct the stream value in advance, reference the constructed value in the graph via the lookup table, and if that value is returned as an output, read the value from the lookup table and return it (in bytecode, not as a graph output, since we don't support arbitrary stream outputs).

Stack from ghstack (oldest at bottom):

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @Lucaskabela

@pytorch-bot

pytorch-bot Bot commented Oct 7, 2025 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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:

✅ No Failures

As of commit b1036e1 with merge base 0674e0a (image):
💚 Looks good so far! There are no failures yet. 💚

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

mlazos added a commit that referenced this pull request Oct 7, 2025
ghstack-source-id: a176120
Pull Request resolved: #164819
mlazos added a commit that referenced this pull request Oct 8, 2025
ghstack-source-id: a176120
Pull Request resolved: #164819
mlazos added a commit that referenced this pull request Oct 8, 2025
ghstack-source-id: a176120
Pull Request resolved: #164819
mlazos added a commit that referenced this pull request Oct 8, 2025
ghstack-source-id: a176120
Pull Request resolved: #164819
mlazos added a commit that referenced this pull request Oct 9, 2025
ghstack-source-id: 0dfcb85
Pull Request resolved: #164819
mlazos added a commit that referenced this pull request Oct 9, 2025
ghstack-source-id: 6514b42
Pull Request resolved: #164819
mlazos added a commit that referenced this pull request Oct 9, 2025
ghstack-source-id: 6514b42
Pull Request resolved: #164819
mlazos added a commit that referenced this pull request Oct 9, 2025
ghstack-source-id: 6514b42
Pull Request resolved: #164819
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166471

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166472

mlazos added a commit that referenced this pull request Oct 31, 2025
ghstack-source-id: a6d2fb0
Pull Request resolved: #164819
[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166472

BoyuanFeng pushed a commit that referenced this pull request Oct 31, 2025
Preivously, we would stash a single stream value we constructed at trace time in a global and return the same value from repeated calls to the graph.

With this PR, we construct the stream value in advance, reference the constructed value in the graph via the lookup table, and if that value is returned as an output, read the value from the lookup table and return it (in bytecode, not as a graph output, since we don't support arbitrary stream outputs).

Pull Request resolved: #164819
Approved by: https://github.com/anijain2305
ghstack dependencies: #164304, #164522
BoyuanFeng pushed a commit that referenced this pull request Oct 31, 2025
[ghstack-poisoned]
[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166471

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166472

3 similar comments
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166472

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166472

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #166472

pytorchmergebot pushed a commit that referenced this pull request Nov 2, 2025
meta-codesync Bot pushed a commit to pytorch/benchmark that referenced this pull request Nov 4, 2025
Summary:
Preivously, we would stash a single stream value we constructed at trace time in a global and return the same value from repeated calls to the graph.

With this PR, we construct the stream value in advance, reference the constructed value in the graph via the lookup table, and if that value is returned as an output, read the value from the lookup table and return it (in bytecode, not as a graph output, since we don't support arbitrary stream outputs).

X-link: pytorch/pytorch#164819
Approved by: https://github.com/anijain2305

Reviewed By: donigian

Differential Revision: D86056493

fbshipit-source-id: c65664e5cd43d00ce503e70a9c9eab2a58cbfaa9
etaf pushed a commit to etaf/pytorch-inductor-xpu that referenced this pull request Nov 4, 2025
Preivously, we would stash a single stream value we constructed at trace time in a global and return the same value from repeated calls to the graph.

With this PR, we construct the stream value in advance, reference the constructed value in the graph via the lookup table, and if that value is returned as an output, read the value from the lookup table and return it (in bytecode, not as a graph output, since we don't support arbitrary stream outputs).

Pull Request resolved: pytorch#164819
Approved by: https://github.com/anijain2305
ghstack dependencies: pytorch#164304, pytorch#164522
etaf pushed a commit to etaf/pytorch-inductor-xpu that referenced this pull request Nov 4, 2025
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.

4 participants