KEMBAR78
BC-breaking change to symint range constraints from 2.7 -> 2.8 · Issue #157921 · pytorch/pytorch · GitHub
Skip to content

BC-breaking change to symint range constraints from 2.7 -> 2.8 #157921

@zou3519

Description

@zou3519
import torch

embed = torch.randn(2, 8192)
x = torch.zeros(8192)

torch._dynamo.mark_dynamic(x, 0)

@torch.compile(backend="aot_eager", fullgraph=True)
def f(embedding_indices, x):
    added_tokens_mask = torch.where(x > 10000, 1, 0)
    ei = torch.narrow(embedding_indices, 1, 0, x.size(0))
    return ei.clone()

f(embed, x)

This errors in 2.8 but passes in 2.7..

cc @chauhang @penguinwu @ezyang @bobrenjc93

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions