Skip to content

DLPack-related tests & examples with host-accessible memory are sensitive to NumPy versions #1168

@leofang

Description

@leofang

Minimal reproducer I just built for nvbugs 5591656:

import numpy as np
from cuda.core.experimental import Device, LegacyPinnedMemoryResource

dev = Device()
dev.set_current()
mr = LegacyPinnedMemoryResource()
buf = mr.allocate(40)
arr = np.from_dlpack(buf).view(np.float32)
arr[:] = 1

This causes ValueError: assignment destination is read-only until NumPy v2.2.5 as Rui from the QA team correctly pointed out.

Previously, we've known NumPy's DLPack support is not as stable as we hoped. Some tests required v2.1.0+ to run. This seems to be a new situation that we did not capture so far, because we let most, if not all, of the test dependencies float.

We should re-evaluate how aggressively we'd like to teach users to use NumPy for host interoperability, and examine all the test-skip conditions.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    cuda.coreEverything related to the cuda.core moduledocumentationImprovements or additions to documentationexampleImprovements or additions to code examplestestImprovements or additions to teststriageNeeds the team's attention

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions