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

Tests fail with float16 on OpenCL while they should work. #492

Closed
ghisvail opened this issue Jul 27, 2017 · 7 comments
Closed

Tests fail with float16 on OpenCL while they should work. #492

ghisvail opened this issue Jul 27, 2017 · 7 comments
Milestone

Comments

@ghisvail
Copy link

Same context as in #491, but with float16 compute support. Running the tests on pocl produces the following errors:

======================================================================
ERROR: pygpu.tests.test_elemwise.test_elemwise_f16(<built-in function neg>, 'float16')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/pygpu/tests/support.py", line 44, in f
    func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pygpu/tests/test_elemwise.py", line 46, in elemwise1_ops_array
    out_g = op(g)
  File "/usr/lib/python2.7/dist-packages/pygpu/_array.py", line 184, in __neg__
    return elemwise1(self, '-')
  File "/usr/lib/python2.7/dist-packages/pygpu/elemwise.py", line 35, in elemwise1
    k = GpuElemwise(a.context, oper, args, convert_f16=convert_f16)
  File "pygpu/_elemwise.pyx", line 143, in pygpu._elemwise.GpuElemwise.__cinit__ (pygpu/_elemwise.c:3140)
GpuArrayException: Could not initialize C GpuElemwise instance

======================================================================
ERROR: pygpu.tests.test_elemwise.test_elemwise_f16(<built-in function add>, 'float16', 'float16', (50,))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/pygpu/tests/support.py", line 44, in f
    func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pygpu/tests/test_elemwise.py", line 126, in elemwise2_ops_array
    out_g = op(ag, bg)
  File "/usr/lib/python2.7/dist-packages/pygpu/_array.py", line 24, in __add__
    return elemwise2(self, '+', other, self, broadcast=True)
  File "/usr/lib/python2.7/dist-packages/pygpu/elemwise.py", line 76, in elemwise2
    k = GpuElemwise(ary.context, oper, args, convert_f16=convert_f16)
  File "pygpu/_elemwise.pyx", line 143, in pygpu._elemwise.GpuElemwise.__cinit__ (pygpu/_elemwise.c:3140)
GpuArrayException: Could not initialize C GpuElemwise instance

======================================================================
ERROR: pygpu.tests.test_elemwise.test_elemwise_f16(<built-in function iadd>, 'float16', 'float16', (50,))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/pygpu/tests/support.py", line 44, in f
    func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pygpu/tests/test_elemwise.py", line 150, in ielemwise2_ops_array
    out_g = op(ag, bg)
  File "/usr/lib/python2.7/dist-packages/pygpu/_array.py", line 30, in __iadd__
    return ielemwise2(self, '+', other, broadcast=True)
  File "/usr/lib/python2.7/dist-packages/pygpu/elemwise.py", line 94, in ielemwise2
    k = GpuElemwise(a.context, oper, args, convert_f16=convert_f16)
  File "pygpu/_elemwise.pyx", line 143, in pygpu._elemwise.GpuElemwise.__cinit__ (pygpu/_elemwise.c:3140)
GpuArrayException: Could not initialize C GpuElemwise instance

Again, perhaps pytest skipif could help here.

@ghisvail
Copy link
Author

Logs of the Debian CI are available here

@nouiz nouiz added this to the 0.6.10 milestone Aug 1, 2017
@ghisvail
Copy link
Author

Is there a way to detect whether the current device is float16 or CUDA capable within pygpu?

@nouiz
Copy link
Member

nouiz commented Aug 17, 2017 via email

@ghisvail
Copy link
Author

So all CUDA capabable GPU support it.

Ok, so that factors to detecting whether the current device is CUDA capable. The reason I am asking is because, assuming such function to detect CUDA capability exists in pygpu, then it could be used together with unittest.skipif for skipping the failing tests on the Debian CI (which uses pocl).

@nouiz
Copy link
Member

nouiz commented Aug 17, 2017 via email

@ghisvail
Copy link
Author

I don't know if float16 storage is supported in OpenCL or not.

Hmmm, that's not what I am asking. Is there a way to call some function in pygpu which returns whether the device is CUDA capable? Forget about OpenCL.

@abergeron
Copy link
Member

As far as I know float16 storage is part of the core requirements for OpenCL since 1.0.

The problem you are getting here is not because the device doesn't support float16, but most probably because there was a compilation error in the kernel, which is a problem that we have to fix.

You can try a Debug build to get more information out of this error (Including a source dump and the compiler error log).

@nouiz nouiz changed the title Skip float16 specific tests if DEVICE is not float16 compatible Tests fail with float16 on OpenCL while they should work. Oct 10, 2017
@nouiz nouiz closed this as completed Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants