Skip to content

Runtime assertion not generated in inductor for input unbacked symints #151879

@laithsakka

Description

@laithsakka
import torch
@torch.compile(fullgraph=True, dynamic=True, backend="inductor")
def func(a, b, c):
    torch._check(a.size()[0]==b.size()[0])
    return a * 10, c.item()


a = torch.rand(1,1)
b = torch.rand(2,2)
c = torch.tensor([2])

torch._dynamo.decorators.mark_unbacked(a, 0)
torch._dynamo.decorators.mark_unbacked(a, 1)
torch._dynamo.decorators.mark_unbacked(b, 0)
torch._dynamo.decorators.mark_unbacked(b, 1)
with fresh_inductor_cache():
    func(a, b, c) 

cc @chauhang @penguinwu @ezyang @bobrenjc93

Metadata

Metadata

Assignees

Labels

module: dynamic shapesoncall: 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