Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better specify torch.compile behaviour on nested function/module #2858

Open
bhack opened this issue Feb 2, 2024 · 10 comments
Open

Better specify torch.compile behaviour on nested function/module #2858

bhack opened this issue Feb 2, 2024 · 10 comments

Comments

@bhack
Copy link

bhack commented Feb 2, 2024

馃摎 The doc issue

Can we better specify the behavior and eventually the best practices when decorating a function or compiling a module and the effect on the nested modules and nested function call?

https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html

Suggest a potential alternative/fix

No response

cc @sekyondaMeta @svekars @kit1980 @williamwen42 @msaroufim @ezyang @bdhirsh @anijain2305 @zou3519 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng

@bhack bhack changed the title Better specify the torch.compile behaviour on nested function/module Better specify torch.compile behaviour on nested function/module Feb 2, 2024
@eellison eellison added the triaged Issues has been triaged label Feb 2, 2024
@svekars svekars transferred this issue from pytorch/pytorch May 7, 2024
@svekars svekars added the torch.compile Torch compile and other relevant tutorials label May 15, 2024
@anijain2305 anijain2305 removed their assignment Jun 3, 2024
@sekyondaMeta sekyondaMeta added medium docathon-h1-2024 tiraged and removed triaged Issues has been triaged torch.compile Torch compile and other relevant tutorials labels Jun 4, 2024
@awayzjj
Copy link

awayzjj commented Jun 5, 2024

/assigntome

@ignaciobartol
Copy link

@awayzjj Are you still working on this issue? If not I would like to help. Thanks!

cc @sekyondaMeta

@awayzjj awayzjj removed their assignment Jun 11, 2024
@awayzjj
Copy link

awayzjj commented Jun 11, 2024

I removed the assighment! You can take it! @ignaciobartol

@ignaciobartol
Copy link

I assigned myself to another issue yesterday and still I'm working on it, I apologize for the confusion if you still wanted to work on it. I will check back later today after submitting a PR to see if this one is still available. But thanks!! @awayzjj

@bhack
Copy link
Author

bhack commented Jun 11, 2024

/cc @ezyang Just in the case we could use this to improve the documentation about the best practices on reporting torch.compiler failures on nested function/modules.

@ignaciobartol
Copy link

/assigntome

@ezyang
Copy link
Contributor

ezyang commented Jun 12, 2024

Not sure what you're looking for here. If you torch.compile a function, we will try to recursively inline/compile every function call inside it. If there's a graph break, we will try again for inner frames. There are some other functions to disable this process if needed.

@bhack
Copy link
Author

bhack commented Jun 12, 2024

Yes I think currently this is not explicitly specified in the doc right?
Other then this if there is some general hint to help to reporting bugs.. e.g. try to compile leaf defin the graph before reporting a ticket in the recursive case or something similar it could help in that documentation section (then we could link to a section of your WIP doc when ready).

@ezyang
Copy link
Contributor

ezyang commented Jun 12, 2024

OK, send a doc patch for this @ignaciobartol, thanks

@ignaciobartol
Copy link

@ezyang Yes, sorry I got caught up with other work yesterday. I will work on it later today and submit a PR

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

No branches or pull requests

8 participants