8000 A more flexible API for torch.compile fullgraph=True · Issue #144908 · pytorch/pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
A more flexible API for torch.compile fullgraph=True #144908
Open
@xmfan

Description

@xmfan

🚀 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

Metadata

Metadata

Assignees

Labels

module: compile uxUX issues related to torch.compilemodule: dynamooncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0