-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
actionabledynamo-must-fixThese bugs affect TorchDynamo reliability.These bugs affect TorchDynamo reliability.dynamo-triage-june2024module: dynamooncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🐛 Describe the bug
import torch
torch.set_default_device('cuda')
@torch.compile(fullgraph=True)
def f(x):
x = x.cos().cos()
print(x)
return x.cos()
def g(x):
return f(x)
torch.compiler.disable(g)(torch.randn(5))
This still compiles (and throws the error).
Also, the docstring also claims it can be used as a context manager, but this error is thrown when you try to use it that way.
RuntimeError: torch._dynamo.optimize(...) is used with a context manager. Please refer to https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html to use torch._dynamo.optimize(...) as an annotation/decorator.
cc: @anijain2305
Versions
N/A
cc @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames @msaroufim @bdhirsh @anijain2305
lukasschmit, TimDarcet, tyler-rt and shivam15s
Metadata
Metadata
Assignees
Labels
actionabledynamo-must-fixThese bugs affect TorchDynamo reliability.These bugs affect TorchDynamo reliability.dynamo-triage-june2024module: dynamooncall: pt2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module