numba: AssertionError: Failed in object mode pipeline (step: object mode frontend)
I’m using Python 3.7.3.
My module’s import
import os
import math
import json
import numpy as np
import datetime
import time
import copy
import librosa
from numba import jit
Stacktrace:
File "/usr/local/lib/python3.7/site-packages/numba/dispatcher.py", line 369, in _compile_for_args
raise e
File "/usr/local/lib/python3.7/site-packages/numba/dispatcher.py", line 326, in _compile_for_args
return self.compile(tuple(argtypes))
File "/usr/local/lib/python3.7/site-packages/numba/compiler_lock.py", line 32, in _acquire_compile_lock
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/numba/dispatcher.py", line 658, in compile
cres = self._compiler.compile(args, return_type)
File "/usr/local/lib/python3.7/site-packages/numba/dispatcher.py", line 82, in compile
pipeline_class=self.pipeline_class)
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 941, in compile_extra
return pipeline.compile_extra(func)
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 372, in compile_extra
return self._compile_bytecode()
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 872, in _compile_bytecode
return self._compile_core()
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 859, in _compile_core
res = pm.run(self.status)
File "/usr/local/lib/python3.7/site-packages/numba/compiler_lock.py", line 32, in _acquire_compile_lock
return func(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 253, in run
raise patched_exception
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 244, in run
stage()
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 462, in stage_objectmode_frontend
cres = self.frontend_looplift()
File "/usr/local/lib/python3.7/site-packages/numba/compiler.py", line 423, in frontend_looplift
flags=loop_flags)
File "/usr/local/lib/python3.7/site-packages/numba/transforms.py", line 191, in loop_lifting
cfg = compute_cfg_from_blocks(blocks)
File "/usr/local/lib/python3.7/site-packages/numba/analysis.py", line 243, in compute_cfg_from_blocks
cfg.add_edge(k, target)
File "/usr/local/lib/python3.7/site-packages/numba/controlflow.py", line 83, in add_edge
assert dest in self._nodes
AssertionError: Failed in object mode pipeline (step: object mode frontend)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (10 by maintainers)
I see. In the above
@jithas done the fallback to object mode and has gone down the route of trying to lift out a loop to compile and then there’s something in the code/transforms that’s hit a bug in control flow analysis, thatassertis an internal check that’s preventing nonsense from being compiled 😃 I’m thinking that this should be patched so that something more friendly is raised asking for a bug to be reported.Irrespective of all this, there’s evidently an issue in Numba and if you can provide a code sample that can be run so that we can debug it it would be most appreciated (you are welcome to obfuscate/change the source to be something very generic). Thanks!
Also, that your code is falling back to run in “object mode” suggests the performance won’t be very good. This explains what’s going on http://numba.pydata.org/numba-doc/latest/user/5minguide.html#what-is-nopython-mode, if you are not hugely familiar with Numba I’d recommend reading the 5 minute guide and perhaps taking a look at this tutorial.
@loretoparisi great, thanks! Do you have a reproducing piece of code/can you share the function that’s causing this problem? The issue is essentially that Numba’s control flow analysis can’t work out what’s going on and something illegal has happened as a result.
Right, well until Numba is upgraded to 0.46 I don’t think there’s much that can be done. Perhaps try and work out what’s constraining the version?
@saulshanabrook I’m using the latest available from
pip:Thanks for the report. Which version of Numba are you using?