Skip to content

Make NumPy an optional dependency perhaps? #511

Open
@carterbox

Description

@carterbox

Would it be possible to make numpy an optional dependency for cuda.core? For example, if you just want to use cuda.core to query system device properties, installing a BLAS implementation is a bit heavy.

Activity

kkraus14

kkraus14 commented on Mar 13, 2025

@kkraus14
Collaborator

+1 it looks like our numpy usage outside of tests, benchmarks, and examples is only related to dtypes where we should be able to make it handle numpy dtypes optionally

leofang

leofang commented on Mar 13, 2025

@leofang
Member

Very unlikely. We use NumPy heavily in cuda-core (and nvmath-python and the upstream Numba):
https://github.com/search?q=repo%3ANVIDIA%2Fcuda-python+numpy+path%3Acuda_core%2Fcuda&type=code
Without assuming NumPy exists it is really challenging to write interoperable code. We'd end up reinventing a whole set of infra as done in mpi4py. In a modern workload NumPy always exists somewhere, so I don't get where this is coming from?

leofang

leofang commented on Mar 13, 2025

@leofang
Member

FWIW we don't even set a version constraint on NumPy as suggested by NEP 29/Spec 0, only that it exists in the user env:

dependencies = [
"numpy",
]
, so this is pretty relaxing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-responseFurther information is requestedtriageNeeds the team's attention

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kkraus14@leofang@carterbox

        Issue actions

          Make NumPy an optional dependency perhaps? · Issue #511 · NVIDIA/cuda-python