Skip to content

Move cuda.core Windows AOTI stub-lib generation into build_ext in setup.py#2033

Open
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
rwgk:cuda_core_stub-lib_generation_in_setup_py
Open

Move cuda.core Windows AOTI stub-lib generation into build_ext in setup.py#2033
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
rwgk:cuda_core_stub-lib_generation_in_setup_py

Conversation

@rwgk
Copy link
Copy Markdown
Contributor

@rwgk rwgk commented May 6, 2026

Background

cuda_core needs a Windows stub import library for _tensor_bridge so MSVC can link against PyTorch's AOTI symbols from torch_cpu.dll without making PyTorch itself a build-time dependency.

That stub library was previously generated in cuda_core/build_hooks.py. This worked in CI because the Windows workflows explicitly prepare the MSVC environment first, but it made local/source builds depend on a separate toolchain discovery path before setuptools had initialized its compiler machinery.

What This Changes

  • Move Windows aoti_shim.lib generation out of cuda_core/build_hooks.py and into cuda_core/setup.py.
  • Generate the stub import library during build_ext, after setuptools has created and initialized the compiler object it will actually use for the extension build.
  • Reuse the compiler's discovered lib.exe and append the generated import library only to cuda.core._tensor_bridge.
  • Remove the Windows-specific lib.exe subprocess path from the PEP 517 build backend so build_hooks.py goes back to focusing on extension preparation and cythonization.
  • Update the comments in aoti_shim.h and aoti_shim.def to document that the stub library is now produced from setup.py/build_ext.

Why

  • Reuses the same MSVC discovery path that setuptools already uses for the actual extension build instead of maintaining a second discovery/bootstrap path in the build backend.
  • Keeps local Windows source builds aligned with the way CI succeeds, without requiring developers or QA environments to launch builds from a Visual Studio developer prompt.
  • Reduces build backend complexity and keeps the Windows-specific link setup closer to the place where the compiler is already available.

Scope

  • Functional change is Windows-only.
  • The link adjustment is limited to cuda.core._tensor_bridge.
  • Linux build behavior remains unchanged.

Testing

  • Verified with the local Windows QA build that previously failed when the stub library was created from build_hooks.py.

Reuse setuptools' initialized MSVC compiler when linking _tensor_bridge so Windows source builds do not need separate toolchain discovery in build_hooks.py.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rwgk rwgk added this to the cuda.bindings next milestone May 6, 2026
@rwgk rwgk self-assigned this May 6, 2026
@rwgk rwgk added P0 High priority - Must do! cuda.bindings Everything related to the cuda.bindings module labels May 6, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented May 6, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label May 6, 2026
@rwgk
Copy link
Copy Markdown
Contributor Author

rwgk commented May 6, 2026

/ok to test

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

@rwgk
Copy link
Copy Markdown
Contributor Author

rwgk commented May 6, 2026

Local testing with pytorch installed:

pip install ml_dtypes
pip install "torch==2.9.1" --extra-index-url https://download.pytorch.org/whl/cu130
(TestVenv) PS C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core> pip list
Package              Version                  Editable project location
-------------------- ------------------------ ------------------------------------------------------------
cffi                 2.0.0
cloudpickle          3.1.2
colorama             0.4.6
contourpy            1.3.3
cuda-bindings        13.2.1.dev174+g38c032f86 C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_bindings
cuda-core            0.7.1.dev95+g0d0ba4c1b   C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core
cuda-pathfinder      1.5.5.dev32+g38c032f86   C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_pathfinder
cycler               0.12.1
Cython               3.2.4
filelock             3.29.0
fonttools            4.62.1
fsspec               2026.4.0
iniconfig            2.3.0
Jinja2               3.1.6
kiwisolver           1.5.0
MarkupSafe           3.0.3
matplotlib           3.10.9
ml_dtypes            0.5.4
mpmath               1.3.0
networkx             3.6.1
numpy                2.4.4
packaging            26.2
pillow               12.2.0
pip                  26.1.1
pluggy               1.6.0
psutil               7.2.2
py-cpuinfo           9.0.0
pycparser            3.0
pyglet               2.1.14
Pygments             2.20.0
pyparsing            3.3.2
pytest               9.0.3
pytest-benchmark     5.2.3
pytest-mock          3.15.1
pytest-randomly      4.1.0
pytest-repeat        0.9.4
pytest-rerunfailures 16.1
python-dateutil      2.9.0.post0
setuptools           82.0.1
six                  1.17.0
sympy                1.14.0
torch                2.9.1+cu130
typing_extensions    4.15.0
(TestVenv) PS C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core> pytest -rxXs -v --durations=0 tests/test_utils.py tests/example_tests/
========================================================================= test session starts =========================================================================
platform win32 -- Python 3.13.13, pytest-9.0.3, pluggy-1.6.0 -- C:\Users\rgrossekunst\wrk\forked\cuda-python\TestVenv\Scripts\python.exe
cachedir: .pytest_cache
benchmark: 5.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=3280579104
rootdir: C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core
configfile: pytest.ini
plugins: benchmark-5.2.3, mock-3.15.1, randomly-4.1.0, repeat-0.9.4, rerunfailures-16.1
collected 222 items

tests/example_tests/test_basic_examples.py::test_example[jit_lto_fractal.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\...) [  0%]
tests/example_tests/test_basic_examples.py::test_example[show_device_properties.py] PASSED                                                                       [  0%]
tests/example_tests/test_basic_examples.py::test_example[gl_interop_plasma.py] SKIPPED (Skipping gl_interop_plasma.py due to unmet system requirement)           [  1%]
tests/example_tests/test_basic_examples.py::test_example[thread_block_cluster.py] SKIPPED (Skipping thread_block_cluster.py due to unmet system requirement)     [  1%]
tests/example_tests/test_basic_examples.py::test_example[strided_memory_view_gpu.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_cor...) [  2%]
tests/example_tests/test_basic_examples.py::test_example[tma_tensor_map.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\e...) [  2%]
tests/example_tests/test_basic_examples.py::test_example[cuda_graphs.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\exam...) [  3%]
tests/example_tests/test_basic_examples.py::test_example[memory_pool_resources.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\...) [  3%]
tests/example_tests/test_basic_examples.py::test_example[strided_memory_view_cpu.py] SKIPPED (Skipping strided_memory_view_cpu.py due to unmet system requir...) [  4%]
tests/example_tests/test_basic_examples.py::test_example[strided_memory_view_constructors.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python...) [  4%]
tests/example_tests/test_basic_examples.py::test_example[pytorch_example.py] SKIPPED (Skipping pytorch_example.py due to unmet system requirement)               [  4%]
tests/example_tests/test_basic_examples.py::test_example[graph_update.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\exa...) [  5%]
tests/example_tests/test_basic_examples.py::test_example[saxpy.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_te...) [  5%]
tests/example_tests/test_basic_examples.py::test_example[simple_multi_gpu_example.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_co...) [  6%]
tests/example_tests/test_basic_examples.py::test_example[memory_ops.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\examp...) [  6%]
tests/example_tests/test_basic_examples.py::test_example[vector_add.py] SKIPPED (Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\examp...) [  7%]
tests/test_utils.py::TestViewCudaArrayInterfaceGPU::test_cuda_array_interface_gpu[torch-nd] SKIPPED (CuPy is not installed)                                      [  7%]
tests/test_utils.py::TestViewCudaArrayInterfaceGPU::test_cuda_array_interface_gpu[torch-1d] SKIPPED (CuPy is not installed)                                      [  8%]
tests/test_utils.py::TestViewCudaArrayInterfaceGPU::test_cuda_array_interface_gpu[torch-sliced] SKIPPED (CuPy is not installed)                                  [  8%]
tests/test_utils.py::TestViewCudaArrayInterfaceGPU::test_cuda_array_interface_gpu[torch-non-contiguous] SKIPPED (CuPy is not installed)                          [  9%]
tests/test_utils.py::TestViewCudaArrayInterfaceGPU::test_cuda_array_interface_gpu[torch-empty] SKIPPED (CuPy is not installed)                                   [  9%]
tests/test_utils.py::TestViewCudaArrayInterfaceGPU::test_cuda_array_interface_gpu[torch-sliced-2d] SKIPPED (CuPy is not installed)                               [  9%]
tests/test_utils.py::TestViewCudaArrayInterfaceGPU::test_cuda_array_interface_gpu[torch-scalar] SKIPPED (CuPy is not installed)                                  [ 10%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[torch-1d] PASSED                                                                             [ 10%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[torch-nd] PASSED                                                                      [ 11%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[torch-non-contiguous] PASSED                                                                 [ 11%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[in_arr4] PASSED                                                                                   [ 12%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[torch-sliced] PASSED                                                                  [ 12%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[torch-sliced-2d] PASSED                                                                           [ 13%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[torch-scalar] PASSED                                                                              [ 13%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[in_arr4] PASSED                                                                       [ 13%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[in_arr1] PASSED                                                                       [ 14%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[in_arr2] PASSED                                                                                   [ 14%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[in_arr3] PASSED                                                                                   [ 15%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[torch-sliced-2d] PASSED                                                                      [ 15%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[torch-scalar] PASSED                                                                         [ 16%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[in_arr0] PASSED                                                                       [ 16%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[in_arr1] PASSED                                                                                   [ 17%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[torch-nd] PASSED                                                                             [ 17%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[torch-empty] PASSED                                                                   [ 18%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[torch-1d] PASSED                                                                      [ 18%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[in_arr2] PASSED                                                                       [ 18%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[in_arr3] PASSED                                                                       [ 19%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[in_arr0] PASSED                                                                                   [ 19%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[torch-empty] PASSED                                                                               [ 20%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[torch-non-contiguous] PASSED                                                                      [ 20%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[in_arr3] PASSED                                                                              [ 21%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[in_arr2] PASSED                                                                              [ 21%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[torch-scalar] PASSED                                                                  [ 22%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[in_arr0] PASSED                                                                              [ 22%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[torch-nd] PASSED                                                                                  [ 22%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[in_arr1] PASSED                                                                              [ 23%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[torch-sliced] PASSED                                                                              [ 23%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[torch-sliced-2d] PASSED                                                               [ 24%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu[torch-1d] PASSED                                                                                  [ 24%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[in_arr4] PASSED                                                                              [ 25%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[torch-empty] PASSED                                                                          [ 25%]
tests/test_utils.py::TestViewCPU::test_strided_memory_view_cpu_init[torch-sliced] PASSED                                                                         [ 26%]
tests/test_utils.py::TestViewCPU::test_args_viewable_as_strided_memory_cpu[torch-non-contiguous] PASSED                                                          [ 26%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_cpu[torch-1d] PASSED                                                                                  [ 27%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_cpu[torch-non-contiguous] PASSED                                                                      [ 27%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_init[torch-empty] PASSED                                                                              [ 27%]
tests/test_utils.py::TestViewGPU::test_args_viewable_as_strided_memory_gpu[torch-sliced] PASSED                                                                  [ 28%]
tests/test_utils.py::TestViewGPU::test_args_viewable_as_strided_memory_gpu[torch-1d] PASSED                                                                      [ 28%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_init[torch-nd] PASSED                                                                                 [ 29%]
tests/test_utils.py::TestViewGPU::test_args_viewable_as_strided_memory_gpu[torch-nd] PASSED                                                                      [ 29%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_cpu[torch-sliced-2d] PASSED                                                                           [ 30%]
tests/test_utils.py::TestViewGPU::test_args_viewable_as_strided_memory_gpu[torch-sliced-2d] PASSED                                                               [ 30%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_init[torch-sliced] PASSED                                                                             [ 31%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_cpu[torch-scalar] PASSED                                                                              [ 31%]
tests/test_utils.py::TestViewGPU::test_args_viewable_as_strided_memory_gpu[torch-empty] PASSED                                                                   [ 31%]
tests/test_utils.py::TestViewGPU::test_args_viewable_as_strided_memory_gpu[torch-non-contiguous] PASSED                                                          [ 32%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_init[torch-1d] PASSED                                                                                 [ 32%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_cpu[torch-nd] PASSED                                                                                  [ 33%]
tests/test_utils.py::TestViewGPU::test_args_viewable_as_strided_memory_gpu[torch-scalar] PASSED                                                                  [ 33%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_init[torch-sliced-2d] PASSED                                                                          [ 34%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_init[torch-non-contiguous] PASSED                                                                     [ 34%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_cpu[torch-empty] PASSED                                                                               [ 35%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_cpu[torch-sliced] PASSED                                                                              [ 35%]
tests/test_utils.py::TestViewGPU::test_strided_memory_view_init[torch-scalar] PASSED                                                                             [ 36%]
tests/test_utils.py::test_cast_to_3_tuple_value_error[not int] PASSED                                                                                            [ 36%]
tests/test_utils.py::test_cast_to_3_tuple_success PASSED                                                                                                         [ 36%]
tests/test_utils.py::test_cast_to_3_tuple_value_error[not tuple] PASSED                                                                                          [ 37%]
tests/test_utils.py::test_cast_to_3_tuple_value_error[len 4] PASSED                                                                                              [ 37%]
tests/test_utils.py::test_cast_to_3_tuple_value_error[isolated negative] PASSED                                                                                  [ 38%]
tests/test_utils.py::test_cast_to_3_tuple_value_error[tuple negative] PASSED                                                                                     [ 38%]
tests/test_utils.py::test_strided_memory_view_exposes_dlpack_c_exchange_api_capsule PASSED                                                                       [ 39%]
tests/test_utils.py::test_strided_memory_view_dlpack_export_requires_dtype PASSED                                                                                [ 39%]
tests/test_utils.py::test_strided_memory_view_dlpack_export_numpy_roundtrip PASSED                                                                               [ 40%]
tests/test_utils.py::test_strided_memory_view_dlpack_export_cupy_roundtrip SKIPPED (CuPy is not installed)                                                       [ 40%]
tests/test_utils.py::test_from_array_interface[2d-f-float64] PASSED                                                                                              [ 40%]
tests/test_utils.py::test_strided_memory_view_view_with_dtype_only PASSED                                                                                        [ 41%]
tests/test_utils.py::test_ml_dtypes_bfloat16_dlpack[contiguous] SKIPPED (CuPy is not installed)                                                                  [ 41%]
tests/test_utils.py::test_from_buffer[False-F-int8-(10, 13, 11)] PASSED                                                                                          [ 42%]
tests/test_utils.py::test_from_buffer[True-C-int8-(2, 3)] PASSED                                                                                                 [ 42%]
tests/test_utils.py::test_from_array_interface[1d-int32] PASSED                                                                                                  [ 43%]
tests/test_utils.py::test_from_buffer[True-F-int8-(10, 10)] PASSED                                                                                               [ 43%]
tests/test_utils.py::test_strided_memory_view_get_layout_error PASSED                                                                                            [ 44%]
tests/test_utils.py::test_view_zero_size_array[int64-shape2-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                               [ 44%]
tests/test_utils.py::test_from_buffer[True-C-uint32-(2, 3)] PASSED                                                                                               [ 45%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[bfloat16] PASSED                                                                                            [ 45%]
tests/test_utils.py::test_from_array_interface[empty-1d-int32] PASSED                                                                                            [ 45%]
tests/test_utils.py::test_from_array_interface[1d-uint16] PASSED                                                                                                 [ 46%]
tests/test_utils.py::test_ml_dtypes_bfloat16_dlpack_requires_ml_dtypes[from_any_interface] SKIPPED (CuPy is not installed)                                       [ 46%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[bool] PASSED                                                                                                [ 47%]
tests/test_utils.py::test_cai_v2_rejected PASSED                                                                                                                 [ 47%]
tests/test_utils.py::test_from_buffer[False-C-int8-()] PASSED                                                                                                    [ 48%]
tests/test_utils.py::test_cai_stream_none_rejected PASSED                                                                                                        [ 48%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[int8] PASSED                                                                                                [ 49%]
tests/test_utils.py::test_strided_memory_view_copy_from_raises PASSED                                                                                            [ 49%]
tests/test_utils.py::test_from_buffer[False-C-int8-(10, 13, 11)] PASSED                                                                                          [ 50%]
tests/test_utils.py::test_view_sliced_external[shape1-slices1-C-cai] SKIPPED (CuPy is not installed)                                                             [ 50%]
tests/test_utils.py::test_from_array_interface[3d-int32] PASSED                                                                                                  [ 50%]
tests/test_utils.py::test_from_buffer[False-C-int8-(10, 10)] PASSED                                                                                              [ 51%]
tests/test_utils.py::test_from_array_interface[1d-uint64] PASSED                                                                                                 [ 51%]
tests/test_utils.py::test_ml_dtypes_bfloat16_dlpack_requires_ml_dtypes[from_dlpack] SKIPPED (CuPy is not installed)                                              [ 52%]
tests/test_utils.py::test_view_zero_size_array[float64-shape2-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                             [ 52%]
tests/test_utils.py::test_from_buffer[False-F-uint32-(2, 3)] PASSED                                                                                              [ 53%]
tests/test_utils.py::test_from_buffer[True-F-uint32-(10, 10)] PASSED                                                                                             [ 53%]
tests/test_utils.py::test_from_buffer[False-F-int8-(2, 3)] PASSED                                                                                                [ 54%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[complex64] PASSED                                                                                           [ 54%]
tests/test_utils.py::test_dlpack_export_structured_dtype_raises PASSED                                                                                           [ 54%]
tests/test_utils.py::test_from_any_interface_cai_fallback SKIPPED (CuPy is not installed)                                                                        [ 55%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[complex128] PASSED                                                                                          [ 55%]
tests/test_utils.py::test_from_buffer[False-C-uint32-(10, 10)] PASSED                                                                                            [ 56%]
tests/test_utils.py::test_from_cuda_array_interface_zero_strides PASSED                                                                                          [ 56%]
tests/test_utils.py::test_view_zero_size_array[uint8-shape1-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')                 [ 57%]
tests/test_utils.py::test_view_zero_size_array[uint8-shape0-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')                 [ 57%]
tests/test_utils.py::test_view_zero_size_array[uint8-shape2-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')                 [ 58%]
tests/test_utils.py::test_from_buffer[False-C-uint32-(2, 3)] PASSED                                                                                              [ 58%]
tests/test_utils.py::test_view_zero_size_array[float64-shape1-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                             [ 59%]
tests/test_utils.py::test_from_buffer[False-F-int8-(10, 10)] PASSED                                                                                              [ 59%]
tests/test_utils.py::test_ml_dtypes_bfloat16_dlpack[strided] SKIPPED (CuPy is not installed)                                                                     [ 59%]
tests/test_utils.py::test_from_buffer_disallowed_negative_offset PASSED                                                                                          [ 60%]
tests/test_utils.py::test_from_array_interface[1d-int64] PASSED                                                                                                  [ 60%]
tests/test_utils.py::test_from_buffer_with_non_power_of_two_itemsize PASSED                                                                                      [ 61%]
tests/test_utils.py::test_from_buffer_incompatible_dtype_and_itemsize[None-None-itemsize or dtype must be specified] PASSED                                      [ 61%]
tests/test_utils.py::test_from_buffer[False-F-uint32-()] PASSED                                                                                                  [ 62%]
tests/test_utils.py::test_from_array_interface[scalar-float64] PASSED                                                                                            [ 62%]
tests/test_utils.py::test_from_buffer[True-F-uint32-()] PASSED                                                                                                   [ 63%]
tests/test_utils.py::test_view_zero_size_array[int64-shape1-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                               [ 63%]
tests/test_utils.py::test_from_array_interface[1d-complex64] PASSED                                                                                              [ 63%]
tests/test_utils.py::test_from_array_interface[1d-int16] PASSED                                                                                                  [ 64%]
tests/test_utils.py::test_from_buffer[True-F-uint32-(2, 3)] PASSED                                                                                               [ 64%]
tests/test_utils.py::test_from_buffer[True-F-int8-()] PASSED                                                                                                     [ 65%]
tests/test_utils.py::test_view_zero_size_array[int64-shape0-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')                 [ 65%]
tests/test_utils.py::test_view_zero_size_array[int64-shape1-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')                 [ 66%]
tests/test_utils.py::test_strided_memory_view_deprecated_cai_init SKIPPED (CuPy is not installed)                                                                [ 66%]
tests/test_utils.py::test_view_sliced_external[shape5-slices5-C-cai] SKIPPED (CuPy is not installed)                                                             [ 67%]
tests/test_utils.py::test_view_zero_size_array[int64-shape2-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')                 [ 67%]
tests/test_utils.py::test_from_buffer[True-C-int8-(10, 10)] PASSED                                                                                               [ 68%]
tests/test_utils.py::test_view_zero_size_array[uint8-shape0-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                               [ 68%]
tests/test_utils.py::test_from_array_interface[2d-strided-2x2-int32] PASSED                                                                                      [ 68%]
tests/test_utils.py::test_from_array_interface[1d-uint8] PASSED                                                                                                  [ 69%]
tests/test_utils.py::test_from_array_interface[single-element] PASSED                                                                                            [ 69%]
tests/test_utils.py::test_strided_memory_view_copy_to_raises PASSED                                                                                              [ 70%]
tests/test_utils.py::test_from_buffer_sliced[F] PASSED                                                                                                           [ 70%]
tests/test_utils.py::test_from_buffer[True-C-int8-()] PASSED                                                                                                     [ 71%]
tests/test_utils.py::test_from_buffer[True-F-int8-(2, 3)] PASSED                                                                                                 [ 71%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[float32] PASSED                                                                                             [ 72%]
tests/test_utils.py::test_from_array_interface[2d-strided-float64] PASSED                                                                                        [ 72%]
tests/test_utils.py::test_struct_array SKIPPED (could not import 'cupy': No module named 'cupy')                                                                 [ 72%]
tests/test_utils.py::test_view_zero_size_array[float64-shape0-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')               [ 73%]
tests/test_utils.py::test_view_zero_size_array[uint8-shape2-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                               [ 73%]
tests/test_utils.py::test_view_zero_size_array[float64-shape1-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')               [ 74%]
tests/test_utils.py::test_from_buffer[True-F-int8-(10, 13, 11)] PASSED                                                                                           [ 74%]
tests/test_utils.py::test_from_array_interface[2d-f-int32] PASSED                                                                                                [ 75%]
tests/test_utils.py::test_view_zero_size_array[float64-shape2-from_cuda_array_interface] SKIPPED (could not import 'cupy': No module named 'cupy')               [ 75%]
tests/test_utils.py::test_view_sliced_external[shape0-slices0-C-dlpack] PASSED                                                                                   [ 76%]
tests/test_utils.py::test_array_interface_v2_rejected PASSED                                                                                                     [ 76%]
tests/test_utils.py::test_from_cuda_array_interface_empty_array PASSED                                                                                           [ 77%]
tests/test_utils.py::test_from_array_interface_unsupported_strides PASSED                                                                                        [ 77%]
tests/test_utils.py::test_view_sliced_external_negative_offset[C-dlpack] PASSED                                                                                  [ 77%]
tests/test_utils.py::test_ml_dtypes_bfloat16_torch_dlpack[strided] PASSED                                                                                        [ 78%]
tests/test_utils.py::test_view_sliced_external[shape6-slices6-F-dlpack] PASSED                                                                                   [ 78%]
tests/test_utils.py::test_from_buffer[False-F-uint32-(10, 10)] PASSED                                                                                            [ 79%]
tests/test_utils.py::test_from_buffer[False-F-uint32-(10, 13, 11)] PASSED                                                                                        [ 79%]
tests/test_utils.py::test_view_sliced_external_negative_offset[F-cai] SKIPPED (CuPy is not installed)                                                            [ 80%]
tests/test_utils.py::test_from_buffer_incompatible_dtype_and_itemsize[dtype0-1-itemsize .+ does not match dtype.itemsize .+] PASSED                              [ 80%]
tests/test_utils.py::test_from_array_interface[1d-strided-int32] PASSED                                                                                          [ 81%]
tests/test_utils.py::test_from_buffer[False-C-int8-(2, 3)] PASSED                                                                                                [ 81%]
tests/test_utils.py::test_from_array_interface[3d-float64] PASSED                                                                                                [ 81%]
tests/test_utils.py::test_cai_mask_rejected PASSED                                                                                                               [ 82%]
tests/test_utils.py::test_from_array_interface[2d-c-float32] PASSED                                                                                              [ 82%]
tests/test_utils.py::test_from_array_interface[structured-dtype] PASSED                                                                                          [ 83%]
tests/test_utils.py::test_view_sliced_external[shape3-slices3-F-cai] SKIPPED (CuPy is not installed)                                                             [ 83%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[int32] PASSED                                                                                               [ 84%]
tests/test_utils.py::test_from_buffer[True-C-int8-(10, 13, 11)] PASSED                                                                                           [ 84%]
tests/test_utils.py::test_from_buffer[True-C-uint32-(10, 13, 11)] PASSED                                                                                         [ 85%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[uint8] PASSED                                                                                               [ 85%]
tests/test_utils.py::test_view_sliced_external[shape4-slices4-C-dlpack] PASSED                                                                                   [ 86%]
tests/test_utils.py::test_from_buffer[False-F-int8-()] PASSED                                                                                                    [ 86%]
tests/test_utils.py::test_from_cuda_array_interface_unsupported_strides PASSED                                                                                   [ 86%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[int16] PASSED                                                                                               [ 87%]
tests/test_utils.py::test_from_array_interface[empty-2d-float64] PASSED                                                                                          [ 87%]
tests/test_utils.py::test_view_zero_size_array[float64-shape0-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                             [ 88%]
tests/test_utils.py::test_strided_memory_view_repr PASSED                                                                                                        [ 88%]
tests/test_utils.py::test_ml_dtypes_bfloat16_torch_dlpack[contiguous] PASSED                                                                                     [ 89%]
tests/test_utils.py::test_from_buffer[True-C-uint32-(10, 10)] PASSED                                                                                             [ 89%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[float64] PASSED                                                                                             [ 90%]
tests/test_utils.py::test_from_array_interface[2d-c-int32] PASSED                                                                                                [ 90%]
tests/test_utils.py::test_dlpack_export_unsupported_dtype_raises PASSED                                                                                          [ 90%]
tests/test_utils.py::test_from_buffer[False-C-uint32-(10, 13, 11)] PASSED                                                                                        [ 91%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[int64] PASSED                                                                                               [ 91%]
tests/test_utils.py::test_view_sliced_external[shape7-slices7-F-cai] SKIPPED (CuPy is not installed)                                                             [ 92%]
tests/test_utils.py::test_view_sliced_external_negative_offset[F-dlpack] PASSED                                                                                  [ 92%]
tests/test_utils.py::test_from_array_interface[1d-float64] PASSED                                                                                                [ 93%]
tests/test_utils.py::test_view_zero_size_array[uint8-shape1-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                               [ 93%]
tests/test_utils.py::test_torch_tensor_bridge_dtypes[float16] PASSED                                                                                             [ 94%]
tests/test_utils.py::test_from_array_interface[1d-complex128] PASSED                                                                                             [ 94%]
tests/test_utils.py::test_strided_memory_view_view_no_args_returns_self PASSED                                                                                   [ 95%]
tests/test_utils.py::test_view_zero_size_array[int64-shape0-from_dlpack] SKIPPED (could not import 'cupy': No module named 'cupy')                               [ 95%]
tests/test_utils.py::test_from_buffer[True-F-uint32-(10, 13, 11)] PASSED                                                                                         [ 95%]
tests/test_utils.py::test_from_buffer_sliced[C] PASSED                                                                                                           [ 96%]
tests/test_utils.py::test_from_buffer_too_small PASSED                                                                                                           [ 96%]
tests/test_utils.py::test_view_sliced_external_negative_offset[C-cai] SKIPPED (CuPy is not installed)                                                            [ 97%]
tests/test_utils.py::test_from_cuda_array_interface_negative_strides SKIPPED (CuPy is not installed)                                                             [ 97%]
tests/test_utils.py::test_from_array_interface[scalar-int32] PASSED                                                                                              [ 98%]
tests/test_utils.py::test_array_interface_mask_rejected PASSED                                                                                                   [ 98%]
tests/test_utils.py::test_from_buffer[True-C-uint32-()] PASSED                                                                                                   [ 99%]
tests/test_utils.py::test_view_sliced_external[shape2-slices2-F-dlpack] PASSED                                                                                   [ 99%]
tests/test_utils.py::test_from_buffer[False-C-uint32-()] PASSED                                                                                                  [100%]

========================================================================== slowest durations ==========================================================================
0.48s call     tests/example_tests/test_basic_examples.py::test_example[show_device_properties.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[jit_lto_fractal.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[strided_memory_view_cpu.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[vector_add.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[cuda_graphs.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[saxpy.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[gl_interop_plasma.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[strided_memory_view_constructors.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[memory_ops.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[strided_memory_view_gpu.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[graph_update.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[tma_tensor_map.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[simple_multi_gpu_example.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[memory_pool_resources.py]
0.01s call     tests/example_tests/test_basic_examples.py::test_example[thread_block_cluster.py]

(636 durations < 0.005s hidden.  Use -vv to show these durations.)
======================================================================= short test summary info =======================================================================
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\jit_lto_fractal.py due to missing package requirement: nvidia-cuda-nvrtc, cupy-cuda13x
SKIPPED [1] tests\example_tests\test_basic_examples.py:107: Skipping gl_interop_plasma.py due to unmet system requirement
SKIPPED [1] tests\example_tests\test_basic_examples.py:107: Skipping thread_block_cluster.py due to unmet system requirement
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\strided_memory_view_gpu.py due to missing package requirement: nvidia-cuda-nvrtc, cupy-cuda13x
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\tma_tensor_map.py due to missing package requirement: cupy-cuda13x
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\cuda_graphs.py due to missing package requirement: nvidia-cuda-nvrtc, cupy-cuda13x
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\memory_pool_resources.py due to missing package requirement: nvidia-cuda-nvrtc
SKIPPED [1] tests\example_tests\test_basic_examples.py:107: Skipping strided_memory_view_cpu.py due to unmet system requirement
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\strided_memory_view_constructors.py due to missing package requirement: cupy-cuda13x
SKIPPED [1] tests\example_tests\test_basic_examples.py:107: Skipping pytorch_example.py due to unmet system requirement
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\graph_update.py due to missing package requirement: nvidia-cuda-nvrtc
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\saxpy.py due to missing package requirement: nvidia-cuda-nvrtc, cupy-cuda13x
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\simple_multi_gpu_example.py due to missing package requirement: cupy-cuda13x
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\memory_ops.py due to missing package requirement: nvidia-cuda-nvrtc, cupy-cuda13x
SKIPPED [1] ..\cuda_bindings\cuda\bindings\_test_helpers\pep723.py:46: Skipping C:\Users\rgrossekunst\wrk\forked\cuda-python\cuda_core\tests\example_tests\..\..\examples\vector_add.py due to missing package requirement: nvidia-cuda-nvrtc, cupy-cuda13x
SKIPPED [7] tests\test_utils.py:340: CuPy is not installed
SKIPPED [1] tests\test_utils.py:309: CuPy is not installed
SKIPPED [2] tests\test_utils.py:724: CuPy is not installed
SKIPPED [18] tests\test_utils.py:576: could not import 'cupy': No module named 'cupy'
SKIPPED [2] tests\test_utils.py:792: CuPy is not installed
SKIPPED [4] tests\test_utils.py:506: CuPy is not installed
SKIPPED [1] tests\test_utils.py:845: CuPy is not installed
SKIPPED [1] tests\test_utils.py:832: CuPy is not installed
SKIPPED [1] tests\test_utils.py:600: could not import 'cupy': No module named 'cupy'
SKIPPED [2] tests\test_utils.py:543: CuPy is not installed
SKIPPED [1] tests\test_utils.py:708: CuPy is not installed
=================================================================== 167 passed, 55 skipped in 2.18s ===================================================================

@rwgk rwgk marked this pull request as ready for review May 6, 2026 07:56
@rwgk rwgk requested a review from leofang May 6, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant