Skip to content

CUDA torch.randn silently fails when the output has more than 2^31-1 elements #17898

@colesbury

Description

@colesbury

🐛 Bug

torch.randn silently fails when the output has more than 2^31-1 elements. The output remains uninitialized (often all zeros).

To Reproduce

Note: you need >8 GB on your GPU to run this example

x = torch.randn(65536, 32768, device='cuda')
print(x)

Environment

PyTorch master 066d158 (Mar 11, 2019)
CUDA 9.2.88

Metadata

Metadata

Assignees

No one assigned

    Labels

    low priorityWe're unlikely to get around to doing this in the near futuremodule: 64-bitProblems related to incorrectly using 32-bit integers when 64-bit is needed (e.g., 8G tensors)module: cudaRelated to torch.cuda, and CUDA support in generalmodule: randomRelated to random number generation in PyTorch (rng generator)triagedThis 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