Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_clmath.py::test_fmod fails on i386 using pocl 3.1 built with llvm 15 #673

Closed
anbe42 opened this issue Jan 30, 2023 · 2 comments
Closed
Labels

Comments

@anbe42
Copy link

anbe42 commented Jan 30, 2023

Debian CI noticed a pyopencl autopkgtest regression on i386 when using pocl 3.1 (built with llvm 15).

The only change that I'm aware of is that I recently switched the pocl build from llvm 14 to llvm 15, all other versions should be unchanged.

https://ci.debian.net/data/autopkgtest/testing/i386/p/pyopencl/30825012/log.gz

=================================== FAILURES ===================================
_ test_fmod[<context factory for <pyopencl.Device 'pthread-i686-AMD EPYC 7571' on 'Portable Computing Language'>>] _

ctx_factory = <pyopencl.tools._ContextFactory object at 0xf54e7dd8>

    def test_fmod(ctx_factory):
        context = ctx_factory()
        queue = cl.CommandQueue(context)
    
        for s in sizes:
            a = cl_array.arange(queue, s, dtype=np.float32)/10
            a2 = cl_array.arange(queue, s, dtype=np.float32)/45.2 + 0.1
            b = clmath.fmod(a, a2)
    
            a = a.get()
            a2 = a2.get()
            b = b.get()
    
            for i in range(s):
>               assert math.fmod(a[i], a2[i]) == b[i]
E               assert 0.13451331853866577 == 0.13451329
E                +  where 0.13451331853866577 = <built-in function fmod>(0.6, 0.23274335)
E                +    where <built-in function fmod> = math.fmod

test_clmath.py:172: AssertionError
=============================== warnings summary ===============================
...
=========================== short test summary info ============================
FAILED test_clmath.py::test_fmod[<context factory for <pyopencl.Device 'pthread-i686-AMD EPYC 7571' on 'Portable Computing Language'>>]
= 1 failed, 305 passed, 7 skipped, 2 xfailed, 33 warnings in 701.40s (0:11:41) =

I can reproduce that locally, too, in an i386 chroot in case you need further information for debugging this.

This is not neccessarily a bug in pyopencl, but it could also be further down in the dependency chain (pocl, llvm, ...)

@inducer
Copy link
Owner

inducer commented Feb 16, 2023

I think the bug is in that test in this case. There's no reason why fmod would be exact. See #676.

@inducer
Copy link
Owner

inducer commented Feb 16, 2023

Also, thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants