atommoyer / stapler

A Motif Hash Based Method for Matching Crosslinkers into Peptides and Proteins
15 stars 3 forks source link

A jit decorator was called on an already jitted function CPUDispatcher #2

Closed ajasja closed 2 years ago

ajasja commented 2 years ago

Not sure if this is stapler or homog issue, but after runinng the example I get

Traceback (most recent call last):
  File "/home/aljubetic/AF2/projects/2022-04-13__stapler/staple_my_proteins.py", line 15, in <module>
    from stapler import NativeDisulfideStapler
  File "/home/aljubetic/gits/stapler/stapler/__init__.py", line 1, in <module>
    from .stapler import Stapler
  File "/home/aljubetic/gits/stapler/stapler/stapler.py", line 7, in <module>
    import homog
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/__init__.py", line 10, in <module>
    from .homog import *
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/homog.py", line 2, in <module>
    from . import quat
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/quat.py", line 132, in <module>
    gu_rot_to_quat = guvec([
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/util.py", line 10, in guvec
    return numba.guvectorize(
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/decorators.py", line 192, in wrap
    guvec = GUVectorize(func, signature, **kwargs)
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/decorators.py", line 51, in __new__
    return imp(func, signature, identity=identity, cache=cache,
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/gufunc.py", line 28, in __init__
    self.gufunc_builder = GUFuncBuilder(
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/ufuncbuilder.py", line 324, in __init__
    self.nb_func = jit(_target='npyufunc', cache=cache)(py_func)
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/core/decorators.py", line 191, in wrapper
    raise TypeError(
TypeError: A jit decorator was called on an already jitted function CPUDispatcher(<function kernel_rot_to_quat at 0x7ff3a349e9d0>).  If trying to access the original python function, use the CPUDispatcher(<function kernel_rot_to_quat at 0x7ff3a349e9d0>).py_func attribute.
(pyro) 

I'm guessing it's a numba compatibility issue, but not sure which version I should try. I'm using homog 0.1.14 and numba 0.55.1. Full env: https://gist.github.com/ajasja/8de64fed1b1239413dbd24377c6fe375

ajasja commented 2 years ago

Also a temp fix is export NUMBA_DISABLE_JIT=1

atom-moyer commented 2 years ago

I believe this is a homog issue.

It should be very easy for me to remove homog as a dependency. It always has problems importing.

I'll try to do this today.

ajasja commented 2 years ago

Thanks!

atom-moyer commented 2 years ago

Homog has been removed, and a new version has been uploaded to pypi/github.

ajasja commented 2 years ago

Hi Adam, there is still a dependency on homog through xbin.

Traceback (most recent call last):
  File "/home/aljubetic/projects/2022-04-13__stapler/staple_my_proteins.py", line 15, in <module>
    from stapler import NativeDisulfideStapler
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/stapler/__init__.py", line 1, in <module>
    from .stapler import Stapler
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/stapler/stapler.py", line 7, in <module>
    import xbin
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/xbin-0.1.7-py3.9.egg/xbin/__init__.py", line 10, in <module>
    from .xbin import *
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/xbin-0.1.7-py3.9.egg/xbin/xbin.py", line 10, in <module>
    from homog.util import jit, guvec, float64, int64
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/__init__.py", line 10, in <module>
    from .homog import *
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/homog.py", line 2, in <module>
    from . import quat
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/quat.py", line 132, in <module>
    gu_rot_to_quat = guvec([
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/homog-0.1.14-py3.9.egg/homog/util.py", line 10, in guvec
    return numba.guvectorize(
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/decorators.py", line 192, in wrap
    guvec = GUVectorize(func, signature, **kwargs)
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/decorators.py", line 51, in __new__
    return imp(func, signature, identity=identity, cache=cache,
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/gufunc.py", line 28, in __init__
    self.gufunc_builder = GUFuncBuilder(
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/np/ufunc/ufuncbuilder.py", line 324, in __init__
    self.nb_func = jit(_target='npyufunc', cache=cache)(py_func)
  File "/home/aljubetic/conda/envs/pyro/lib/python3.9/site-packages/numba/core/decorators.py", line 191, in wrapper
    raise TypeError(
TypeError: A jit decorator was called on an already jitted function CPUDispatcher(<function kernel_rot_to_quat at 0x7f8e7069b040>).  If trying to access the original python function, use the CPUDispatcher(<function kernel_rot_to_quat at 0x7f8e7069b040>).py_func attribute.