Skip to content

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Sep 18, 2025

This PR simply removes llvmlite from the test dependencies, with leads to turning off the failing tests.

Our existing MINIMAL_NVVMIR_BITCODE_STATIC dictionary is currently sufficient to exercise the nvvm bindings on all platforms.

For easy future reference, the llvmlite==0.45 release caused these test failures:

cuda/bindings/nvvm.pyx:54: nvvmError
============================================================================== short test summary info ==============================================================================
FAILED tests/test_nvvm.py::test_compile_program_with_minimal_nvvm_ir[bitcode_dynamic-options0] - RuntimeError: FileNameHere.ll: parse Invalid value (Producer: 'LLVM20.1.8' Reader: 'LLVM 7.0.1')
FAILED tests/test_nvvm.py::test_compile_program_with_minimal_nvvm_ir[bitcode_dynamic-options1] - RuntimeError: FileNameHere.ll: parse Invalid value (Producer: 'LLVM20.1.8' Reader: 'LLVM 7.0.1')
FAILED tests/test_nvvm.py::test_compile_program_with_minimal_nvvm_ir[bitcode_dynamic-options2] - RuntimeError: FileNameHere.ll: parse Invalid value (Producer: 'LLVM20.1.8' Reader: 'LLVM 7.0.1')
FAILED tests/test_nvvm.py::test_verify_program_with_minimal_nvvm_ir[bitcode_dynamic-options0] - cuda.bindings.nvvm.nvvmError: ERROR_INVALID_IR (6)
FAILED tests/test_nvvm.py::test_verify_program_with_minimal_nvvm_ir[bitcode_dynamic-options1] - cuda.bindings.nvvm.nvvmError: ERROR_INVALID_IR (6)
FAILED tests/test_nvvm.py::test_verify_program_with_minimal_nvvm_ir[bitcode_dynamic-options2] - cuda.bindings.nvvm.nvvmError: ERROR_INVALID_IR (6)
=========================================================================== 6 failed, 30 passed in 0.22s ============================================================================

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Sep 18, 2025

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.

@rwgk
Copy link
Collaborator Author

rwgk commented Sep 18, 2025

/ok to test

@rwgk
Copy link
Collaborator Author

rwgk commented Sep 18, 2025

Logging a full error for easy future reference:

(Cp13WslVenv) rwgk-win11.localdomain:~/forked/cuda-python/cuda_bindings $ pytest -ra -s -v tests/test_nvvm.py -k 'test_compile_program_with_minimal_nvvm_ir[bitcode_dynamic-options0]'
================================================================================ test session starts ================================================================================
platform linux -- Python 3.12.3, pytest-8.4.2, pluggy-1.6.0 -- /home/rgrossekunst/forked/cuda-python/Cp13WslVenv/bin/python3
cachedir: .pytest_cache
benchmark: 5.1.0 (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)
rootdir: /home/rgrossekunst/forked/cuda-python/cuda_bindings/tests
configfile: pytest.ini
plugins: benchmark-5.1.0
collected 36 items / 35 deselected / 1 selected

tests/test_nvvm.py::test_compile_program_with_minimal_nvvm_ir[bitcode_dynamic-options0] FAILED

===================================================================================== FAILURES ======================================================================================
________________________________________________________ test_compile_program_with_minimal_nvvm_ir[bitcode_dynamic-options0] ________________________________________________________

minimal_nvvmir = b'BC\xc0\xde5\x14\x00\x00\x05\x00\x00\x00b\x0c0$JY\xbe\xa6M\xfb\xb5\xcf\x0bQ\x80L\x01\x00\x00\x00!\x0c\x00\x00\xa9\x01...x00]\x0c\x00\x00\r\x00\x00\x00\x12\x03\x94g\x00\x00\x00\x00kernel20.1.8nvptx64-nvidia-cuda<string>\x00\x00\x00\x00\x00'
options = []

    @pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]])
    def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
        with nvvm_program() as prog:
            nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll")
            try:
>               nvvm.compile_program(prog, len(options), options)

tests/test_nvvm.py:282:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cuda/bindings/nvvm.pyx:188: in cuda.bindings.nvvm.compile_program
    cpdef compile_program(intptr_t prog, int num_options, options):
cuda/bindings/nvvm.pyx:208: in cuda.bindings.nvvm.compile_program
    check_status(status)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise nvvmError(status)
E   cuda.bindings.nvvm.nvvmError: ERROR_COMPILATION (9)

cuda/bindings/nvvm.pyx:54: nvvmError

The above exception was the direct cause of the following exception:

minimal_nvvmir = b'BC\xc0\xde5\x14\x00\x00\x05\x00\x00\x00b\x0c0$JY\xbe\xa6M\xfb\xb5\xcf\x0bQ\x80L\x01\x00\x00\x00!\x0c\x00\x00\xa9\x01...x00]\x0c\x00\x00\r\x00\x00\x00\x12\x03\x94g\x00\x00\x00\x00kernel20.1.8nvptx64-nvidia-cuda<string>\x00\x00\x00\x00\x00'
options = []

    @pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]])
    def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
        with nvvm_program() as prog:
            nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll")
            try:
                nvvm.compile_program(prog, len(options), options)
            except nvvm.nvvmError as e:
>               raise RuntimeError(get_program_log(prog)) from e
E               RuntimeError: FileNameHere.ll: parse Invalid value (Producer: 'LLVM20.1.8' Reader: 'LLVM 7.0.1')

tests/test_nvvm.py:284: RuntimeError
============================================================================== short test summary info ==============================================================================
FAILED tests/test_nvvm.py::test_compile_program_with_minimal_nvvm_ir[bitcode_dynamic-options0] - RuntimeError: FileNameHere.ll: parse Invalid value (Producer: 'LLVM20.1.8' Reader: 'LLVM 7.0.1')
========================================================================= 1 failed, 35 deselected in 0.07s ==========================================================================

@github-actions

This comment has been minimized.

@leofang leofang marked this pull request as ready for review September 19, 2025 00:37
@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Sep 19, 2025

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

Contributors can view more details about this message here.

@leofang leofang merged commit 95ffffe into NVIDIA:main Sep 19, 2025
49 checks passed
@github-actions
Copy link

Doc Preview CI
Preview removed because the pull request was closed or merged.

@rwgk rwgk deleted the llvmlite_optional branch September 19, 2025 01:01
@leofang leofang added bug Something isn't working P0 High priority - Must do! CI/CD CI/CD infrastructure labels Sep 19, 2025
@leofang leofang added this to the cuda.core beta 7 milestone Sep 19, 2025
@leofang leofang added the to-be-backported Trigger the bot to raise a backport PR upon merge label Sep 19, 2025
github-actions bot pushed a commit that referenced this pull request Sep 19, 2025
@github-actions
Copy link

leofang pushed a commit that referenced this pull request Sep 19, 2025
…oml (#988) (#993)

(cherry picked from commit 95ffffe)

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgkio@gmail.com>
@cpcloud cpcloud mentioned this pull request Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD CI/CD infrastructure P0 High priority - Must do! to-be-backported Trigger the bot to raise a backport PR upon merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants