Skip to content

[Python][GPU] Numba interop tests broken by Numba API changes #48265

Open

Description

@pitrou

Describe the bug, including details regarding any error messages, version, and platform.

On #48259 I got the following failure:

___________________ test_numba_memalloc[float32-numba.cuda] ____________________

c = 1, dtype = dtype('float32')

    @pytest.mark.parametrize("c", range(len(context_choice_ids)),
                             ids=context_choice_ids)
    @pytest.mark.parametrize("dtype", dtypes, ids=dtypes)
    def test_numba_memalloc(c, dtype):
        ctx, nb_ctx = context_choices[c]
        dtype = np.dtype(dtype)
        # Allocate memory using numba context
        # Warning: this will not be reflected in pyarrow context manager
        # (e.g bytes_allocated does not change)
        size = 10
        mem = nb_ctx.memalloc(size * dtype.itemsize)
        darr = DeviceNDArray((size,), (dtype.itemsize,), dtype, gpu_data=mem)
        darr[:5] = 99
        darr[5:] = 88
        np.testing.assert_equal(darr.copy_to_host()[:5], 99)
        np.testing.assert_equal(darr.copy_to_host()[5:], 88)
    
        # wrap numba allocated memory with CudaBuffer
>       cbuf = cuda.CudaBuffer.from_numba(mem)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

arrow-dev/lib/python3.12/site-packages/pyarrow/tests/test_cuda_numba_interop.py:178: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pyarrow/_cuda.pyx:453: in pyarrow._cuda.CudaBuffer.from_numba
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <numba.cuda.cudadrv.driver.OwnedPointer object at 0x7f8ef0de85b0>
fname = 'context'

    def __getattr__(self, fname):
        """Proxy MemoryPointer methods"""
>       return getattr(self._view, fname)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: 'AutoFreePointer' object has no attribute 'context'

arrow-dev/lib/python3.12/site-packages/numba_cuda/numba/cuda/cudadrv/driver.py:2022: AttributeError

Component(s)

Python, GPU

Activity

  1. pitrou commented on Nov 26, 2025

    @pitrou
    MemberAuthor
  2. gmarkall commented on Nov 26, 2025

    @gmarkall
    Contributor

    I'm looking into all the Numba-CUDA-related issues now.

  3. gmarkall commented on Nov 28, 2025

    @gmarkall
    Contributor

    This API breakage is fixed in Numba-CUDA in the 0.21.2 release: https://github.com/NVIDIA/numba-cuda/releases/tag/v0.21.2

  4. pitrou commented on Jun 9, 2026

    @pitrou
    MemberAuthor

    @gmarkall Our CUDA Numba interop tests are still failing, do you plan to look into them?
    https://lists.apache.org/thread/9ttooqp2k071d3g74z0dbbkwy9n2m3f0

  5. thisisnic commented on Nov 30, 2026

    @thisisnic
    Member

    @pitrou - can this be closed now given the below or is there still stuff left to do before we can?

    🤖 : The Numba interop tests are passing again since #50923 was merged on 2026-11-25. The CUDA jobs have been green on main since then, and all 50 tests in test_cuda_numba_interop.py passed in today's nightly with numba-cuda 0.30.4 (job). The numba-cuda deprecation is tracked in #51204.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions