Opened 3 years ago

Last modified 6 months ago

#63444 assigned defect

py-pyopencl: TypeError: unsupported type for persistent hash keying: <class 'numpy.dtype[void]'>

Reported by: lpagani91 Owned by: petrrr
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: py-pyopencl

Description (last modified by lpagani91)

Hello,

Two years ago pyopencl was included in the python3.6 and python3.7 packages only. While the 3.6 version works fine, the py37-pyopencl package crashes with the following message :

  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyopencl/__init__.py", line 821, in kernel_set_scalar_arg_dtypes
    work_around_arg_count_bug=work_around_arg_count_bug)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pyopencl/invoker.py", line 371, in generate_enqueue_and_set_args
    result = invoker_cache[cache_key]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytools/persistent_dict.py", line 506, in __getitem__
    return self.fetch(key, _stacklevel=1)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytools/persistent_dict.py", line 600, in fetch
    hexdigest_key = self.key_builder(key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytools/persistent_dict.py", line 233, in __call__
    self.rec(key_hash, key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytools/persistent_dict.py", line 214, in rec
    method(inner_key_hash, key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytools/persistent_dict.py", line 268, in update_for_tuple
    self.rec(key_hash, obj_i)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytools/persistent_dict.py", line 219, in rec
    % type(key))
TypeError: unsupported type for persistent hash keying: <class 'numpy.dtype[void]'>

Change History (5)

comment:1 Changed 13 months ago by lpagani91

update : today pyopencl has been ported up to python3.10 but the problem persists for all versions except 3.6

Traceback (most recent call last):
  File "/Users/laurent/Transfert-Radiatif/LOC/LOC_OT.py", line 333, in <module>
    kernel_sim.set_scalar_arg_dtypes([
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyopencl/__init__.py", line 816, in kernel_set_scalar_arg_dtypes
    self._enqueue, self._set_args = generate_enqueue_and_set_args(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyopencl/invoker.py", line 371, in generate_enqueue_and_set_args
    result = invoker_cache[cache_key]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 506, in __getitem__
    return self.fetch(key, _stacklevel=1)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 600, in fetch
    hexdigest_key = self.key_builder(key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 233, in __call__
    self.rec(key_hash, key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 214, in rec
    method(inner_key_hash, key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 268, in update_for_tuple
    self.rec(key_hash, obj_i)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 214, in rec
    method(inner_key_hash, key)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 268, in update_for_tuple
    self.rec(key_hash, obj_i)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pytools/persistent_dict.py", line 218, in rec
    raise TypeError("unsupported type for persistent hash keying: %s"
TypeError: unsupported type for persistent hash keying: <class 'numpy.dtype[void]'>
Mon Oct  2 09:50:23 CEST 2023

comment:2 Changed 13 months ago by lpagani91

Description: modified (diff)
Summary: pyopencl for python 3.8 and 3.9 + bug fixpyopencl crashes for all python versions from 3.7 to 3.10.

comment:3 Changed 9 months ago by lpagani91

With the pyopencl 2023.1.4, the problem has disappeared from python versions 3.8 to 3.10 (cannot test on 3.7 which is deprecated) The ticket can be closed.

comment:4 Changed 9 months ago by lpagani91

Port: pyopencl - all flavors added; py37-pyopencl removed

My last comment 3 days ago was on Mac OS 10.12 (Sierra) but on 10.15 (Catalina) no version works! It is a different problem now so I will open a new ticket.

comment:5 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: petrrr removed
Owner: set to petrrr
Port: py-pyopencl added; pyopencl - all flavors removed
Status: newassigned
Summary: pyopencl crashes for all python versions from 3.7 to 3.10.py-pyopencl: TypeError: unsupported type for persistent hash keying: <class 'numpy.dtype[void]'>

Let's retitle this correctly. There was no crash; there was just an error message.

Note: See TracTickets for help on using tickets.