Skip to content

Question about expectation on cross-hardware #132

@fcharras

Description

@fcharras

From the dlpack standard reference, should this snippet work ?

import torch
import numpy as np

x = torch.asarray([1,2,3], device="cuda")
np.from_dlpack(x)
np.asarray(x)

it currently fails with:

RuntimeError: Unsupported device in DLTensor.

the purpose excerpt says:

Designed for cross hardware: CPU, CUDA, OpenCL, Vulkan, Metal, VPI, ROCm, WebGPU, Hexagon

but also

Whle still considering the need for cross hardware support (e.g. the data field is opaque for platforms that does not support normal addressing).

So I'd like to clarify if the error in this snippet should be reported as a bug to the maintainers, or if it is expected that the dlpack data exchange can only work on a same device.

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