Skip to content

torch.zeros/ones RuntimeError when the number of elements approaches upper limit of int32 #2070

@CuiYifeng

Description

@CuiYifeng

Reproducer:

import torch
x = torch.ones(2**31 - 1, device=torch.device("xpu:0"), dtype=torch.int8)
// RuntimeError: Non-uniform work-groups are not supported by the target device

Overflow occurred in aten::ceil_div<int> for calculating the number of work groups.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions