Description
🚀 The feature, motivation and pitch
We're encouraging people to use fullgraph=True to better identify graph breaks. At the same time, we're empowering users to use escape hatches like torch._dynamo.disable. These two work against each other, and the best workaround I can think of is to ask users to stop fullgraping and to use some other tool to inspect their graph breaks e.g. tlparse, graph count, TORCH_LOGS.
We should consider special casing torch._dynamo.disable so that it does not raise errors with fullgraph=True. This could be controlled by a flag, but I think it can be the default enablement experience.
UPDATE: New proposal, what if we had another UX for specifying fullgraph=True. One option could be a context manager:
@torch.compile
def fn():
with torch._dynamo.error_on_graph_breaks():
torch._dynamo.graph_break() # loud error
torch._dynamo.graph_break() # silent error
Alternatives
No response
Additional context
No response
cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames