Better specify `torch.compile behaviour` on nested function/module
📚 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
/assigntome
@awayzjj Are you still working on this issue? If not I would like to help. Thanks!
cc @sekyondaMeta
I removed the assighment! You can take it! @ignaciobartol
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
/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.
/assigntome
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.
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).
OK, send a doc patch for this @ignaciobartol, thanks
@ezyang Yes, sorry I got caught up with other work yesterday. I will work on it later today and submit a PR