Skip to content

[PyTorch] Investigate early runtime error. #56

@Jorghi12

Description

@Jorghi12

Currently, when using PyTorch with ROCm, you'll notice the following error:

import torch
torch.Tensor(1).cuda()

RuntimeError: torch.cuda.sparse.FloatTensor is not enabled.

However, the error disappears by executing torch.cuda._lazy_init() very early.

import torch
torch.cuda._lazy_init()
torch.Tensor(1).cuda()
tensor([ 0], device='cuda:0')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions