KEMBAR78
Add functional collective all_to_all_single and support it in Inductor by ezyang · Pull Request #110195 · pytorch/pytorch · GitHub
Skip to content

Conversation

ezyang
Copy link
Contributor

@ezyang ezyang commented Sep 28, 2023

Copy of #106655 from yf225
rebased on top of item() support changes

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 28, 2023

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit bd0c738 with merge base cf1b494 (image):

UNSTABLE - The following jobs failed but were likely due to flakiness present on trunk and has been marked as unstable:

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

@ezyang
Copy link
Contributor Author

ezyang commented Sep 28, 2023

cc @yf225

@ezyang
Copy link
Contributor Author

ezyang commented Sep 28, 2023

Hmm I think I didn't do the merge update completely correctly

… in Inductor"

Copy of #106655 from yf225
rebased on top of item() support changes

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler

[ghstack-poisoned]
compiled_fn = torch.compile(example, fullgraph=True, dynamic=True)
code = run_and_get_triton_code(compiled_fn, *inputs, **trs)
FileCheck() \
.check("fun_col_impl._all_to_all_single") \
Copy link
Contributor

Choose a reason for hiding this comment

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

should we assert that generated code has the unbacked symints at the right places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was a pain manually updating the FileChecks when I wobbled the code lol. Can we come up with a less brittle way to test this

Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps a regex matching the prefix i but not the actual variable number? I can add it after this PR

… in Inductor"

Copy of #106655 from yf225
rebased on top of item() support changes

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Sep 28, 2023
Copy of #106655 from yf225
rebased on top of item() support changes

ghstack-source-id: 3ae9f68
Pull Request resolved: #110195

return [mk_out_tensor(t) for t in inputs]

# TODO: think, this isn't actually dynamic?!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was surprised here

return set()

def codegen_unbacked_symbol_defs(self, wrapper):
symbols_to_define = self.get_unbacked_symbol_defs()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, if it wasn't for the logging here, I would advise rewriting this as set intersection / difference ops.

@ezyang
Copy link
Contributor Author

ezyang commented Oct 5, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 5, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

… in Inductor"

Copy of #106655 from yf225
rebased on top of item() support changes

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: New commits were pushed while merging. Please rerun the merge command.

Details for Dev Infra team Raised by workflow job

… in Inductor"

Copy of #106655 from yf225
rebased on top of item() support changes

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler

[ghstack-poisoned]
ezyang added a commit that referenced this pull request Oct 5, 2023
Copy of #106655 from yf225
rebased on top of item() support changes

ghstack-source-id: e02044d
Pull Request resolved: #110195
@ezyang
Copy link
Contributor Author

ezyang commented Oct 5, 2023

@yf225 because the kernel is no longer "dynamic", it can be implemented exactly symmetrically to all the other collectives. I've updated the implementation accordingly.

@ezyang
Copy link
Contributor Author

ezyang commented Oct 5, 2023

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor release notes: fx release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants