8000 [Inductor] track block shape of intermediary variables · Issue #149905 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Inductor] track block shape of intermediary variables #149905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
eellison opened this issue Mar 25, 2025 · 2 comments
Open

[Inductor] track block shape of intermediary variables #149905

eellison opened this issue Mar 25, 2025 · 2 comments
Assignees
Labels
module: inductor oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@eellison
Copy link
Contributor
eellison commented Mar 25, 2025

🚀 The feature, motivation and pitch

During codegen each we track the dtype and value range of each intermediary variable we emit in trition. See CSEVariable.

Dtype was recently added in #136778 by @arui-meta and subsequently iterated on in PRs like #141495 and #140057.

While dtypes are a bit finicky to get right, shapes are very easy to track in triton. More or less each operator broadcasts its inputs, reductions remove reduction dims, and then there are a few remaining ops.

@kundaMwiza recently had an use case of shapes in a pr Ideally the shape of the input would be an attribute of a TritonCSEVariable via shape propagation.

Similarly, I ran into a bug in prologue fusion where I now need to add possibly extraneous broadcasts because in particular cases of loading a constant index we return a different shape.

I'm sure other future changes will run into needing shapes, and after adding we'll discover other places in the codebase we can simplify.

Alternatives

No response

Additional context

No response

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

@eellison
Copy link
Contributor Author

cc @isuruf @rec @amjames in case anyones interested..

@jansel jansel added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Mar 29, 2025
@isuruf isuruf self-assigned this Apr 14, 2025
@isuruf
Copy link
Collaborator
isuruf commented Apr 25, 2025

Started #152198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: inductor oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

3 participants
0