support methods for torch.compiler.allow_in_graph #125244
Labels
module: dynamo
oncall: pt2
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃殌 The feature, motivation and pitch
this is a bug/feature report.
When using
torch.dynamo.allow_in_graph
on a method, it's not respected during compile.This correctly creates a node for the
add_fn
This instead shows a node, for the built in add
+
This is most likely due to the
id
being used byallow_in_graph
, however, this changes in python after the instance is created.The ideal solution would be if this was actually supported, alternatively I think some warning/error when
allow_on_graph
is used on a method could make sense.Alternatives
torch.compiler.disable
works is being respected, but it creates graph breaks which have been causing downstream issues for our custom backend so theallow_in_graph
behaviour is preferred.Additional context
No response
cc @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng
The text was updated successfully, but these errors were encountered: