after_merge
stringlengths
28
79.6k
before_merge
stringlengths
20
79.6k
url
stringlengths
38
71
full_traceback
stringlengths
43
922k
traceback_type
stringclasses
555 values
def generic(self, args, kws): """ Type the overloaded function by compiling the appropriate implementation for the given args. """ disp, new_args = self._get_impl(args, kws) if disp is None: return # Compile and type it for the given types disp_type = types.Dispatcher(disp) # Store the compiled overload for use in the lowering phase if there's # no inlining required (else functions are being compiled which will # never be used as they are inlined) if not self._inline.is_never_inline: # need to run the compiler front end up to type inference to compute # a signature from numba import compiler, typed_passes ir = compiler.run_frontend(disp_type.dispatcher.py_func) resolve = disp_type.dispatcher.get_call_template template, pysig, folded_args, kws = resolve(new_args, kws) typemap, return_type, calltypes = typed_passes.type_inference_stage( self.context, ir, folded_args, None ) sig = Signature(return_type, folded_args, None) # this stores a load of info for the cost model function if supplied # it by default is None self._inline_overloads[sig.args] = {"folded_args": folded_args} # this stores the compiled overloads, if there's no compiled # overload available i.e. function is always inlined, the key still # needs to exist for type resolution # NOTE: If lowering is failing on a `_EmptyImplementationEntry`, # the inliner has failed to inline this entry corretly. impl_init = _EmptyImplementationEntry("always inlined") self._compiled_overloads[sig.args] = impl_init if not self._inline.is_always_inline: # this branch is here because a user has supplied a function to # determine whether to inline or not. As a result both compiled # function and inliner info needed, delaying the computation of # this leads to an internal state mess at present. TODO: Fix! sig = disp_type.get_call_type(self.context, new_args, kws) self._compiled_overloads[sig.args] = disp_type.get_overload(sig) # store the inliner information, it's used later in the cost # model function call iinfo = _inline_info(ir, typemap, calltypes, sig) self._inline_overloads[sig.args] = { "folded_args": folded_args, "iinfo": iinfo, } else: sig = disp_type.get_call_type(self.context, new_args, kws) self._compiled_overloads[sig.args] = disp_type.get_overload(sig) return sig
def generic(self, args, kws): """ Type the overloaded function by compiling the appropriate implementation for the given args. """ disp, new_args = self._get_impl(args, kws) if disp is None: return # Compile and type it for the given types disp_type = types.Dispatcher(disp) # Store the compiled overload for use in the lowering phase if there's # no inlining required (else functions are being compiled which will # never be used as they are inlined) if not self._inline.is_never_inline: # need to run the compiler front end up to type inference to compute # a signature from numba import compiler, typed_passes ir = compiler.run_frontend(disp_type.dispatcher.py_func) resolve = disp_type.dispatcher.get_call_template template, pysig, folded_args, kws = resolve(new_args, kws) typemap, return_type, calltypes = typed_passes.type_inference_stage( self.context, ir, folded_args, None ) sig = Signature(return_type, folded_args, None) # this stores a load of info for the cost model function if supplied # it by default is None self._inline_overloads[sig.args] = {"folded_args": folded_args} # this stores the compiled overloads, if there's no compiled # overload available i.e. function is always inlined, the key still # needs to exist for type resolution self._compiled_overloads[sig.args] = None if not self._inline.is_always_inline: # this branch is here because a user has supplied a function to # determine whether to inline or not. As a result both compiled # function and inliner info needed, delaying the computation of # this leads to an internal state mess at present. TODO: Fix! sig = disp_type.get_call_type(self.context, new_args, kws) self._compiled_overloads[sig.args] = disp_type.get_overload(sig) # store the inliner information, it's used later in the cost # model function call iinfo = _inline_info(ir, typemap, calltypes, sig) self._inline_overloads[sig.args] = { "folded_args": folded_args, "iinfo": iinfo, } else: sig = disp_type.get_call_type(self.context, new_args, kws) self._compiled_overloads[sig.args] = disp_type.get_overload(sig) return sig
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def do_class_init(cls): """ Register attribute implementation. """ from numba.targets.imputils import lower_getattr attr = cls._attr @lower_getattr(cls.key, attr) def getattr_impl(context, builder, typ, value): typingctx = context.typing_context fnty = cls._get_function_type(typingctx, typ) sig = cls._get_signature(typingctx, fnty, (typ,), {}) call = context.get_function(fnty, sig) return call(builder, (value,))
def do_class_init(cls): """ Register attribute implementation. """ from numba.targets.imputils import lower_getattr attr = cls._attr @lower_getattr(cls.key, attr) def getattr_impl(context, builder, typ, value): sig_args = (typ,) sig_kws = {} typing_context = context.typing_context disp, sig_args = cls._get_dispatcher( typing_context, typ, attr, sig_args, sig_kws ) disp_type = types.Dispatcher(disp) sig = disp_type.get_call_type(typing_context, sig_args, sig_kws) call = context.get_function(disp_type, sig) return call(builder, (value,))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def getattr_impl(context, builder, typ, value): typingctx = context.typing_context fnty = cls._get_function_type(typingctx, typ) sig = cls._get_signature(typingctx, fnty, (typ,), {}) call = context.get_function(fnty, sig) return call(builder, (value,))
def getattr_impl(context, builder, typ, value): sig_args = (typ,) sig_kws = {} typing_context = context.typing_context disp, sig_args = cls._get_dispatcher(typing_context, typ, attr, sig_args, sig_kws) disp_type = types.Dispatcher(disp) sig = disp_type.get_call_type(typing_context, sig_args, sig_kws) call = context.get_function(disp_type, sig) return call(builder, (value,))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _resolve(self, typ, attr): if self._attr != attr: return None fnty = self._get_function_type(self.context, typ) sig = self._get_signature(self.context, fnty, (typ,), {}) # There should only be one template for template in fnty.templates: self._inline_overloads.update(template._inline_overloads) return sig.return_type
def _resolve(self, typ, attr): if self._attr != attr: return None sig = self._resolve_impl_sig(typ, attr, (typ,), {}) return sig.return_type
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def do_class_init(cls): """ Register generic method implementation. """ from numba.targets.imputils import lower_builtin attr = cls._attr @lower_builtin((cls.key, attr), cls.key, types.VarArg(types.Any)) def method_impl(context, builder, sig, args): typ = sig.args[0] typing_context = context.typing_context fnty = cls._get_function_type(typing_context, typ) sig = cls._get_signature(typing_context, fnty, sig.args, {}) call = context.get_function(fnty, sig) # Link dependent library context.add_linking_libs(getattr(call, "libs", ())) return call(builder, args)
def do_class_init(cls): """ Register generic method implementation. """ from numba.targets.imputils import lower_builtin attr = cls._attr @lower_builtin((cls.key, attr), cls.key, types.VarArg(types.Any)) def method_impl(context, builder, sig, args): typ = sig.args[0] typing_context = context.typing_context disp, sig_args = cls._get_dispatcher(typing_context, typ, attr, sig.args, {}) disp_type = types.Dispatcher(disp) sig = disp_type.get_call_type(typing_context, sig.args, {}) call = context.get_function(disp_type, sig) # Link dependent library context.add_linking_libs(getattr(call, "libs", ())) return call(builder, args)
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def method_impl(context, builder, sig, args): typ = sig.args[0] typing_context = context.typing_context fnty = cls._get_function_type(typing_context, typ) sig = cls._get_signature(typing_context, fnty, sig.args, {}) call = context.get_function(fnty, sig) # Link dependent library context.add_linking_libs(getattr(call, "libs", ())) return call(builder, args)
def method_impl(context, builder, sig, args): typ = sig.args[0] typing_context = context.typing_context disp, sig_args = cls._get_dispatcher(typing_context, typ, attr, sig.args, {}) disp_type = types.Dispatcher(disp) sig = disp_type.get_call_type(typing_context, sig.args, {}) call = context.get_function(disp_type, sig) # Link dependent library context.add_linking_libs(getattr(call, "libs", ())) return call(builder, args)
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _resolve(self, typ, attr): if self._attr != attr: return None assert isinstance(typ, self.key) class MethodTemplate(AbstractTemplate): key = (self.key, attr) _inline = self._inline _overload_func = staticmethod(self._overload_func) _inline_overloads = self._inline_overloads def generic(_, args, kws): args = (typ,) + tuple(args) fnty = self._get_function_type(self.context, typ) sig = self._get_signature(self.context, fnty, args, kws) sig = sig.replace(pysig=utils.pysignature(self._overload_func)) for template in fnty.templates: self._inline_overloads.update(template._inline_overloads) if sig is not None: return sig.as_method() return types.BoundFunction(MethodTemplate, typ)
def _resolve(self, typ, attr): if self._attr != attr: return None assert isinstance(typ, self.key) class MethodTemplate(AbstractTemplate): key = (self.key, attr) def generic(_, args, kws): args = (typ,) + tuple(args) sig = self._resolve_impl_sig(typ, attr, args, kws) if sig is not None: return sig.as_method() return types.BoundFunction(MethodTemplate, typ)
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def generic(_, args, kws): args = (typ,) + tuple(args) fnty = self._get_function_type(self.context, typ) sig = self._get_signature(self.context, fnty, args, kws) sig = sig.replace(pysig=utils.pysignature(self._overload_func)) for template in fnty.templates: self._inline_overloads.update(template._inline_overloads) if sig is not None: return sig.as_method()
def generic(_, args, kws): args = (typ,) + tuple(args) sig = self._resolve_impl_sig(typ, attr, args, kws) if sig is not None: return sig.as_method()
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def make_overload_attribute_template( typ, attr, overload_func, inline, base=_OverloadAttributeTemplate ): """ Make a template class for attribute *attr* of *typ* overloaded by *overload_func*. """ assert isinstance(typ, types.Type) or issubclass(typ, types.Type) name = "OverloadTemplate_%s_%s" % (typ, attr) # Note the implementation cache is subclass-specific dct = dict( key=typ, _attr=attr, _impl_cache={}, _inline=staticmethod(InlineOptions(inline)), _inline_overloads={}, _overload_func=staticmethod(overload_func), ) return type(base)(name, (base,), dct)
def make_overload_attribute_template( typ, attr, overload_func, base=_OverloadAttributeTemplate ): """ Make a template class for attribute *attr* of *typ* overloaded by *overload_func*. """ assert isinstance(typ, types.Type) or issubclass(typ, types.Type) name = "OverloadTemplate_%s_%s" % (typ, attr) # Note the implementation cache is subclass-specific dct = dict( key=typ, _attr=attr, _impl_cache={}, _overload_func=staticmethod(overload_func), ) return type(base)(name, (base,), dct)
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def make_overload_method_template(typ, attr, overload_func, inline): """ Make a template class for method *attr* of *typ* overloaded by *overload_func*. """ return make_overload_attribute_template( typ, attr, overload_func, inline=inline, base=_OverloadMethodTemplate, )
def make_overload_method_template(typ, attr, overload_func): """ Make a template class for method *attr* of *typ* overloaded by *overload_func*. """ return make_overload_attribute_template( typ, attr, overload_func, base=_OverloadMethodTemplate )
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_eq(a, b): accept = (types.UnicodeType, types.StringLiteral, types.UnicodeCharSeq) a_unicode = isinstance(a, accept) b_unicode = isinstance(b, accept) if a_unicode and b_unicode: def eq_impl(a, b): if len(a) != len(b): return False return _cmp_region(a, 0, b, 0, len(a)) == 0 return eq_impl elif a_unicode ^ b_unicode: # one of the things is unicode, everything compares False def eq_impl(a, b): return False return eq_impl
def unicode_eq(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def eq_impl(a, b): if len(a) != len(b): return False return _cmp_region(a, 0, b, 0, len(a)) == 0 return eq_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def eq_impl(a, b): return False
def eq_impl(a, b): if len(a) != len(b): return False return _cmp_region(a, 0, b, 0, len(a)) == 0
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_ne(a, b): accept = (types.UnicodeType, types.StringLiteral, types.UnicodeCharSeq) a_unicode = isinstance(a, accept) b_unicode = isinstance(b, accept) if a_unicode and b_unicode: def ne_impl(a, b): return not (a == b) return ne_impl elif a_unicode ^ b_unicode: # one of the things is unicode, everything compares True def eq_impl(a, b): return True return eq_impl
def unicode_ne(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def ne_impl(a, b): return not (a == b) return ne_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_lt(a, b): a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) if a_unicode and b_unicode: def lt_impl(a, b): minlen = min(len(a), len(b)) eqcode = _cmp_region(a, 0, b, 0, minlen) if eqcode == -1: return True elif eqcode == 0: return len(a) < len(b) return False return lt_impl
def unicode_lt(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def lt_impl(a, b): minlen = min(len(a), len(b)) eqcode = _cmp_region(a, 0, b, 0, minlen) if eqcode == -1: return True elif eqcode == 0: return len(a) < len(b) return False return lt_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_gt(a, b): a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) if a_unicode and b_unicode: def gt_impl(a, b): minlen = min(len(a), len(b)) eqcode = _cmp_region(a, 0, b, 0, minlen) if eqcode == 1: return True elif eqcode == 0: return len(a) > len(b) return False return gt_impl
def unicode_gt(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def gt_impl(a, b): minlen = min(len(a), len(b)) eqcode = _cmp_region(a, 0, b, 0, minlen) if eqcode == 1: return True elif eqcode == 0: return len(a) > len(b) return False return gt_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_le(a, b): a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) if a_unicode and b_unicode: def le_impl(a, b): return not (a > b) return le_impl
def unicode_le(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def le_impl(a, b): return not (a > b) return le_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_ge(a, b): a_unicode = isinstance(a, (types.UnicodeType, types.StringLiteral)) b_unicode = isinstance(b, (types.UnicodeType, types.StringLiteral)) if a_unicode and b_unicode: def ge_impl(a, b): return not (a < b) return ge_impl
def unicode_ge(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def ge_impl(a, b): return not (a < b) return ge_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_find(data, substr, start=None, end=None): """Implements str.find()""" if isinstance(substr, types.UnicodeCharSeq): def find_impl(data, substr, start=None, end=None): return data.find(str(substr)) return find_impl unicode_idx_check_type(start, "start") unicode_idx_check_type(end, "end") unicode_sub_check_type(substr, "substr") return _find
def unicode_find(data, substr, start=None, end=None): """Implements str.find()""" if isinstance(substr, types.UnicodeCharSeq): def find_impl(data, substr): return data.find(str(substr)) return find_impl unicode_idx_check_type(start, "start") unicode_idx_check_type(end, "end") unicode_sub_check_type(substr, "substr") return _find
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def find_impl(data, substr, start=None, end=None): return data.find(str(substr))
def find_impl(data, substr): return data.find(str(substr))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_rfind(data, substr, start=None, end=None): """Implements str.rfind()""" if isinstance(substr, types.UnicodeCharSeq): def rfind_impl(data, substr, start=None, end=None): return data.rfind(str(substr)) return rfind_impl unicode_idx_check_type(start, "start") unicode_idx_check_type(end, "end") unicode_sub_check_type(substr, "substr") return _rfind
def unicode_rfind(data, substr, start=None, end=None): """Implements str.rfind()""" if isinstance(substr, types.UnicodeCharSeq): def rfind_impl(data, substr): return data.rfind(str(substr)) return rfind_impl unicode_idx_check_type(start, "start") unicode_idx_check_type(end, "end") unicode_sub_check_type(substr, "substr") return _rfind
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def rfind_impl(data, substr, start=None, end=None): return data.rfind(str(substr))
def rfind_impl(data, substr): return data.rfind(str(substr))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_count(src, sub, start=None, end=None): _count_args_types_check(start) _count_args_types_check(end) if isinstance(sub, types.UnicodeType): def count_impl(src, sub, start=None, end=None): count = 0 src_len = len(src) sub_len = len(sub) start = _normalize_slice_idx_count(start, src_len, 0) end = _normalize_slice_idx_count(end, src_len, src_len) if end - start < 0 or start > src_len: return 0 src = src[start:end] src_len = len(src) start, end = 0, src_len if sub_len == 0: return src_len + 1 while start + sub_len <= src_len: if src[start : start + sub_len] == sub: count += 1 start += sub_len else: start += 1 return count return count_impl error_msg = "The substring must be a UnicodeType, not {}" raise TypingError(error_msg.format(type(sub)))
def unicode_count(src, sub, start=None, end=None): _count_args_types_check(start) _count_args_types_check(end) if isinstance(sub, types.UnicodeType): def count_impl(src, sub, start=start, end=end): count = 0 src_len = len(src) sub_len = len(sub) start = _normalize_slice_idx_count(start, src_len, 0) end = _normalize_slice_idx_count(end, src_len, src_len) if end - start < 0 or start > src_len: return 0 src = src[start:end] src_len = len(src) start, end = 0, src_len if sub_len == 0: return src_len + 1 while start + sub_len <= src_len: if src[start : start + sub_len] == sub: count += 1 start += sub_len else: start += 1 return count return count_impl error_msg = "The substring must be a UnicodeType, not {}" raise TypingError(error_msg.format(type(sub)))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def count_impl(src, sub, start=None, end=None): count = 0 src_len = len(src) sub_len = len(sub) start = _normalize_slice_idx_count(start, src_len, 0) end = _normalize_slice_idx_count(end, src_len, src_len) if end - start < 0 or start > src_len: return 0 src = src[start:end] src_len = len(src) start, end = 0, src_len if sub_len == 0: return src_len + 1 while start + sub_len <= src_len: if src[start : start + sub_len] == sub: count += 1 start += sub_len else: start += 1 return count
def count_impl(src, sub, start=start, end=end): count = 0 src_len = len(src) sub_len = len(sub) start = _normalize_slice_idx_count(start, src_len, 0) end = _normalize_slice_idx_count(end, src_len, src_len) if end - start < 0 or start > src_len: return 0 src = src[start:end] src_len = len(src) start, end = 0, src_len if sub_len == 0: return src_len + 1 while start + sub_len <= src_len: if src[start : start + sub_len] == sub: count += 1 start += sub_len else: start += 1 return count
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_split(a, sep=None, maxsplit=-1): if not ( maxsplit == -1 or isinstance(maxsplit, (types.Omitted, types.Integer, types.IntegerLiteral)) ): return None # fail typing if maxsplit is not an integer if isinstance(sep, types.UnicodeCharSeq): def split_impl(a, sep=None, maxsplit=-1): return a.split(str(sep), maxsplit=maxsplit) return split_impl if isinstance(sep, types.UnicodeType): def split_impl(a, sep=None, maxsplit=-1): a_len = len(a) sep_len = len(sep) if sep_len == 0: raise ValueError("empty separator") parts = [] last = 0 idx = 0 if sep_len == 1 and maxsplit == -1: sep_code_point = _get_code_point(sep, 0) for idx in range(a_len): if _get_code_point(a, idx) == sep_code_point: parts.append(a[last:idx]) last = idx + 1 else: split_count = 0 while idx < a_len and (maxsplit == -1 or split_count < maxsplit): if _cmp_region(a, idx, sep, 0, sep_len) == 0: parts.append(a[last:idx]) idx += sep_len last = idx split_count += 1 else: idx += 1 if last <= a_len: parts.append(a[last:]) return parts return split_impl elif ( sep is None or isinstance(sep, types.NoneType) or getattr(sep, "value", False) is None ): def split_whitespace_impl(a, sep=None, maxsplit=-1): a_len = len(a) parts = [] last = 0 idx = 0 split_count = 0 in_whitespace_block = True for idx in range(a_len): code_point = _get_code_point(a, idx) is_whitespace = _PyUnicode_IsSpace(code_point) if in_whitespace_block: if is_whitespace: pass # keep consuming space else: last = idx # this is the start of the next string in_whitespace_block = False else: if not is_whitespace: pass # keep searching for whitespace transition else: parts.append(a[last:idx]) in_whitespace_block = True split_count += 1 if maxsplit != -1 and split_count == maxsplit: break if last <= a_len and not in_whitespace_block: parts.append(a[last:]) return parts return split_whitespace_impl
def unicode_split(a, sep=None, maxsplit=-1): if not ( maxsplit == -1 or isinstance(maxsplit, (types.Omitted, types.Integer, types.IntegerLiteral)) ): return None # fail typing if maxsplit is not an integer if isinstance(sep, types.UnicodeCharSeq): def split_impl(a, sep, maxsplit=1): return a.split(str(sep), maxsplit=maxsplit) return split_impl if isinstance(sep, types.UnicodeType): def split_impl(a, sep, maxsplit=-1): a_len = len(a) sep_len = len(sep) if sep_len == 0: raise ValueError("empty separator") parts = [] last = 0 idx = 0 if sep_len == 1 and maxsplit == -1: sep_code_point = _get_code_point(sep, 0) for idx in range(a_len): if _get_code_point(a, idx) == sep_code_point: parts.append(a[last:idx]) last = idx + 1 else: split_count = 0 while idx < a_len and (maxsplit == -1 or split_count < maxsplit): if _cmp_region(a, idx, sep, 0, sep_len) == 0: parts.append(a[last:idx]) idx += sep_len last = idx split_count += 1 else: idx += 1 if last <= a_len: parts.append(a[last:]) return parts return split_impl elif ( sep is None or isinstance(sep, types.NoneType) or getattr(sep, "value", False) is None ): def split_whitespace_impl(a, sep=None, maxsplit=-1): a_len = len(a) parts = [] last = 0 idx = 0 split_count = 0 in_whitespace_block = True for idx in range(a_len): code_point = _get_code_point(a, idx) is_whitespace = _PyUnicode_IsSpace(code_point) if in_whitespace_block: if is_whitespace: pass # keep consuming space else: last = idx # this is the start of the next string in_whitespace_block = False else: if not is_whitespace: pass # keep searching for whitespace transition else: parts.append(a[last:idx]) in_whitespace_block = True split_count += 1 if maxsplit != -1 and split_count == maxsplit: break if last <= a_len and not in_whitespace_block: parts.append(a[last:]) return parts return split_whitespace_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def split_impl(a, sep=None, maxsplit=-1): a_len = len(a) sep_len = len(sep) if sep_len == 0: raise ValueError("empty separator") parts = [] last = 0 idx = 0 if sep_len == 1 and maxsplit == -1: sep_code_point = _get_code_point(sep, 0) for idx in range(a_len): if _get_code_point(a, idx) == sep_code_point: parts.append(a[last:idx]) last = idx + 1 else: split_count = 0 while idx < a_len and (maxsplit == -1 or split_count < maxsplit): if _cmp_region(a, idx, sep, 0, sep_len) == 0: parts.append(a[last:idx]) idx += sep_len last = idx split_count += 1 else: idx += 1 if last <= a_len: parts.append(a[last:]) return parts
def split_impl(a, sep, maxsplit=-1): a_len = len(a) sep_len = len(sep) if sep_len == 0: raise ValueError("empty separator") parts = [] last = 0 idx = 0 if sep_len == 1 and maxsplit == -1: sep_code_point = _get_code_point(sep, 0) for idx in range(a_len): if _get_code_point(a, idx) == sep_code_point: parts.append(a[last:idx]) last = idx + 1 else: split_count = 0 while idx < a_len and (maxsplit == -1 or split_count < maxsplit): if _cmp_region(a, idx, sep, 0, sep_len) == 0: parts.append(a[last:idx]) idx += sep_len last = idx split_count += 1 else: idx += 1 if last <= a_len: parts.append(a[last:]) return parts
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_center(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def center_impl(string, width, fillchar=" "): return string.center(width, str(fillchar)) return center_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def center_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string allmargin = width - str_len lmargin = (allmargin // 2) + (allmargin & width & 1) rmargin = allmargin - lmargin l_string = fillchar * lmargin if lmargin == rmargin: return l_string + string + l_string else: return l_string + string + (fillchar * rmargin) return center_impl
def unicode_center(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def center_impl(string, width, fillchar): return string.center(width, str(fillchar)) return center_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def center_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string allmargin = width - str_len lmargin = (allmargin // 2) + (allmargin & width & 1) rmargin = allmargin - lmargin l_string = fillchar * lmargin if lmargin == rmargin: return l_string + string + l_string else: return l_string + string + (fillchar * rmargin) return center_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def center_impl(string, width, fillchar=" "): return string.center(width, str(fillchar))
def center_impl(string, width, fillchar): return string.center(width, str(fillchar))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_ljust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def ljust_impl(string, width, fillchar=" "): return string.ljust(width, str(fillchar)) return ljust_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def ljust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = string + (fillchar * (width - str_len)) return newstr return ljust_impl
def unicode_ljust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def ljust_impl(string, width, fillchar): return string.ljust(width, str(fillchar)) return ljust_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def ljust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = string + (fillchar * (width - str_len)) return newstr return ljust_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def ljust_impl(string, width, fillchar=" "): return string.ljust(width, str(fillchar))
def ljust_impl(string, width, fillchar): return string.ljust(width, str(fillchar))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_rjust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def rjust_impl(string, width, fillchar=" "): return string.rjust(width, str(fillchar)) return rjust_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def rjust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = (fillchar * (width - str_len)) + string return newstr return rjust_impl
def unicode_rjust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def rjust_impl(string, width, fillchar): return string.rjust(width, str(fillchar)) return rjust_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def rjust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = (fillchar * (width - str_len)) + string return newstr return rjust_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def rjust_impl(string, width, fillchar=" "): return string.rjust(width, str(fillchar))
def rjust_impl(string, width, fillchar): return string.rjust(width, str(fillchar))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_lstrip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def lstrip_impl(string, chars=None): return string.lstrip(str(chars)) return lstrip_impl unicode_strip_types_check(chars) def lstrip_impl(string, chars=None): return string[unicode_strip_left_bound(string, chars) :] return lstrip_impl
def unicode_lstrip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def lstrip_impl(string, chars): return string.lstrip(str(chars)) return lstrip_impl unicode_strip_types_check(chars) def lstrip_impl(string, chars=None): return string[unicode_strip_left_bound(string, chars) :] return lstrip_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def lstrip_impl(string, chars=None): return string.lstrip(str(chars))
def lstrip_impl(string, chars): return string.lstrip(str(chars))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_rstrip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def rstrip_impl(string, chars=None): return string.rstrip(str(chars)) return rstrip_impl unicode_strip_types_check(chars) def rstrip_impl(string, chars=None): return string[: unicode_strip_right_bound(string, chars)] return rstrip_impl
def unicode_rstrip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def rstrip_impl(string, chars): return string.rstrip(str(chars)) return rstrip_impl unicode_strip_types_check(chars) def rstrip_impl(string, chars=None): return string[: unicode_strip_right_bound(string, chars)] return rstrip_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def rstrip_impl(string, chars=None): return string.rstrip(str(chars))
def rstrip_impl(string, chars): return string.rstrip(str(chars))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def unicode_strip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def strip_impl(string, chars=None): return string.strip(str(chars)) return strip_impl unicode_strip_types_check(chars) def strip_impl(string, chars=None): lb = unicode_strip_left_bound(string, chars) rb = unicode_strip_right_bound(string, chars) return string[lb:rb] return strip_impl
def unicode_strip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def strip_impl(string, chars): return string.strip(str(chars)) return strip_impl unicode_strip_types_check(chars) def strip_impl(string, chars=None): lb = unicode_strip_left_bound(string, chars) rb = unicode_strip_right_bound(string, chars) return string[lb:rb] return strip_impl
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def strip_impl(string, chars=None): return string.strip(str(chars))
def strip_impl(string, chars): return string.strip(str(chars))
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _PyUnicode_IsNumeric(ch): ctype = _PyUnicode_gettyperecord(ch) return ctype.flags & _PyUnicode_TyperecordMasks.NUMERIC_MASK != 0
def _PyUnicode_IsNumeric(ch): raise NotImplementedError
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _PyUnicode_IsPrintable(ch): ctype = _PyUnicode_gettyperecord(ch) return ctype.flags & _PyUnicode_TyperecordMasks.PRINTABLE_MASK != 0
def _PyUnicode_IsPrintable(ch): raise NotImplementedError
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _PyUnicode_IsAlpha(ch): ctype = _PyUnicode_gettyperecord(ch) return ctype.flags & _PyUnicode_TyperecordMasks.ALPHA_MASK != 0
def _PyUnicode_IsAlpha(ch): raise NotImplementedError
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def codegen(context, builder, signature, args): [src] = args return builder.ctlz(src, ir.Constant(ir.IntType(1), 0))
def codegen(cgctx, builder, typ, args): flt = args[0] return builder.bitcast(flt, bitcastty)
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def run_pass(self, state): """ This prunes dead branches, a dead branch is one which is derivable as not taken at compile time purely based on const/literal evaluation. """ assert state.func_ir msg = ( "Internal error in pre-inference dead branch pruning " "pass encountered during compilation of " 'function "%s"' % (state.func_id.func_name,) ) with fallback_context(state, msg): rewrite_semantic_constants(state.func_ir, state.args) return True
def run_pass(self, state): """ This prunes dead branches, a dead branch is one which is derivable as not taken at compile time purely based on const/literal evaluation. """ assert state.func_ir msg = ( "Internal error in pre-inference dead branch pruning " "pass encountered during compilation of " 'function "%s"' % (state.func_id.func_name,) ) with fallback_context(state, msg): rewrite_semantic_constants(state.func_ir, state.args) if config.DEBUG or config.DUMP_IR: print("branch_pruned_ir".center(80, "-")) print(state.func_ir.dump()) print("end branch_pruned_ir".center(80, "-")) return True
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def run_pass(self, state): """ This prunes dead branches, a dead branch is one which is derivable as not taken at compile time purely based on const/literal evaluation. """ # purely for demonstration purposes, obtain the analysis from a pass # declare as a required dependent semantic_const_analysis = self.get_analysis(type(self)) # noqa assert state.func_ir msg = ( "Internal error in pre-inference dead branch pruning " "pass encountered during compilation of " 'function "%s"' % (state.func_id.func_name,) ) with fallback_context(state, msg): dead_branch_prune(state.func_ir, state.args) return True
def run_pass(self, state): """ This prunes dead branches, a dead branch is one which is derivable as not taken at compile time purely based on const/literal evaluation. """ # purely for demonstration purposes, obtain the analysis from a pass # declare as a required dependent semantic_const_analysis = self.get_analysis(type(self)) # noqa assert state.func_ir msg = ( "Internal error in pre-inference dead branch pruning " "pass encountered during compilation of " 'function "%s"' % (state.func_id.func_name,) ) with fallback_context(state, msg): dead_branch_prune(state.func_ir, state.args) if config.DEBUG or config.DUMP_IR: print("branch_pruned_ir".center(80, "-")) print(state.func_ir.dump()) print("end branch_pruned_ir".center(80, "-")) return True
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def run_pass(self, state): """Run inlining of inlinables""" if self._DEBUG: print("before inline".center(80, "-")) print(state.func_ir.dump()) print("".center(80, "-")) modified = False # use a work list, look for call sites via `ir.Expr.op == call` and # then pass these to `self._do_work` to make decisions about inlining. work_list = list(state.func_ir.blocks.items()) while work_list: label, block = work_list.pop() for i, instr in enumerate(block.body): if isinstance(instr, ir.Assign): expr = instr.value if isinstance(expr, ir.Expr) and expr.op == "call": if guard(self._do_work, state, work_list, block, i, expr): modified = True break # because block structure changed if modified: # clean up unconditional branches that appear due to inlined # functions introducing blocks state.func_ir.blocks = simplify_CFG(state.func_ir.blocks) if self._DEBUG: print("after inline".center(80, "-")) print(state.func_ir.dump()) print("".center(80, "-")) return True
def run_pass(self, state): """Run inlining of inlinables""" if config.DEBUG or self._DEBUG: print("before inline".center(80, "-")) print(state.func_ir.dump()) print("".center(80, "-")) modified = False # use a work list, look for call sites via `ir.Expr.op == call` and # then pass these to `self._do_work` to make decisions about inlining. work_list = list(state.func_ir.blocks.items()) while work_list: label, block = work_list.pop() for i, instr in enumerate(block.body): if isinstance(instr, ir.Assign): expr = instr.value if isinstance(expr, ir.Expr) and expr.op == "call": if guard(self._do_work, state, work_list, block, i, expr): modified = True break # because block structure changed if modified: # clean up unconditional branches that appear due to inlined # functions introducing blocks state.func_ir.blocks = simplify_CFG(state.func_ir.blocks) if config.DEBUG or self._DEBUG: print("after inline".center(80, "-")) print(state.func_ir.dump()) print("".center(80, "-")) return True
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def run_pass(self, state): from numba import njit func_ir = state.func_ir mutated = False for idx, blk in func_ir.blocks.items(): for stmt in blk.body: if isinstance(stmt, ir.Assign): if isinstance(stmt.value, ir.Expr): if stmt.value.op == "make_function": node = stmt.value getdef = func_ir.get_definition kw_default = getdef(node.defaults) ok = False if kw_default is None or isinstance(kw_default, ir.Const): ok = True elif isinstance(kw_default, tuple): ok = all( [isinstance(getdef(x), ir.Const) for x in kw_default] ) elif isinstance(kw_default, ir.Expr): if kw_default.op != "build_tuple": continue ok = all( [ isinstance(getdef(x), ir.Const) for x in kw_default.items ] ) if not ok: print("NOT OK") continue pyfunc = convert_code_obj_to_function(node, func_ir) func = njit()(pyfunc) new_node = ir.Global(node.code.co_name, func, stmt.loc) stmt.value = new_node mutated |= True # if a change was made the del ordering is probably wrong, patch up if mutated: post_proc = postproc.PostProcessor(func_ir) post_proc.run() return mutated
def run_pass(self, state): from numba import njit func_ir = state.func_ir mutated = False for idx, blk in func_ir.blocks.items(): for stmt in blk.body: if isinstance(stmt, ir.Assign): if isinstance(stmt.value, ir.Expr): if stmt.value.op == "make_function": node = stmt.value getdef = func_ir.get_definition kw_default = getdef(node.defaults) ok = False if kw_default is None or isinstance(kw_default, ir.Const): ok = True elif isinstance(kw_default, tuple): ok = all( [isinstance(getdef(x), ir.Const) for x in kw_default] ) if not ok: continue pyfunc = convert_code_obj_to_function(node, func_ir) func = njit()(pyfunc) new_node = ir.Global(node.code.co_name, func, stmt.loc) stmt.value = new_node mutated |= True # if a change was made the del ordering is probably wrong, patch up if mutated: post_proc = postproc.PostProcessor(func_ir) post_proc.run() return mutated
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _get_var_parent(name): """Get parent of the variable given its name""" # If not a temporary variable if not name.startswith("$"): # Return the base component of the name return name.split( ".", )[0]
def _get_var_parent(name): """Get parent of the variable given its name""" # If not a temprary variable if not name.startswith("$"): # Return the base component of the name return name.split( ".", )[0]
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _build_impl(self, cache_key, args, kws): """Build and cache the implementation. Given the positional (`args`) and keyword arguments (`kws`), obtains the `overload` implementation and wrap it in a Dispatcher object. The expected argument types are returned for use by type-inference. The expected argument types are only different from the given argument types if there is an imprecise type in the given argument types. Parameters ---------- cache_key : hashable The key used for caching the implementation. args : Tuple[Type] Types of positional argument. kws : Dict[Type] Types of keyword argument. Returns ------- disp, args : On success, returns `(Dispatcher, Tuple[Type])`. On failure, returns `(None, None)`. """ from numba import jit def normalize_args(pyfunc, args, kws): pysig = utils.pysignature(pyfunc) ba = pysig.bind(*args, **kws) starargs = None for i, (k, parm) in enumerate(pysig.parameters.items()): if parm.kind == parm.VAR_POSITIONAL and k in ba.arguments: starargs = ba.arguments[k] del ba.arguments[k] new_args = ba.args if starargs is not None: if ( len(starargs) and isinstance(starargs[0], types.Tuple) and len(starargs[0]) == 0 ): # empty tuple means no starargs pass else: new_args += starargs new_kws = ba.kwargs return new_args, new_kws # args, kws = normalize_args(self._overload_func, args, kws) # Get the overload implementation for the given types ovf_result = self._overload_func(*args, **kws) if ovf_result is None: # No implementation => fail typing self._impl_cache[cache_key] = None, None return None, None elif isinstance(ovf_result, tuple): # The implementation returned a signature that the type-inferencer # should be using. sig, pyfunc = ovf_result args = sig.args cache_key = None # don't cache else: # Regular case pyfunc = ovf_result # Check type of pyfunc if not isinstance(pyfunc, FunctionType): msg = ( "Implementator function returned by `@overload` " "has an unexpected type. Got {}" ) raise AssertionError(msg.format(pyfunc)) # check that the typing and impl sigs match up if self._strict: self._validate_sigs(self._overload_func, pyfunc) # Make dispatcher jitdecor = jit(nopython=True, **self._jit_options) disp = jitdecor(pyfunc) if cache_key is not None: self._impl_cache[cache_key] = disp, args return disp, args
def _build_impl(self, cache_key, args, kws): """Build and cache the implementation. Given the positional (`args`) and keyword arguments (`kws`), obtains the `overload` implementation and wrap it in a Dispatcher object. The expected argument types are returned for use by type-inference. The expected argument types are only different from the given argument types if there is an imprecise type in the given argument types. Parameters ---------- cache_key : hashable The key used for caching the implementation. args : Tuple[Type] Types of positional argument. kws : Dict[Type] Types of keyword argument. Returns ------- disp, args : On success, returns `(Dispatcher, Tuple[Type])`. On failure, returns `(None, None)`. """ from numba import jit # Get the overload implementation for the given types ovf_result = self._overload_func(*args, **kws) if ovf_result is None: # No implementation => fail typing self._impl_cache[cache_key] = None, None return None, None elif isinstance(ovf_result, tuple): # The implementation returned a signature that the type-inferencer # should be using. sig, pyfunc = ovf_result args = sig.args cache_key = None # don't cache else: # Regular case pyfunc = ovf_result # Check type of pyfunc if not isinstance(pyfunc, FunctionType): msg = ( "Implementator function returned by `@overload` " "has an unexpected type. Got {}" ) raise AssertionError(msg.format(pyfunc)) # check that the typing and impl sigs match up if self._strict: self._validate_sigs(self._overload_func, pyfunc) # Make dispatcher jitdecor = jit(nopython=True, **self._jit_options) disp = jitdecor(pyfunc) if cache_key is not None: self._impl_cache[cache_key] = disp, args return disp, args
https://github.com/numba/numba/issues/4944
Traceback (most recent call last): File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 619, in __init__ typ = typ.elements[i] IndexError: tuple index out of range During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ibutygin/src/numba/numba/numba/errors.py", line 717, in new_error_context yield File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 303, in lower_inst val = self.lower_assign(ty, inst) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 467, in lower_assign return self.lower_expr(ty, value) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 932, in lower_expr res = self.lower_call(resty, expr) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 724, in lower_call res = self._lower_call_normal(fnty, expr, signature) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 903, in _lower_call_normal res = impl(self.builder, argvals, self.loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/typing/templates.py", line 778, in method_impl return call(builder, args) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/ibutygin/src/numba/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/targets/imputils.py", line 193, in imp builder, func, fndesc.restype, fndesc.argtypes, args) File "/home/ibutygin/src/numba/numba/numba/targets/callconv.py", line 477, in call_function args = list(arginfo.as_arguments(builder, args)) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in as_arguments for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/packer.py", line 100, in <listcomp> for dm, val in zip(self._dm_args, values) File "/home/ibutygin/src/numba/numba/numba/datamodel/models.py", line 447, in as_argument v = builder.extract_value(value, [i]) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/builder.py", line 927, in extract_value instr = instructions.ExtractValue(self.block, agg, idx, name=name) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/site-packages/llvmlite/ir/instructions.py", line 622, in __init__ % (list(indices), agg.type)) TypeError: Can't index at [0] in {} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "test.py", line 73, in <module> print(bar(Dummy())) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 420, in _compile_for_args raise e File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 353, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 768, in compile cres = self._compiler.compile(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 77, in compile status, retval = self._compile_cached(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 91, in _compile_cached retval = self._compile_core(args, return_type) File "/home/ibutygin/src/numba/numba/numba/dispatcher.py", line 109, in _compile_core pipeline_class=self.pipeline_class) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 543, in compile_extra return pipeline.compile_extra(func) File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 328, in compile_extra return self._compile_bytecode() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 389, in _compile_bytecode return self._compile_core() File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 368, in _compile_core raise e File "/home/ibutygin/src/numba/numba/numba/compiler.py", line 359, in _compile_core pm.run(self.state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 331, in run raise patched_exception File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 322, in run self._runPass(idx, pass_inst, state) File "/home/ibutygin/src/numba/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 281, in _runPass mutated |= check(pss.run_pass, internal_state) File "/home/ibutygin/src/numba/numba/numba/compiler_machinery.py", line 268, in check mangled = func(compiler_state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 391, in run_pass NativeLowering().run_pass(state) File "/home/ibutygin/src/numba/numba/numba/typed_passes.py", line 333, in run_pass lower.lower() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 179, in lower self.lower_normal_function(self.fndesc) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 220, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 245, in lower_function_body self.lower_block(block) File "/home/ibutygin/src/numba/numba/numba/lowering.py", line 260, in lower_block self.lower_inst(inst) File "/home/ibutygin/miniconda3/envs/NUMBA_CUSTOM/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/ibutygin/src/numba/numba/numba/errors.py", line 725, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/ibutygin/src/numba/numba/numba/six.py", line 669, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) Can't index at [0] in {} File "test.py", line 71: def bar(obj): return obj.inline_method(123,456) ^ [1] During: lowering "$10call_method.4 = call $4load_method.1($const6.2, $const8.3, func=$4load_method.1, args=[Var($const6.2, test.py:71), Var($const8.3, test.py:71)], kws=(), vararg=None)" at test.py (71)
IndexError
def _lower_parfor_parallel(lowerer, parfor): """Lowerer that handles LLVM code generation for parfor. This function lowers a parfor IR node to LLVM. The general approach is as follows: 1) The code from the parfor's init block is lowered normally in the context of the current function. 2) The body of the parfor is transformed into a gufunc function. 3) Code is inserted into the main function that calls do_scheduling to divide the iteration space for each thread, allocates reduction arrays, calls the gufunc function, and then invokes the reduction function across the reduction arrays to produce the final reduction values. """ from .parallel import get_thread_count ensure_parallel_support() typingctx = lowerer.context.typing_context targetctx = lowerer.context # We copy the typemap here because for race condition variable we'll # update their type to array so they can be updated by the gufunc. orig_typemap = lowerer.fndesc.typemap # replace original typemap with copy and restore the original at the end. lowerer.fndesc.typemap = copy.copy(orig_typemap) typemap = lowerer.fndesc.typemap varmap = lowerer.varmap if config.DEBUG_ARRAY_OPT: print("_lower_parfor_parallel") parfor.dump() loc = parfor.init_block.loc scope = parfor.init_block.scope # produce instructions for init_block if config.DEBUG_ARRAY_OPT: print("init_block = ", parfor.init_block, " ", type(parfor.init_block)) for instr in parfor.init_block.body: if config.DEBUG_ARRAY_OPT: print("lower init_block instr = ", instr) lowerer.lower_inst(instr) for racevar in parfor.races: if racevar not in varmap: rvtyp = typemap[racevar] rv = ir.Var(scope, racevar, loc) lowerer._alloca_var(rv.name, rvtyp) alias_map = {} arg_aliases = {} numba.parfor.find_potential_aliases_parfor( parfor, parfor.params, typemap, lowerer.func_ir, alias_map, arg_aliases ) if config.DEBUG_ARRAY_OPT: print("alias_map", alias_map) print("arg_aliases", arg_aliases) # run get_parfor_outputs() and get_parfor_reductions() before gufunc creation # since Jumps are modified so CFG of loop_body dict will become invalid assert parfor.params != None parfor_output_arrays = numba.parfor.get_parfor_outputs(parfor, parfor.params) parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( lowerer.func_ir, parfor, parfor.params, lowerer.fndesc.calltypes ) # init reduction array allocation here. nredvars = len(parfor_redvars) redarrs = {} if nredvars > 0: # reduction arrays outer dimension equal to thread count thread_count = get_thread_count() scope = parfor.init_block.scope loc = parfor.init_block.loc # For each reduction variable... for i in range(nredvars): redvar_typ = lowerer.fndesc.typemap[parfor_redvars[i]] redvar = ir.Var(scope, parfor_redvars[i], loc) redarrvar_typ = redtyp_to_redarraytype(redvar_typ) reddtype = redarrvar_typ.dtype if config.DEBUG_ARRAY_OPT: print( "redvar_typ", redvar_typ, redarrvar_typ, reddtype, types.DType(reddtype), ) # If this is reduction over an array, # the reduction array has just one added per-worker dimension. if isinstance(redvar_typ, types.npytypes.Array): redarrdim = redvar_typ.ndim + 1 else: redarrdim = 1 # Reduction array is created and initialized to the initial reduction value. # First create a var for the numpy empty ufunc. empty_func = ir.Var(scope, mk_unique_var("empty_func"), loc) ff_fnty = get_np_ufunc_typ(np.empty) ff_sig = typingctx.resolve_function_type( ff_fnty, (types.UniTuple(types.intp, redarrdim), types.DType(reddtype)), {}, ) typemap[empty_func.name] = ff_fnty empty_assign = ir.Assign( ir.Global("empty", np.empty, loc=loc), empty_func, loc ) lowerer.lower_inst(empty_assign) # Create var for outer dimension size of reduction array equal to number of threads. num_threads_var = ir.Var(scope, mk_unique_var("num_threads"), loc) num_threads_assign = ir.Assign( ir.Const(thread_count, loc), num_threads_var, loc ) typemap[num_threads_var.name] = types.intp lowerer.lower_inst(num_threads_assign) # Empty call takes tuple of sizes. Create here and fill in outer dimension (num threads). size_var = ir.Var(scope, mk_unique_var("tuple_size_var"), loc) typemap[size_var.name] = types.UniTuple(types.intp, redarrdim) size_var_list = [num_threads_var] # If this is a reduction over an array... if isinstance(redvar_typ, types.npytypes.Array): # Add code to get the shape of the array being reduced over. redshape_var = ir.Var(scope, mk_unique_var("redarr_shape"), loc) typemap[redshape_var.name] = types.UniTuple(types.intp, redvar_typ.ndim) redshape_getattr = ir.Expr.getattr(redvar, "shape", loc) redshape_assign = ir.Assign(redshape_getattr, redshape_var, loc) lowerer.lower_inst(redshape_assign) # Add the dimension sizes of the array being reduced over to the tuple of sizes pass to empty. for j in range(redvar_typ.ndim): onedimvar = ir.Var(scope, mk_unique_var("redshapeonedim"), loc) onedimgetitem = ir.Expr.static_getitem(redshape_var, j, None, loc) typemap[onedimvar.name] = types.intp onedimassign = ir.Assign(onedimgetitem, onedimvar, loc) lowerer.lower_inst(onedimassign) size_var_list += [onedimvar] size_call = ir.Expr.build_tuple(size_var_list, loc) size_assign = ir.Assign(size_call, size_var, loc) lowerer.lower_inst(size_assign) # Add call to empty passing the size var tuple. empty_call = ir.Expr.call(empty_func, [size_var], {}, loc=loc) redarr_var = ir.Var(scope, mk_unique_var("redarr"), loc) typemap[redarr_var.name] = redarrvar_typ empty_call_assign = ir.Assign(empty_call, redarr_var, loc) lowerer.fndesc.calltypes[empty_call] = ff_sig lowerer.lower_inst(empty_call_assign) # Remember mapping of original reduction array to the newly created per-worker reduction array. redarrs[redvar.name] = redarr_var init_val = parfor_reddict[parfor_redvars[i]][0] if init_val != None: if isinstance(redvar_typ, types.npytypes.Array): # Create an array of identity values for the reduction. # First, create a variable for np.full. full_func = ir.Var(scope, mk_unique_var("full_func"), loc) full_fnty = get_np_ufunc_typ(np.full) full_sig = typingctx.resolve_function_type( full_fnty, ( types.UniTuple(types.intp, redvar_typ.ndim), reddtype, types.DType(reddtype), ), {}, ) typemap[full_func.name] = full_fnty full_assign = ir.Assign( ir.Global("full", np.full, loc=loc), full_func, loc ) lowerer.lower_inst(full_assign) # Then create a var with the identify value. init_val_var = ir.Var(scope, mk_unique_var("init_val"), loc) init_val_assign = ir.Assign( ir.Const(init_val, loc), init_val_var, loc ) typemap[init_val_var.name] = reddtype lowerer.lower_inst(init_val_assign) # Then, call np.full with the shape of the reduction array and the identity value. full_call = ir.Expr.call( full_func, [redshape_var, init_val_var], {}, loc=loc ) lowerer.fndesc.calltypes[full_call] = full_sig redtoset = ir.Var(scope, mk_unique_var("redtoset"), loc) redtoset_assign = ir.Assign(full_call, redtoset, loc) typemap[redtoset.name] = redvar_typ lowerer.lower_inst(redtoset_assign) else: redtoset = ir.Var(scope, mk_unique_var("redtoset"), loc) redtoset_assign = ir.Assign(ir.Const(init_val, loc), redtoset, loc) typemap[redtoset.name] = reddtype lowerer.lower_inst(redtoset_assign) else: redtoset = redvar # For each thread, initialize the per-worker reduction array to the current reduction array value. for j in range(get_thread_count()): index_var = ir.Var(scope, mk_unique_var("index_var"), loc) index_var_assign = ir.Assign(ir.Const(j, loc), index_var, loc) typemap[index_var.name] = types.uintp lowerer.lower_inst(index_var_assign) redsetitem = ir.SetItem(redarr_var, index_var, redtoset, loc) lowerer.fndesc.calltypes[redsetitem] = signature( types.none, typemap[redarr_var.name], typemap[index_var.name], redvar_typ, ) lowerer.lower_inst(redsetitem) # compile parfor body as a separate function to be used with GUFuncWrapper flags = copy.copy(parfor.flags) flags.set("error_model", "numpy") # Can't get here unless flags.set('auto_parallel', ParallelOptions(True)) index_var_typ = typemap[parfor.loop_nests[0].index_variable.name] # index variables should have the same type, check rest of indices for l in parfor.loop_nests[1:]: assert typemap[l.index_variable.name] == index_var_typ numba.parfor.sequential_parfor_lowering = True func, func_args, func_sig, redargstartdim, func_arg_types = ( _create_gufunc_for_parfor_body( lowerer, parfor, typemap, typingctx, targetctx, flags, {}, bool(alias_map), index_var_typ, parfor.races, ) ) numba.parfor.sequential_parfor_lowering = False # get the shape signature func_args = ["sched"] + func_args num_reductions = len(parfor_redvars) num_inputs = len(func_args) - len(parfor_output_arrays) - num_reductions if config.DEBUG_ARRAY_OPT: print("func_args = ", func_args) print("num_inputs = ", num_inputs) print("parfor_outputs = ", parfor_output_arrays) print("parfor_redvars = ", parfor_redvars) print("num_reductions = ", num_reductions) gu_signature = _create_shape_signature( parfor.get_shape_classes, num_inputs, num_reductions, func_args, redargstartdim, func_sig, parfor.races, typemap, ) if config.DEBUG_ARRAY_OPT: print("gu_signature = ", gu_signature) # call the func in parallel by wrapping it with ParallelGUFuncBuilder loop_ranges = [(l.start, l.stop, l.step) for l in parfor.loop_nests] if config.DEBUG_ARRAY_OPT: print("loop_nests = ", parfor.loop_nests) print("loop_ranges = ", loop_ranges) call_parallel_gufunc( lowerer, func, gu_signature, func_sig, func_args, func_arg_types, loop_ranges, parfor_redvars, parfor_reddict, redarrs, parfor.init_block, index_var_typ, parfor.races, ) if config.DEBUG_ARRAY_OPT: sys.stdout.flush() if nredvars > 0: # Perform the final reduction across the reduction array created above. thread_count = get_thread_count() scope = parfor.init_block.scope loc = parfor.init_block.loc # For each reduction variable... for i in range(nredvars): name = parfor_redvars[i] redarr = redarrs[name] redvar_typ = lowerer.fndesc.typemap[name] if config.DEBUG_ARRAY_OPT_RUNTIME: res_print_str = "res_print" strconsttyp = types.StringLiteral(res_print_str) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=res_print_str, loc=loc), target=lhs, loc=loc ) typemap[lhs.name] = strconsttyp lowerer.lower_inst(assign_lhs) res_print = ir.Print(args=[lhs, redarr], vararg=None, loc=loc) lowerer.fndesc.calltypes[res_print] = signature( types.none, typemap[lhs.name], typemap[redarr.name] ) print("res_print", res_print) lowerer.lower_inst(res_print) # For each element in the reduction array created above. for j in range(get_thread_count()): # Create index var to access that element. index_var = ir.Var(scope, mk_unique_var("index_var"), loc) index_var_assign = ir.Assign(ir.Const(j, loc), index_var, loc) typemap[index_var.name] = types.uintp lowerer.lower_inst(index_var_assign) # Read that element from the array into oneelem. oneelem = ir.Var(scope, mk_unique_var("redelem"), loc) oneelemgetitem = ir.Expr.getitem(redarr, index_var, loc) typemap[oneelem.name] = redvar_typ lowerer.fndesc.calltypes[oneelemgetitem] = signature( redvar_typ, typemap[redarr.name], typemap[index_var.name] ) oneelemassign = ir.Assign(oneelemgetitem, oneelem, loc) lowerer.lower_inst(oneelemassign) init_var = ir.Var(scope, name + "#init", loc) init_assign = ir.Assign(oneelem, init_var, loc) if name + "#init" not in typemap: typemap[init_var.name] = redvar_typ lowerer.lower_inst(init_assign) if config.DEBUG_ARRAY_OPT_RUNTIME: res_print_str = "one_res_print" strconsttyp = types.StringLiteral(res_print_str) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=res_print_str, loc=loc), target=lhs, loc=loc, ) typemap[lhs.name] = strconsttyp lowerer.lower_inst(assign_lhs) res_print = ir.Print( args=[lhs, index_var, oneelem, init_var], vararg=None, loc=loc ) lowerer.fndesc.calltypes[res_print] = signature( types.none, typemap[lhs.name], typemap[index_var.name], typemap[oneelem.name], typemap[init_var.name], ) print("res_print", res_print) lowerer.lower_inst(res_print) # generate code for combining reduction variable with thread output for inst in parfor_reddict[name][1]: # If we have a case where a parfor body has an array reduction like A += B # and A and B have different data types then the reduction in the parallel # region will operate on those differeing types. However, here, after the # parallel region, we are summing across the reduction array and that is # guaranteed to have the same data type so we need to change the reduction # nodes so that the right-hand sides have a type equal to the reduction-type # and therefore the left-hand side. if isinstance(inst, ir.Assign): rhs = inst.value # We probably need to generalize this since it only does substitutions in # inplace_binops. if ( isinstance(rhs, ir.Expr) and rhs.op == "inplace_binop" and rhs.rhs.name == init_var.name ): if config.DEBUG_ARRAY_OPT: print("Adding call to reduction", rhs) if rhs.fn == operator.isub: rhs.fn = operator.iadd rhs.immutable_fn = operator.add if ( rhs.fn == operator.itruediv or rhs.fn == operator.ifloordiv ): rhs.fn = operator.imul rhs.immutable_fn = operator.mul if config.DEBUG_ARRAY_OPT: print("After changing sub to add or div to mul", rhs) # Get calltype of rhs. ct = lowerer.fndesc.calltypes[rhs] assert len(ct.args) == 2 # Create new arg types replace the second arg type with the reduction var type. ctargs = (ct.args[0], redvar_typ) # Update the signature of the call. ct = ct.replace(args=ctargs) # Remove so we can re-insert since calltypes is unique dict. lowerer.fndesc.calltypes.pop(rhs) # Add calltype back in for the expr with updated signature. lowerer.fndesc.calltypes[rhs] = ct lowerer.lower_inst(inst) # Cleanup reduction variable for v in redarrs.values(): lowerer.lower_inst(ir.Del(v.name, loc=loc)) # Restore the original typemap of the function that was replaced temporarily at the # Beginning of this function. lowerer.fndesc.typemap = orig_typemap
def _lower_parfor_parallel(lowerer, parfor): """Lowerer that handles LLVM code generation for parfor. This function lowers a parfor IR node to LLVM. The general approach is as follows: 1) The code from the parfor's init block is lowered normally in the context of the current function. 2) The body of the parfor is transformed into a gufunc function. 3) Code is inserted into the main function that calls do_scheduling to divide the iteration space for each thread, allocates reduction arrays, calls the gufunc function, and then invokes the reduction function across the reduction arrays to produce the final reduction values. """ from .parallel import get_thread_count ensure_parallel_support() typingctx = lowerer.context.typing_context targetctx = lowerer.context # We copy the typemap here because for race condition variable we'll # update their type to array so they can be updated by the gufunc. orig_typemap = lowerer.fndesc.typemap # replace original typemap with copy and restore the original at the end. lowerer.fndesc.typemap = copy.copy(orig_typemap) typemap = lowerer.fndesc.typemap varmap = lowerer.varmap if config.DEBUG_ARRAY_OPT: print("_lower_parfor_parallel") parfor.dump() loc = parfor.init_block.loc scope = parfor.init_block.scope # produce instructions for init_block if config.DEBUG_ARRAY_OPT: print("init_block = ", parfor.init_block, " ", type(parfor.init_block)) for instr in parfor.init_block.body: if config.DEBUG_ARRAY_OPT: print("lower init_block instr = ", instr) lowerer.lower_inst(instr) for racevar in parfor.races: if racevar not in varmap: rvtyp = typemap[racevar] rv = ir.Var(scope, racevar, loc) lowerer._alloca_var(rv.name, rvtyp) alias_map = {} arg_aliases = {} numba.parfor.find_potential_aliases_parfor( parfor, parfor.params, typemap, lowerer.func_ir, alias_map, arg_aliases ) if config.DEBUG_ARRAY_OPT: print("alias_map", alias_map) print("arg_aliases", arg_aliases) # run get_parfor_outputs() and get_parfor_reductions() before gufunc creation # since Jumps are modified so CFG of loop_body dict will become invalid assert parfor.params != None parfor_output_arrays = numba.parfor.get_parfor_outputs(parfor, parfor.params) parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( parfor, parfor.params, lowerer.fndesc.calltypes ) # init reduction array allocation here. nredvars = len(parfor_redvars) redarrs = {} if nredvars > 0: # reduction arrays outer dimension equal to thread count thread_count = get_thread_count() scope = parfor.init_block.scope loc = parfor.init_block.loc # For each reduction variable... for i in range(nredvars): redvar_typ = lowerer.fndesc.typemap[parfor_redvars[i]] redvar = ir.Var(scope, parfor_redvars[i], loc) redarrvar_typ = redtyp_to_redarraytype(redvar_typ) reddtype = redarrvar_typ.dtype if config.DEBUG_ARRAY_OPT: print( "redvar_typ", redvar_typ, redarrvar_typ, reddtype, types.DType(reddtype), ) # If this is reduction over an array, # the reduction array has just one added per-worker dimension. if isinstance(redvar_typ, types.npytypes.Array): redarrdim = redvar_typ.ndim + 1 else: redarrdim = 1 # Reduction array is created and initialized to the initial reduction value. # First create a var for the numpy empty ufunc. empty_func = ir.Var(scope, mk_unique_var("empty_func"), loc) ff_fnty = get_np_ufunc_typ(np.empty) ff_sig = typingctx.resolve_function_type( ff_fnty, (types.UniTuple(types.intp, redarrdim), types.DType(reddtype)), {}, ) typemap[empty_func.name] = ff_fnty empty_assign = ir.Assign( ir.Global("empty", np.empty, loc=loc), empty_func, loc ) lowerer.lower_inst(empty_assign) # Create var for outer dimension size of reduction array equal to number of threads. num_threads_var = ir.Var(scope, mk_unique_var("num_threads"), loc) num_threads_assign = ir.Assign( ir.Const(thread_count, loc), num_threads_var, loc ) typemap[num_threads_var.name] = types.intp lowerer.lower_inst(num_threads_assign) # Empty call takes tuple of sizes. Create here and fill in outer dimension (num threads). size_var = ir.Var(scope, mk_unique_var("tuple_size_var"), loc) typemap[size_var.name] = types.UniTuple(types.intp, redarrdim) size_var_list = [num_threads_var] # If this is a reduction over an array... if isinstance(redvar_typ, types.npytypes.Array): # Add code to get the shape of the array being reduced over. redshape_var = ir.Var(scope, mk_unique_var("redarr_shape"), loc) typemap[redshape_var.name] = types.UniTuple(types.intp, redvar_typ.ndim) redshape_getattr = ir.Expr.getattr(redvar, "shape", loc) redshape_assign = ir.Assign(redshape_getattr, redshape_var, loc) lowerer.lower_inst(redshape_assign) # Add the dimension sizes of the array being reduced over to the tuple of sizes pass to empty. for j in range(redvar_typ.ndim): onedimvar = ir.Var(scope, mk_unique_var("redshapeonedim"), loc) onedimgetitem = ir.Expr.static_getitem(redshape_var, j, None, loc) typemap[onedimvar.name] = types.intp onedimassign = ir.Assign(onedimgetitem, onedimvar, loc) lowerer.lower_inst(onedimassign) size_var_list += [onedimvar] size_call = ir.Expr.build_tuple(size_var_list, loc) size_assign = ir.Assign(size_call, size_var, loc) lowerer.lower_inst(size_assign) # Add call to empty passing the size var tuple. empty_call = ir.Expr.call(empty_func, [size_var], {}, loc=loc) redarr_var = ir.Var(scope, mk_unique_var("redarr"), loc) typemap[redarr_var.name] = redarrvar_typ empty_call_assign = ir.Assign(empty_call, redarr_var, loc) lowerer.fndesc.calltypes[empty_call] = ff_sig lowerer.lower_inst(empty_call_assign) # Remember mapping of original reduction array to the newly created per-worker reduction array. redarrs[redvar.name] = redarr_var init_val = parfor_reddict[parfor_redvars[i]][0] if init_val != None: if isinstance(redvar_typ, types.npytypes.Array): # Create an array of identity values for the reduction. # First, create a variable for np.full. full_func = ir.Var(scope, mk_unique_var("full_func"), loc) full_fnty = get_np_ufunc_typ(np.full) full_sig = typingctx.resolve_function_type( full_fnty, ( types.UniTuple(types.intp, redvar_typ.ndim), reddtype, types.DType(reddtype), ), {}, ) typemap[full_func.name] = full_fnty full_assign = ir.Assign( ir.Global("full", np.full, loc=loc), full_func, loc ) lowerer.lower_inst(full_assign) # Then create a var with the identify value. init_val_var = ir.Var(scope, mk_unique_var("init_val"), loc) init_val_assign = ir.Assign( ir.Const(init_val, loc), init_val_var, loc ) typemap[init_val_var.name] = reddtype lowerer.lower_inst(init_val_assign) # Then, call np.full with the shape of the reduction array and the identity value. full_call = ir.Expr.call( full_func, [redshape_var, init_val_var], {}, loc=loc ) lowerer.fndesc.calltypes[full_call] = full_sig redtoset = ir.Var(scope, mk_unique_var("redtoset"), loc) redtoset_assign = ir.Assign(full_call, redtoset, loc) typemap[redtoset.name] = redvar_typ lowerer.lower_inst(redtoset_assign) else: redtoset = ir.Var(scope, mk_unique_var("redtoset"), loc) redtoset_assign = ir.Assign(ir.Const(init_val, loc), redtoset, loc) typemap[redtoset.name] = reddtype lowerer.lower_inst(redtoset_assign) else: redtoset = redvar # For each thread, initialize the per-worker reduction array to the current reduction array value. for j in range(get_thread_count()): index_var = ir.Var(scope, mk_unique_var("index_var"), loc) index_var_assign = ir.Assign(ir.Const(j, loc), index_var, loc) typemap[index_var.name] = types.uintp lowerer.lower_inst(index_var_assign) redsetitem = ir.SetItem(redarr_var, index_var, redtoset, loc) lowerer.fndesc.calltypes[redsetitem] = signature( types.none, typemap[redarr_var.name], typemap[index_var.name], redvar_typ, ) lowerer.lower_inst(redsetitem) # compile parfor body as a separate function to be used with GUFuncWrapper flags = copy.copy(parfor.flags) flags.set("error_model", "numpy") # Can't get here unless flags.set('auto_parallel', ParallelOptions(True)) index_var_typ = typemap[parfor.loop_nests[0].index_variable.name] # index variables should have the same type, check rest of indices for l in parfor.loop_nests[1:]: assert typemap[l.index_variable.name] == index_var_typ numba.parfor.sequential_parfor_lowering = True func, func_args, func_sig, redargstartdim, func_arg_types = ( _create_gufunc_for_parfor_body( lowerer, parfor, typemap, typingctx, targetctx, flags, {}, bool(alias_map), index_var_typ, parfor.races, ) ) numba.parfor.sequential_parfor_lowering = False # get the shape signature func_args = ["sched"] + func_args num_reductions = len(parfor_redvars) num_inputs = len(func_args) - len(parfor_output_arrays) - num_reductions if config.DEBUG_ARRAY_OPT: print("func_args = ", func_args) print("num_inputs = ", num_inputs) print("parfor_outputs = ", parfor_output_arrays) print("parfor_redvars = ", parfor_redvars) print("num_reductions = ", num_reductions) gu_signature = _create_shape_signature( parfor.get_shape_classes, num_inputs, num_reductions, func_args, redargstartdim, func_sig, parfor.races, typemap, ) if config.DEBUG_ARRAY_OPT: print("gu_signature = ", gu_signature) # call the func in parallel by wrapping it with ParallelGUFuncBuilder loop_ranges = [(l.start, l.stop, l.step) for l in parfor.loop_nests] if config.DEBUG_ARRAY_OPT: print("loop_nests = ", parfor.loop_nests) print("loop_ranges = ", loop_ranges) call_parallel_gufunc( lowerer, func, gu_signature, func_sig, func_args, func_arg_types, loop_ranges, parfor_redvars, parfor_reddict, redarrs, parfor.init_block, index_var_typ, parfor.races, ) if config.DEBUG_ARRAY_OPT: sys.stdout.flush() if nredvars > 0: # Perform the final reduction across the reduction array created above. thread_count = get_thread_count() scope = parfor.init_block.scope loc = parfor.init_block.loc # For each reduction variable... for i in range(nredvars): name = parfor_redvars[i] redarr = redarrs[name] redvar_typ = lowerer.fndesc.typemap[name] if config.DEBUG_ARRAY_OPT_RUNTIME: res_print_str = "res_print" strconsttyp = types.StringLiteral(res_print_str) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=res_print_str, loc=loc), target=lhs, loc=loc ) typemap[lhs.name] = strconsttyp lowerer.lower_inst(assign_lhs) res_print = ir.Print(args=[lhs, redarr], vararg=None, loc=loc) lowerer.fndesc.calltypes[res_print] = signature( types.none, typemap[lhs.name], typemap[redarr.name] ) print("res_print", res_print) lowerer.lower_inst(res_print) # For each element in the reduction array created above. for j in range(get_thread_count()): # Create index var to access that element. index_var = ir.Var(scope, mk_unique_var("index_var"), loc) index_var_assign = ir.Assign(ir.Const(j, loc), index_var, loc) typemap[index_var.name] = types.uintp lowerer.lower_inst(index_var_assign) # Read that element from the array into oneelem. oneelem = ir.Var(scope, mk_unique_var("redelem"), loc) oneelemgetitem = ir.Expr.getitem(redarr, index_var, loc) typemap[oneelem.name] = redvar_typ lowerer.fndesc.calltypes[oneelemgetitem] = signature( redvar_typ, typemap[redarr.name], typemap[index_var.name] ) oneelemassign = ir.Assign(oneelemgetitem, oneelem, loc) lowerer.lower_inst(oneelemassign) init_var = ir.Var(scope, name + "#init", loc) init_assign = ir.Assign(oneelem, init_var, loc) if name + "#init" not in typemap: typemap[init_var.name] = redvar_typ lowerer.lower_inst(init_assign) if config.DEBUG_ARRAY_OPT_RUNTIME: res_print_str = "one_res_print" strconsttyp = types.StringLiteral(res_print_str) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=res_print_str, loc=loc), target=lhs, loc=loc, ) typemap[lhs.name] = strconsttyp lowerer.lower_inst(assign_lhs) res_print = ir.Print( args=[lhs, index_var, oneelem, init_var], vararg=None, loc=loc ) lowerer.fndesc.calltypes[res_print] = signature( types.none, typemap[lhs.name], typemap[index_var.name], typemap[oneelem.name], typemap[init_var.name], ) print("res_print", res_print) lowerer.lower_inst(res_print) # generate code for combining reduction variable with thread output for inst in parfor_reddict[name][1]: # If we have a case where a parfor body has an array reduction like A += B # and A and B have different data types then the reduction in the parallel # region will operate on those differeing types. However, here, after the # parallel region, we are summing across the reduction array and that is # guaranteed to have the same data type so we need to change the reduction # nodes so that the right-hand sides have a type equal to the reduction-type # and therefore the left-hand side. if isinstance(inst, ir.Assign): rhs = inst.value # We probably need to generalize this since it only does substitutions in # inplace_binops. if ( isinstance(rhs, ir.Expr) and rhs.op == "inplace_binop" and rhs.rhs.name == init_var.name ): if config.DEBUG_ARRAY_OPT: print("Adding call to reduction", rhs) if rhs.fn == operator.isub: rhs.fn = operator.iadd rhs.immutable_fn = operator.add if ( rhs.fn == operator.itruediv or rhs.fn == operator.ifloordiv ): rhs.fn = operator.imul rhs.immutable_fn = operator.mul if config.DEBUG_ARRAY_OPT: print("After changing sub to add or div to mul", rhs) # Get calltype of rhs. ct = lowerer.fndesc.calltypes[rhs] assert len(ct.args) == 2 # Create new arg types replace the second arg type with the reduction var type. ctargs = (ct.args[0], redvar_typ) # Update the signature of the call. ct = ct.replace(args=ctargs) # Remove so we can re-insert since calltypes is unique dict. lowerer.fndesc.calltypes.pop(rhs) # Add calltype back in for the expr with updated signature. lowerer.fndesc.calltypes[rhs] = ct lowerer.lower_inst(inst) # Cleanup reduction variable for v in redarrs.values(): lowerer.lower_inst(ir.Del(v.name, loc=loc)) # Restore the original typemap of the function that was replaced temporarily at the # Beginning of this function. lowerer.fndesc.typemap = orig_typemap
https://github.com/numba/numba/issues/4738
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 409 if isinstance(inst, _class): --> 410 func(self, inst) 411 return /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/npyufunc/parfor.py in _lower_parfor_parallel(lowerer, parfor) 97 parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( ---> 98 parfor, parfor.params, lowerer.fndesc.calltypes) 99 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_parfor_reductions(parfor, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param) 2968 param_nodes[param].reverse() -> 2969 reduce_nodes = get_reduce_nodes(param, param_nodes[param]) 2970 init_val = guard(get_reduction_init, reduce_nodes) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_reduce_nodes(name, nodes) 3017 non_red_args = [ x for (x, y) in args if y.name != name ] -> 3018 assert len(non_red_args) == 1 3019 args = [ (x, y) for (x, y) in args if x != y.name ] AssertionError: During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-79-3ff90f149e7e> in <module> 1 n_sims = 100 ----> 2 level_data_simulations = run_simulations(n_players, n_sims, t_levels, t_player, player, max_level) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) File "<ipython-input-78-9c8bcba8955a>", line 4: def run_simulations(n_p, n_s, t_lvl, t_plr, plr,mx_lvl): <source elided> # lvl_sims = np.empty(shape=(np.shape(lvl)[0], np.shape(lvl)[1], n_s)) for s in prange(n_s): ^ [1] During: lowering "id=0[LoopNest(index_variable = parfor_index.10, range = (0, n_s, 1))]{12: <ir.Block at <ipython-input-78-9c8bcba8955a> (4)>}Var(parfor_index.10, <ipython-input-78-9c8bcba8955a> (4))" at <ipython-input-78-9c8bcba8955a> (4) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba!
AssertionError
def _create_gufunc_for_parfor_body( lowerer, parfor, typemap, typingctx, targetctx, flags, locals, has_aliases, index_var_typ, races, ): """ Takes a parfor and creates a gufunc function for its body. There are two parts to this function. 1) Code to iterate across the iteration space as defined by the schedule. 2) The parfor body that does the work for a single point in the iteration space. Part 1 is created as Python text for simplicity with a sentinel assignment to mark the point in the IR where the parfor body should be added. This Python text is 'exec'ed into existence and its IR retrieved with run_frontend. The IR is scanned for the sentinel assignment where that basic block is split and the IR for the parfor body inserted. """ loc = parfor.init_block.loc # The parfor body and the main function body share ir.Var nodes. # We have to do some replacements of Var names in the parfor body to make them # legal parameter names. If we don't copy then the Vars in the main function also # would incorrectly change their name. loop_body = copy.copy(parfor.loop_body) remove_dels(loop_body) parfor_dim = len(parfor.loop_nests) loop_indices = [l.index_variable.name for l in parfor.loop_nests] # Get all the parfor params. parfor_params = parfor.params # Get just the outputs of the parfor. parfor_outputs = numba.parfor.get_parfor_outputs(parfor, parfor_params) # Get all parfor reduction vars, and operators. typemap = lowerer.fndesc.typemap parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( lowerer.func_ir, parfor, parfor_params, lowerer.fndesc.calltypes ) # Compute just the parfor inputs as a set difference. parfor_inputs = sorted( list(set(parfor_params) - set(parfor_outputs) - set(parfor_redvars)) ) races = races.difference(set(parfor_redvars)) for race in races: msg = ( "Variable %s used in parallel loop may be written " "to simultaneously by multiple workers and may result " "in non-deterministic or unintended results." % race ) warnings.warn(NumbaParallelSafetyWarning(msg, loc)) replace_var_with_array(races, loop_body, typemap, lowerer.fndesc.calltypes) if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("parfor_outputs = ", parfor_outputs, " ", type(parfor_outputs)) print("parfor_inputs = ", parfor_inputs, " ", type(parfor_inputs)) print("parfor_redvars = ", parfor_redvars, " ", type(parfor_redvars)) # Reduction variables are represented as arrays, so they go under # different names. parfor_redarrs = [] parfor_red_arg_types = [] for var in parfor_redvars: arr = var + "_arr" parfor_redarrs.append(arr) redarraytype = redtyp_to_redarraytype(typemap[var]) parfor_red_arg_types.append(redarraytype) redarrsig = redarraytype_to_sig(redarraytype) if arr in typemap: assert typemap[arr] == redarrsig else: typemap[arr] = redarrsig # Reorder all the params so that inputs go first then outputs. parfor_params = parfor_inputs + parfor_outputs + parfor_redarrs if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("loop_indices = ", loop_indices, " ", type(loop_indices)) print("loop_body = ", loop_body, " ", type(loop_body)) _print_body(loop_body) # Some Var are not legal parameter names so create a dict of potentially illegal # param name to guaranteed legal name. param_dict = legalize_names_with_typemap(parfor_params + parfor_redvars, typemap) if config.DEBUG_ARRAY_OPT >= 1: print("param_dict = ", sorted(param_dict.items()), " ", type(param_dict)) # Some loop_indices are not legal parameter names so create a dict of potentially illegal # loop index to guaranteed legal name. ind_dict = legalize_names_with_typemap(loop_indices, typemap) # Compute a new list of legal loop index names. legal_loop_indices = [ind_dict[v] for v in loop_indices] if config.DEBUG_ARRAY_OPT >= 1: print("ind_dict = ", sorted(ind_dict.items()), " ", type(ind_dict)) print( "legal_loop_indices = ", legal_loop_indices, " ", type(legal_loop_indices) ) for pd in parfor_params: print("pd = ", pd) print("pd type = ", typemap[pd], " ", type(typemap[pd])) # Get the types of each parameter. param_types = [to_scalar_from_0d(typemap[v]) for v in parfor_params] # Calculate types of args passed to gufunc. func_arg_types = [ typemap[v] for v in (parfor_inputs + parfor_outputs) ] + parfor_red_arg_types # Replace illegal parameter names in the loop body with legal ones. replace_var_names(loop_body, param_dict) # remember the name before legalizing as the actual arguments parfor_args = parfor_params # Change parfor_params to be legal names. parfor_params = [param_dict[v] for v in parfor_params] parfor_params_orig = parfor_params parfor_params = [] ascontig = False for pindex in range(len(parfor_params_orig)): if ( ascontig and pindex < len(parfor_inputs) and isinstance(param_types[pindex], types.npytypes.Array) ): parfor_params.append(parfor_params_orig[pindex] + "param") else: parfor_params.append(parfor_params_orig[pindex]) # Change parfor body to replace illegal loop index vars with legal ones. replace_var_names(loop_body, ind_dict) loop_body_var_table = get_name_var_table(loop_body) sentinel_name = get_unused_var_name("__sentinel__", loop_body_var_table) if config.DEBUG_ARRAY_OPT >= 1: print("legal parfor_params = ", parfor_params, " ", type(parfor_params)) # Determine the unique names of the scheduling and gufunc functions. # sched_func_name = "__numba_parfor_sched_%s" % (hex(hash(parfor)).replace("-", "_")) gufunc_name = "__numba_parfor_gufunc_%s" % (hex(hash(parfor)).replace("-", "_")) if config.DEBUG_ARRAY_OPT: # print("sched_func_name ", type(sched_func_name), " ", sched_func_name) print("gufunc_name ", type(gufunc_name), " ", gufunc_name) gufunc_txt = "" # Create the gufunc function. gufunc_txt += ( "def " + gufunc_name + "(sched, " + (", ".join(parfor_params)) + "):\n" ) for pindex in range(len(parfor_inputs)): if ascontig and isinstance(param_types[pindex], types.npytypes.Array): gufunc_txt += ( " " + parfor_params_orig[pindex] + " = np.ascontiguousarray(" + parfor_params[pindex] + ")\n" ) # Add initialization of reduction variables for arr, var in zip(parfor_redarrs, parfor_redvars): # If reduction variable is a scalar then save current value to # temp and accumulate on that temp to prevent false sharing. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[var] + "=" + param_dict[arr] + "[0]\n" else: # The reduction variable is an array so np.copy it to a temp. gufunc_txt += ( " " + param_dict[var] + "=np.copy(" + param_dict[arr] + ")\n" ) # For each dimension of the parfor, create a for loop in the generated gufunc function. # Iterate across the proper values extracted from the schedule. # The form of the schedule is start_dim0, start_dim1, ..., start_dimN, end_dim0, # end_dim1, ..., end_dimN for eachdim in range(parfor_dim): for indent in range(eachdim + 1): gufunc_txt += " " sched_dim = eachdim gufunc_txt += ( "for " + legal_loop_indices[eachdim] + " in range(sched[" + str(sched_dim) + "], sched[" + str(sched_dim + parfor_dim) + "] + np.uint8(1)):\n" ) if config.DEBUG_ARRAY_OPT_RUNTIME: for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += "print(" for eachdim in range(parfor_dim): gufunc_txt += ( '"' + legal_loop_indices[eachdim] + '",' + legal_loop_indices[eachdim] + "," ) gufunc_txt += ")\n" # Add the sentinel assignment so that we can find the loop body position # in the IR. for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += sentinel_name + " = 0\n" # Add assignments of reduction variables (for returning the value) redargstartdim = {} for arr, var in zip(parfor_redarrs, parfor_redvars): # After the gufunc loops, copy the accumulated temp value back to reduction array. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[arr] + "[0] = " + param_dict[var] + "\n" redargstartdim[arr] = 1 else: # After the gufunc loops, copy the accumulated temp array back to reduction array with ":" gufunc_txt += ( " " + param_dict[arr] + "[:] = " + param_dict[var] + "[:]\n" ) redargstartdim[arr] = 0 gufunc_txt += " return None\n" if config.DEBUG_ARRAY_OPT: print("gufunc_txt = ", type(gufunc_txt), "\n", gufunc_txt) # Force gufunc outline into existence. globls = {"np": np} locls = {} exec_(gufunc_txt, globls, locls) gufunc_func = locls[gufunc_name] if config.DEBUG_ARRAY_OPT: print("gufunc_func = ", type(gufunc_func), "\n", gufunc_func) # Get the IR for the gufunc outline. gufunc_ir = compiler.run_frontend(gufunc_func) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump ", type(gufunc_ir)) gufunc_ir.dump() print("loop_body dump ", type(loop_body)) _print_body(loop_body) # rename all variables in gufunc_ir afresh var_table = get_name_var_table(gufunc_ir.blocks) new_var_dict = {} reserved_names = [sentinel_name] + list(param_dict.values()) + legal_loop_indices for name, var in var_table.items(): if not (name in reserved_names): new_var_dict[name] = mk_unique_var(name) replace_var_names(gufunc_ir.blocks, new_var_dict) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump after renaming ") gufunc_ir.dump() gufunc_param_types = [ numba.types.npytypes.Array(index_var_typ, 1, "C") ] + param_types if config.DEBUG_ARRAY_OPT: print( "gufunc_param_types = ", type(gufunc_param_types), "\n", gufunc_param_types ) gufunc_stub_last_label = max(gufunc_ir.blocks.keys()) + 1 # Add gufunc stub last label to each parfor.loop_body label to prevent # label conflicts. loop_body = add_offset_to_labels(loop_body, gufunc_stub_last_label) # new label for splitting sentinel block new_label = max(loop_body.keys()) + 1 # If enabled, add a print statement after every assignment. if config.DEBUG_ARRAY_OPT_RUNTIME: for label, block in loop_body.items(): new_block = block.copy() new_block.clear() loc = block.loc scope = block.scope for inst in block.body: new_block.append(inst) # Append print after assignment if isinstance(inst, ir.Assign): # Only apply to numbers if typemap[inst.target.name] not in types.number_domain: continue # Make constant string strval = "{} =".format(inst.target.name) strconsttyp = types.StringLiteral(strval) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=strval, loc=loc), target=lhs, loc=loc ) typemap[lhs.name] = strconsttyp new_block.append(assign_lhs) # Make print node print_node = ir.Print(args=[lhs, inst.target], vararg=None, loc=loc) new_block.append(print_node) sig = numba.typing.signature( types.none, typemap[lhs.name], typemap[inst.target.name] ) lowerer.fndesc.calltypes[print_node] = sig loop_body[label] = new_block if config.DEBUG_ARRAY_OPT: print("parfor loop body") _print_body(loop_body) wrapped_blocks = wrap_loop_body(loop_body) hoisted, not_hoisted = hoist(parfor_params, loop_body, typemap, wrapped_blocks) start_block = gufunc_ir.blocks[min(gufunc_ir.blocks.keys())] start_block.body = start_block.body[:-1] + hoisted + [start_block.body[-1]] unwrap_loop_body(loop_body) # store hoisted into diagnostics diagnostics = lowerer.metadata["parfor_diagnostics"] diagnostics.hoist_info[parfor.id] = {"hoisted": hoisted, "not_hoisted": not_hoisted} if config.DEBUG_ARRAY_OPT: print("After hoisting") _print_body(loop_body) # Search all the block in the gufunc outline for the sentinel assignment. for label, block in gufunc_ir.blocks.items(): for i, inst in enumerate(block.body): if isinstance(inst, ir.Assign) and inst.target.name == sentinel_name: # We found the sentinel assignment. loc = inst.loc scope = block.scope # split block across __sentinel__ # A new block is allocated for the statements prior to the sentinel # but the new block maintains the current block label. prev_block = ir.Block(scope, loc) prev_block.body = block.body[:i] # The current block is used for statements after the sentinel. block.body = block.body[i + 1 :] # But the current block gets a new label. body_first_label = min(loop_body.keys()) # The previous block jumps to the minimum labelled block of the # parfor body. prev_block.append(ir.Jump(body_first_label, loc)) # Add all the parfor loop body blocks to the gufunc function's # IR. for l, b in loop_body.items(): gufunc_ir.blocks[l] = b body_last_label = max(loop_body.keys()) gufunc_ir.blocks[new_label] = block gufunc_ir.blocks[label] = prev_block # Add a jump from the last parfor body block to the block containing # statements after the sentinel. gufunc_ir.blocks[body_last_label].append(ir.Jump(new_label, loc)) break else: continue break if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump before renaming") gufunc_ir.dump() gufunc_ir.blocks = rename_labels(gufunc_ir.blocks) remove_dels(gufunc_ir.blocks) if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump") gufunc_ir.dump() print("flags", flags) print("typemap", typemap) old_alias = flags.noalias if not has_aliases: if config.DEBUG_ARRAY_OPT: print("No aliases found so adding noalias flag.") flags.noalias = True kernel_func = compiler.compile_ir( typingctx, targetctx, gufunc_ir, gufunc_param_types, types.none, flags, locals ) flags.noalias = old_alias kernel_sig = signature(types.none, *gufunc_param_types) if config.DEBUG_ARRAY_OPT: print("kernel_sig = ", kernel_sig) return kernel_func, parfor_args, kernel_sig, redargstartdim, func_arg_types
def _create_gufunc_for_parfor_body( lowerer, parfor, typemap, typingctx, targetctx, flags, locals, has_aliases, index_var_typ, races, ): """ Takes a parfor and creates a gufunc function for its body. There are two parts to this function. 1) Code to iterate across the iteration space as defined by the schedule. 2) The parfor body that does the work for a single point in the iteration space. Part 1 is created as Python text for simplicity with a sentinel assignment to mark the point in the IR where the parfor body should be added. This Python text is 'exec'ed into existence and its IR retrieved with run_frontend. The IR is scanned for the sentinel assignment where that basic block is split and the IR for the parfor body inserted. """ loc = parfor.init_block.loc # The parfor body and the main function body share ir.Var nodes. # We have to do some replacements of Var names in the parfor body to make them # legal parameter names. If we don't copy then the Vars in the main function also # would incorrectly change their name. loop_body = copy.copy(parfor.loop_body) remove_dels(loop_body) parfor_dim = len(parfor.loop_nests) loop_indices = [l.index_variable.name for l in parfor.loop_nests] # Get all the parfor params. parfor_params = parfor.params # Get just the outputs of the parfor. parfor_outputs = numba.parfor.get_parfor_outputs(parfor, parfor_params) # Get all parfor reduction vars, and operators. typemap = lowerer.fndesc.typemap parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( parfor, parfor_params, lowerer.fndesc.calltypes ) # Compute just the parfor inputs as a set difference. parfor_inputs = sorted( list(set(parfor_params) - set(parfor_outputs) - set(parfor_redvars)) ) races = races.difference(set(parfor_redvars)) for race in races: msg = ( "Variable %s used in parallel loop may be written " "to simultaneously by multiple workers and may result " "in non-deterministic or unintended results." % race ) warnings.warn(NumbaParallelSafetyWarning(msg, loc)) replace_var_with_array(races, loop_body, typemap, lowerer.fndesc.calltypes) if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("parfor_outputs = ", parfor_outputs, " ", type(parfor_outputs)) print("parfor_inputs = ", parfor_inputs, " ", type(parfor_inputs)) print("parfor_redvars = ", parfor_redvars, " ", type(parfor_redvars)) # Reduction variables are represented as arrays, so they go under # different names. parfor_redarrs = [] parfor_red_arg_types = [] for var in parfor_redvars: arr = var + "_arr" parfor_redarrs.append(arr) redarraytype = redtyp_to_redarraytype(typemap[var]) parfor_red_arg_types.append(redarraytype) redarrsig = redarraytype_to_sig(redarraytype) if arr in typemap: assert typemap[arr] == redarrsig else: typemap[arr] = redarrsig # Reorder all the params so that inputs go first then outputs. parfor_params = parfor_inputs + parfor_outputs + parfor_redarrs if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("loop_indices = ", loop_indices, " ", type(loop_indices)) print("loop_body = ", loop_body, " ", type(loop_body)) _print_body(loop_body) # Some Var are not legal parameter names so create a dict of potentially illegal # param name to guaranteed legal name. param_dict = legalize_names_with_typemap(parfor_params + parfor_redvars, typemap) if config.DEBUG_ARRAY_OPT >= 1: print("param_dict = ", sorted(param_dict.items()), " ", type(param_dict)) # Some loop_indices are not legal parameter names so create a dict of potentially illegal # loop index to guaranteed legal name. ind_dict = legalize_names_with_typemap(loop_indices, typemap) # Compute a new list of legal loop index names. legal_loop_indices = [ind_dict[v] for v in loop_indices] if config.DEBUG_ARRAY_OPT >= 1: print("ind_dict = ", sorted(ind_dict.items()), " ", type(ind_dict)) print( "legal_loop_indices = ", legal_loop_indices, " ", type(legal_loop_indices) ) for pd in parfor_params: print("pd = ", pd) print("pd type = ", typemap[pd], " ", type(typemap[pd])) # Get the types of each parameter. param_types = [to_scalar_from_0d(typemap[v]) for v in parfor_params] # Calculate types of args passed to gufunc. func_arg_types = [ typemap[v] for v in (parfor_inputs + parfor_outputs) ] + parfor_red_arg_types # Replace illegal parameter names in the loop body with legal ones. replace_var_names(loop_body, param_dict) # remember the name before legalizing as the actual arguments parfor_args = parfor_params # Change parfor_params to be legal names. parfor_params = [param_dict[v] for v in parfor_params] parfor_params_orig = parfor_params parfor_params = [] ascontig = False for pindex in range(len(parfor_params_orig)): if ( ascontig and pindex < len(parfor_inputs) and isinstance(param_types[pindex], types.npytypes.Array) ): parfor_params.append(parfor_params_orig[pindex] + "param") else: parfor_params.append(parfor_params_orig[pindex]) # Change parfor body to replace illegal loop index vars with legal ones. replace_var_names(loop_body, ind_dict) loop_body_var_table = get_name_var_table(loop_body) sentinel_name = get_unused_var_name("__sentinel__", loop_body_var_table) if config.DEBUG_ARRAY_OPT >= 1: print("legal parfor_params = ", parfor_params, " ", type(parfor_params)) # Determine the unique names of the scheduling and gufunc functions. # sched_func_name = "__numba_parfor_sched_%s" % (hex(hash(parfor)).replace("-", "_")) gufunc_name = "__numba_parfor_gufunc_%s" % (hex(hash(parfor)).replace("-", "_")) if config.DEBUG_ARRAY_OPT: # print("sched_func_name ", type(sched_func_name), " ", sched_func_name) print("gufunc_name ", type(gufunc_name), " ", gufunc_name) gufunc_txt = "" # Create the gufunc function. gufunc_txt += ( "def " + gufunc_name + "(sched, " + (", ".join(parfor_params)) + "):\n" ) for pindex in range(len(parfor_inputs)): if ascontig and isinstance(param_types[pindex], types.npytypes.Array): gufunc_txt += ( " " + parfor_params_orig[pindex] + " = np.ascontiguousarray(" + parfor_params[pindex] + ")\n" ) # Add initialization of reduction variables for arr, var in zip(parfor_redarrs, parfor_redvars): # If reduction variable is a scalar then save current value to # temp and accumulate on that temp to prevent false sharing. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[var] + "=" + param_dict[arr] + "[0]\n" else: # The reduction variable is an array so np.copy it to a temp. gufunc_txt += ( " " + param_dict[var] + "=np.copy(" + param_dict[arr] + ")\n" ) # For each dimension of the parfor, create a for loop in the generated gufunc function. # Iterate across the proper values extracted from the schedule. # The form of the schedule is start_dim0, start_dim1, ..., start_dimN, end_dim0, # end_dim1, ..., end_dimN for eachdim in range(parfor_dim): for indent in range(eachdim + 1): gufunc_txt += " " sched_dim = eachdim gufunc_txt += ( "for " + legal_loop_indices[eachdim] + " in range(sched[" + str(sched_dim) + "], sched[" + str(sched_dim + parfor_dim) + "] + np.uint8(1)):\n" ) if config.DEBUG_ARRAY_OPT_RUNTIME: for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += "print(" for eachdim in range(parfor_dim): gufunc_txt += ( '"' + legal_loop_indices[eachdim] + '",' + legal_loop_indices[eachdim] + "," ) gufunc_txt += ")\n" # Add the sentinel assignment so that we can find the loop body position # in the IR. for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += sentinel_name + " = 0\n" # Add assignments of reduction variables (for returning the value) redargstartdim = {} for arr, var in zip(parfor_redarrs, parfor_redvars): # After the gufunc loops, copy the accumulated temp value back to reduction array. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[arr] + "[0] = " + param_dict[var] + "\n" redargstartdim[arr] = 1 else: # After the gufunc loops, copy the accumulated temp array back to reduction array with ":" gufunc_txt += ( " " + param_dict[arr] + "[:] = " + param_dict[var] + "[:]\n" ) redargstartdim[arr] = 0 gufunc_txt += " return None\n" if config.DEBUG_ARRAY_OPT: print("gufunc_txt = ", type(gufunc_txt), "\n", gufunc_txt) # Force gufunc outline into existence. globls = {"np": np} locls = {} exec_(gufunc_txt, globls, locls) gufunc_func = locls[gufunc_name] if config.DEBUG_ARRAY_OPT: print("gufunc_func = ", type(gufunc_func), "\n", gufunc_func) # Get the IR for the gufunc outline. gufunc_ir = compiler.run_frontend(gufunc_func) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump ", type(gufunc_ir)) gufunc_ir.dump() print("loop_body dump ", type(loop_body)) _print_body(loop_body) # rename all variables in gufunc_ir afresh var_table = get_name_var_table(gufunc_ir.blocks) new_var_dict = {} reserved_names = [sentinel_name] + list(param_dict.values()) + legal_loop_indices for name, var in var_table.items(): if not (name in reserved_names): new_var_dict[name] = mk_unique_var(name) replace_var_names(gufunc_ir.blocks, new_var_dict) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump after renaming ") gufunc_ir.dump() gufunc_param_types = [ numba.types.npytypes.Array(index_var_typ, 1, "C") ] + param_types if config.DEBUG_ARRAY_OPT: print( "gufunc_param_types = ", type(gufunc_param_types), "\n", gufunc_param_types ) gufunc_stub_last_label = max(gufunc_ir.blocks.keys()) + 1 # Add gufunc stub last label to each parfor.loop_body label to prevent # label conflicts. loop_body = add_offset_to_labels(loop_body, gufunc_stub_last_label) # new label for splitting sentinel block new_label = max(loop_body.keys()) + 1 # If enabled, add a print statement after every assignment. if config.DEBUG_ARRAY_OPT_RUNTIME: for label, block in loop_body.items(): new_block = block.copy() new_block.clear() loc = block.loc scope = block.scope for inst in block.body: new_block.append(inst) # Append print after assignment if isinstance(inst, ir.Assign): # Only apply to numbers if typemap[inst.target.name] not in types.number_domain: continue # Make constant string strval = "{} =".format(inst.target.name) strconsttyp = types.StringLiteral(strval) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=strval, loc=loc), target=lhs, loc=loc ) typemap[lhs.name] = strconsttyp new_block.append(assign_lhs) # Make print node print_node = ir.Print(args=[lhs, inst.target], vararg=None, loc=loc) new_block.append(print_node) sig = numba.typing.signature( types.none, typemap[lhs.name], typemap[inst.target.name] ) lowerer.fndesc.calltypes[print_node] = sig loop_body[label] = new_block if config.DEBUG_ARRAY_OPT: print("parfor loop body") _print_body(loop_body) wrapped_blocks = wrap_loop_body(loop_body) hoisted, not_hoisted = hoist(parfor_params, loop_body, typemap, wrapped_blocks) start_block = gufunc_ir.blocks[min(gufunc_ir.blocks.keys())] start_block.body = start_block.body[:-1] + hoisted + [start_block.body[-1]] unwrap_loop_body(loop_body) # store hoisted into diagnostics diagnostics = lowerer.metadata["parfor_diagnostics"] diagnostics.hoist_info[parfor.id] = {"hoisted": hoisted, "not_hoisted": not_hoisted} if config.DEBUG_ARRAY_OPT: print("After hoisting") _print_body(loop_body) # Search all the block in the gufunc outline for the sentinel assignment. for label, block in gufunc_ir.blocks.items(): for i, inst in enumerate(block.body): if isinstance(inst, ir.Assign) and inst.target.name == sentinel_name: # We found the sentinel assignment. loc = inst.loc scope = block.scope # split block across __sentinel__ # A new block is allocated for the statements prior to the sentinel # but the new block maintains the current block label. prev_block = ir.Block(scope, loc) prev_block.body = block.body[:i] # The current block is used for statements after the sentinel. block.body = block.body[i + 1 :] # But the current block gets a new label. body_first_label = min(loop_body.keys()) # The previous block jumps to the minimum labelled block of the # parfor body. prev_block.append(ir.Jump(body_first_label, loc)) # Add all the parfor loop body blocks to the gufunc function's # IR. for l, b in loop_body.items(): gufunc_ir.blocks[l] = b body_last_label = max(loop_body.keys()) gufunc_ir.blocks[new_label] = block gufunc_ir.blocks[label] = prev_block # Add a jump from the last parfor body block to the block containing # statements after the sentinel. gufunc_ir.blocks[body_last_label].append(ir.Jump(new_label, loc)) break else: continue break if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump before renaming") gufunc_ir.dump() gufunc_ir.blocks = rename_labels(gufunc_ir.blocks) remove_dels(gufunc_ir.blocks) if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump") gufunc_ir.dump() print("flags", flags) print("typemap", typemap) old_alias = flags.noalias if not has_aliases: if config.DEBUG_ARRAY_OPT: print("No aliases found so adding noalias flag.") flags.noalias = True kernel_func = compiler.compile_ir( typingctx, targetctx, gufunc_ir, gufunc_param_types, types.none, flags, locals ) flags.noalias = old_alias kernel_sig = signature(types.none, *gufunc_param_types) if config.DEBUG_ARRAY_OPT: print("kernel_sig = ", kernel_sig) return kernel_func, parfor_args, kernel_sig, redargstartdim, func_arg_types
https://github.com/numba/numba/issues/4738
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 409 if isinstance(inst, _class): --> 410 func(self, inst) 411 return /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/npyufunc/parfor.py in _lower_parfor_parallel(lowerer, parfor) 97 parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( ---> 98 parfor, parfor.params, lowerer.fndesc.calltypes) 99 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_parfor_reductions(parfor, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param) 2968 param_nodes[param].reverse() -> 2969 reduce_nodes = get_reduce_nodes(param, param_nodes[param]) 2970 init_val = guard(get_reduction_init, reduce_nodes) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_reduce_nodes(name, nodes) 3017 non_red_args = [ x for (x, y) in args if y.name != name ] -> 3018 assert len(non_red_args) == 1 3019 args = [ (x, y) for (x, y) in args if x != y.name ] AssertionError: During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-79-3ff90f149e7e> in <module> 1 n_sims = 100 ----> 2 level_data_simulations = run_simulations(n_players, n_sims, t_levels, t_player, player, max_level) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) File "<ipython-input-78-9c8bcba8955a>", line 4: def run_simulations(n_p, n_s, t_lvl, t_plr, plr,mx_lvl): <source elided> # lvl_sims = np.empty(shape=(np.shape(lvl)[0], np.shape(lvl)[1], n_s)) for s in prange(n_s): ^ [1] During: lowering "id=0[LoopNest(index_variable = parfor_index.10, range = (0, n_s, 1))]{12: <ir.Block at <ipython-input-78-9c8bcba8955a> (4)>}Var(parfor_index.10, <ipython-input-78-9c8bcba8955a> (4))" at <ipython-input-78-9c8bcba8955a> (4) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba!
AssertionError
def run(self): """run parfor conversion pass: replace Numpy calls with Parfors when possible and optimize the IR.""" # run array analysis, a pre-requisite for parfor translation remove_dels(self.func_ir.blocks) self.array_analysis.run(self.func_ir.blocks) # run stencil translation to parfor if self.options.stencil: stencil_pass = StencilPass( self.func_ir, self.typemap, self.calltypes, self.array_analysis, self.typingctx, self.flags, ) stencil_pass.run() if self.options.setitem: self._convert_setitem(self.func_ir.blocks) if self.options.numpy: self._convert_numpy(self.func_ir.blocks) if self.options.reduction: self._convert_reduce(self.func_ir.blocks) if self.options.prange: self._convert_loop(self.func_ir.blocks) # setup diagnostics now parfors are found self.diagnostics.setup(self.func_ir, self.options.fusion) dprint_func_ir(self.func_ir, "after parfor pass") # simplify CFG of parfor body loops since nested parfors with extra # jumps can be created with prange conversion simplify_parfor_body_CFG(self.func_ir.blocks) # simplify before fusion simplify(self.func_ir, self.typemap, self.calltypes) # need two rounds of copy propagation to enable fusion of long sequences # of parfors like test_fuse_argmin (some PYTHONHASHSEED values since # apply_copies_parfor depends on set order for creating dummy assigns) simplify(self.func_ir, self.typemap, self.calltypes) if self.options.fusion: self.func_ir._definitions = build_definitions(self.func_ir.blocks) self.array_analysis.equiv_sets = dict() self.array_analysis.run(self.func_ir.blocks) # reorder statements to maximize fusion # push non-parfors down maximize_fusion( self.func_ir, self.func_ir.blocks, self.typemap, up_direction=False ) dprint_func_ir(self.func_ir, "after maximize fusion down") self.fuse_parfors(self.array_analysis, self.func_ir.blocks) # push non-parfors up maximize_fusion(self.func_ir, self.func_ir.blocks, self.typemap) dprint_func_ir(self.func_ir, "after maximize fusion up") # try fuse again after maximize self.fuse_parfors(self.array_analysis, self.func_ir.blocks) dprint_func_ir(self.func_ir, "after fusion") # simplify again simplify(self.func_ir, self.typemap, self.calltypes) # push function call variables inside parfors so gufunc function # wouldn't need function variables as argument push_call_vars(self.func_ir.blocks, {}, {}) # simplify again simplify(self.func_ir, self.typemap, self.calltypes) dprint_func_ir(self.func_ir, "after optimization") if config.DEBUG_ARRAY_OPT >= 1: print("variable types: ", sorted(self.typemap.items())) print("call types: ", self.calltypes) # run post processor again to generate Del nodes post_proc = postproc.PostProcessor(self.func_ir) post_proc.run() if self.func_ir.is_generator: fix_generator_types(self.func_ir.generator_info, self.return_type, self.typemap) if sequential_parfor_lowering: lower_parfor_sequential( self.typingctx, self.func_ir, self.typemap, self.calltypes ) else: # prepare for parallel lowering # add parfor params to parfors here since lowering is destructive # changing the IR after this is not allowed parfor_ids, parfors = get_parfor_params( self.func_ir.blocks, self.options.fusion, self.nested_fusion_info ) for p in parfors: numba.parfor.get_parfor_reductions( self.func_ir, p, p.params, self.calltypes ) if config.DEBUG_ARRAY_OPT_STATS: name = self.func_ir.func_id.func_qualname n_parfors = len(parfor_ids) if n_parfors > 0: after_fusion = ( "After fusion" if self.options.fusion else "With fusion disabled" ) print( ("{}, function {} has {} parallel for-loop(s) #{}.").format( after_fusion, name, n_parfors, parfor_ids ) ) else: print("Function {} has no Parfor.".format(name)) return
def run(self): """run parfor conversion pass: replace Numpy calls with Parfors when possible and optimize the IR.""" # run array analysis, a pre-requisite for parfor translation remove_dels(self.func_ir.blocks) self.array_analysis.run(self.func_ir.blocks) # run stencil translation to parfor if self.options.stencil: stencil_pass = StencilPass( self.func_ir, self.typemap, self.calltypes, self.array_analysis, self.typingctx, self.flags, ) stencil_pass.run() if self.options.setitem: self._convert_setitem(self.func_ir.blocks) if self.options.numpy: self._convert_numpy(self.func_ir.blocks) if self.options.reduction: self._convert_reduce(self.func_ir.blocks) if self.options.prange: self._convert_loop(self.func_ir.blocks) # setup diagnostics now parfors are found self.diagnostics.setup(self.func_ir, self.options.fusion) dprint_func_ir(self.func_ir, "after parfor pass") # simplify CFG of parfor body loops since nested parfors with extra # jumps can be created with prange conversion simplify_parfor_body_CFG(self.func_ir.blocks) # simplify before fusion simplify(self.func_ir, self.typemap, self.calltypes) # need two rounds of copy propagation to enable fusion of long sequences # of parfors like test_fuse_argmin (some PYTHONHASHSEED values since # apply_copies_parfor depends on set order for creating dummy assigns) simplify(self.func_ir, self.typemap, self.calltypes) if self.options.fusion: self.func_ir._definitions = build_definitions(self.func_ir.blocks) self.array_analysis.equiv_sets = dict() self.array_analysis.run(self.func_ir.blocks) # reorder statements to maximize fusion # push non-parfors down maximize_fusion( self.func_ir, self.func_ir.blocks, self.typemap, up_direction=False ) dprint_func_ir(self.func_ir, "after maximize fusion down") self.fuse_parfors(self.array_analysis, self.func_ir.blocks) # push non-parfors up maximize_fusion(self.func_ir, self.func_ir.blocks, self.typemap) dprint_func_ir(self.func_ir, "after maximize fusion up") # try fuse again after maximize self.fuse_parfors(self.array_analysis, self.func_ir.blocks) dprint_func_ir(self.func_ir, "after fusion") # simplify again simplify(self.func_ir, self.typemap, self.calltypes) # push function call variables inside parfors so gufunc function # wouldn't need function variables as argument push_call_vars(self.func_ir.blocks, {}, {}) # simplify again simplify(self.func_ir, self.typemap, self.calltypes) dprint_func_ir(self.func_ir, "after optimization") if config.DEBUG_ARRAY_OPT >= 1: print("variable types: ", sorted(self.typemap.items())) print("call types: ", self.calltypes) # run post processor again to generate Del nodes post_proc = postproc.PostProcessor(self.func_ir) post_proc.run() if self.func_ir.is_generator: fix_generator_types(self.func_ir.generator_info, self.return_type, self.typemap) if sequential_parfor_lowering: lower_parfor_sequential( self.typingctx, self.func_ir, self.typemap, self.calltypes ) else: # prepare for parallel lowering # add parfor params to parfors here since lowering is destructive # changing the IR after this is not allowed parfor_ids = get_parfor_params( self.func_ir.blocks, self.options.fusion, self.nested_fusion_info ) if config.DEBUG_ARRAY_OPT_STATS: name = self.func_ir.func_id.func_qualname n_parfors = len(parfor_ids) if n_parfors > 0: after_fusion = ( "After fusion" if self.options.fusion else "With fusion disabled" ) print( ("{}, function {} has {} parallel for-loop(s) #{}.").format( after_fusion, name, n_parfors, parfor_ids ) ) else: print("Function {} has no Parfor.".format(name)) return
https://github.com/numba/numba/issues/4738
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 409 if isinstance(inst, _class): --> 410 func(self, inst) 411 return /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/npyufunc/parfor.py in _lower_parfor_parallel(lowerer, parfor) 97 parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( ---> 98 parfor, parfor.params, lowerer.fndesc.calltypes) 99 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_parfor_reductions(parfor, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param) 2968 param_nodes[param].reverse() -> 2969 reduce_nodes = get_reduce_nodes(param, param_nodes[param]) 2970 init_val = guard(get_reduction_init, reduce_nodes) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_reduce_nodes(name, nodes) 3017 non_red_args = [ x for (x, y) in args if y.name != name ] -> 3018 assert len(non_red_args) == 1 3019 args = [ (x, y) for (x, y) in args if x != y.name ] AssertionError: During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-79-3ff90f149e7e> in <module> 1 n_sims = 100 ----> 2 level_data_simulations = run_simulations(n_players, n_sims, t_levels, t_player, player, max_level) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) File "<ipython-input-78-9c8bcba8955a>", line 4: def run_simulations(n_p, n_s, t_lvl, t_plr, plr,mx_lvl): <source elided> # lvl_sims = np.empty(shape=(np.shape(lvl)[0], np.shape(lvl)[1], n_s)) for s in prange(n_s): ^ [1] During: lowering "id=0[LoopNest(index_variable = parfor_index.10, range = (0, n_s, 1))]{12: <ir.Block at <ipython-input-78-9c8bcba8955a> (4)>}Var(parfor_index.10, <ipython-input-78-9c8bcba8955a> (4))" at <ipython-input-78-9c8bcba8955a> (4) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba!
AssertionError
def get_parfor_params(blocks, options_fusion, fusion_info): """find variables used in body of parfors from outside and save them. computed as live variables at entry of first block. """ # since parfor wrap creates a back-edge to first non-init basic block, # live_map[first_non_init_block] contains variables defined in parfor body # that could be undefined before. So we only consider variables that are # actually defined before the parfor body in the program. parfor_ids = set() parfors = [] pre_defs = set() _, all_defs = compute_use_defs(blocks) topo_order = find_topo_order(blocks) for label in topo_order: block = blocks[label] for i, parfor in _find_parfors(block.body): # find variable defs before the parfor in the same block dummy_block = ir.Block(block.scope, block.loc) dummy_block.body = block.body[:i] before_defs = compute_use_defs({0: dummy_block}).defmap[0] pre_defs |= before_defs parfor.params = ( get_parfor_params_inner(parfor, pre_defs, options_fusion, fusion_info) | parfor.races ) parfor_ids.add(parfor.id) parfors.append(parfor) pre_defs |= all_defs[label] return parfor_ids, parfors
def get_parfor_params(blocks, options_fusion, fusion_info): """find variables used in body of parfors from outside and save them. computed as live variables at entry of first block. """ # since parfor wrap creates a back-edge to first non-init basic block, # live_map[first_non_init_block] contains variables defined in parfor body # that could be undefined before. So we only consider variables that are # actually defined before the parfor body in the program. parfor_ids = set() pre_defs = set() _, all_defs = compute_use_defs(blocks) topo_order = find_topo_order(blocks) for label in topo_order: block = blocks[label] for i, parfor in _find_parfors(block.body): # find variable defs before the parfor in the same block dummy_block = ir.Block(block.scope, block.loc) dummy_block.body = block.body[:i] before_defs = compute_use_defs({0: dummy_block}).defmap[0] pre_defs |= before_defs parfor.params = ( get_parfor_params_inner(parfor, pre_defs, options_fusion, fusion_info) | parfor.races ) parfor_ids.add(parfor.id) pre_defs |= all_defs[label] return parfor_ids
https://github.com/numba/numba/issues/4738
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 409 if isinstance(inst, _class): --> 410 func(self, inst) 411 return /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/npyufunc/parfor.py in _lower_parfor_parallel(lowerer, parfor) 97 parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( ---> 98 parfor, parfor.params, lowerer.fndesc.calltypes) 99 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_parfor_reductions(parfor, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param) 2968 param_nodes[param].reverse() -> 2969 reduce_nodes = get_reduce_nodes(param, param_nodes[param]) 2970 init_val = guard(get_reduction_init, reduce_nodes) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_reduce_nodes(name, nodes) 3017 non_red_args = [ x for (x, y) in args if y.name != name ] -> 3018 assert len(non_red_args) == 1 3019 args = [ (x, y) for (x, y) in args if x != y.name ] AssertionError: During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-79-3ff90f149e7e> in <module> 1 n_sims = 100 ----> 2 level_data_simulations = run_simulations(n_players, n_sims, t_levels, t_player, player, max_level) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) File "<ipython-input-78-9c8bcba8955a>", line 4: def run_simulations(n_p, n_s, t_lvl, t_plr, plr,mx_lvl): <source elided> # lvl_sims = np.empty(shape=(np.shape(lvl)[0], np.shape(lvl)[1], n_s)) for s in prange(n_s): ^ [1] During: lowering "id=0[LoopNest(index_variable = parfor_index.10, range = (0, n_s, 1))]{12: <ir.Block at <ipython-input-78-9c8bcba8955a> (4)>}Var(parfor_index.10, <ipython-input-78-9c8bcba8955a> (4))" at <ipython-input-78-9c8bcba8955a> (4) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba!
AssertionError
def get_parfor_params_inner(parfor, pre_defs, options_fusion, fusion_info): blocks = wrap_parfor_blocks(parfor) cfg = compute_cfg_from_blocks(blocks) usedefs = compute_use_defs(blocks) live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap) parfor_ids, _ = get_parfor_params(blocks, options_fusion, fusion_info) n_parfors = len(parfor_ids) if n_parfors > 0: if config.DEBUG_ARRAY_OPT_STATS: after_fusion = "After fusion" if options_fusion else "With fusion disabled" print( ("{}, parallel for-loop {} has nested Parfor(s) #{}.").format( after_fusion, parfor.id, n_parfors, parfor_ids ) ) fusion_info[parfor.id] = list(parfor_ids) unwrap_parfor_blocks(parfor) keylist = sorted(live_map.keys()) init_block = keylist[0] first_non_init_block = keylist[1] before_defs = usedefs.defmap[init_block] | pre_defs params = live_map[first_non_init_block] & before_defs return params
def get_parfor_params_inner(parfor, pre_defs, options_fusion, fusion_info): blocks = wrap_parfor_blocks(parfor) cfg = compute_cfg_from_blocks(blocks) usedefs = compute_use_defs(blocks) live_map = compute_live_map(cfg, blocks, usedefs.usemap, usedefs.defmap) parfor_ids = get_parfor_params(blocks, options_fusion, fusion_info) n_parfors = len(parfor_ids) if n_parfors > 0: if config.DEBUG_ARRAY_OPT_STATS: after_fusion = "After fusion" if options_fusion else "With fusion disabled" print( ("{}, parallel for-loop {} has nested Parfor(s) #{}.").format( after_fusion, parfor.id, n_parfors, parfor_ids ) ) fusion_info[parfor.id] = list(parfor_ids) unwrap_parfor_blocks(parfor) keylist = sorted(live_map.keys()) init_block = keylist[0] first_non_init_block = keylist[1] before_defs = usedefs.defmap[init_block] | pre_defs params = live_map[first_non_init_block] & before_defs return params
https://github.com/numba/numba/issues/4738
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 409 if isinstance(inst, _class): --> 410 func(self, inst) 411 return /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/npyufunc/parfor.py in _lower_parfor_parallel(lowerer, parfor) 97 parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( ---> 98 parfor, parfor.params, lowerer.fndesc.calltypes) 99 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_parfor_reductions(parfor, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param) 2968 param_nodes[param].reverse() -> 2969 reduce_nodes = get_reduce_nodes(param, param_nodes[param]) 2970 init_val = guard(get_reduction_init, reduce_nodes) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_reduce_nodes(name, nodes) 3017 non_red_args = [ x for (x, y) in args if y.name != name ] -> 3018 assert len(non_red_args) == 1 3019 args = [ (x, y) for (x, y) in args if x != y.name ] AssertionError: During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-79-3ff90f149e7e> in <module> 1 n_sims = 100 ----> 2 level_data_simulations = run_simulations(n_players, n_sims, t_levels, t_player, player, max_level) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) File "<ipython-input-78-9c8bcba8955a>", line 4: def run_simulations(n_p, n_s, t_lvl, t_plr, plr,mx_lvl): <source elided> # lvl_sims = np.empty(shape=(np.shape(lvl)[0], np.shape(lvl)[1], n_s)) for s in prange(n_s): ^ [1] During: lowering "id=0[LoopNest(index_variable = parfor_index.10, range = (0, n_s, 1))]{12: <ir.Block at <ipython-input-78-9c8bcba8955a> (4)>}Var(parfor_index.10, <ipython-input-78-9c8bcba8955a> (4))" at <ipython-input-78-9c8bcba8955a> (4) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba!
AssertionError
def get_parfor_reductions( func_ir, parfor, parfor_params, calltypes, reductions=None, reduce_varnames=None, param_uses=None, param_nodes=None, var_to_param=None, ): """find variables that are updated using their previous values and an array item accessed with parfor index, e.g. s = s+A[i] """ if reductions is None: reductions = {} if reduce_varnames is None: reduce_varnames = [] # for each param variable, find what other variables are used to update it # also, keep the related nodes if param_uses is None: param_uses = defaultdict(list) if param_nodes is None: param_nodes = defaultdict(list) if var_to_param is None: var_to_param = {} blocks = wrap_parfor_blocks(parfor) topo_order = find_topo_order(blocks) topo_order = topo_order[1:] # ignore init block unwrap_parfor_blocks(parfor) for label in reversed(topo_order): for stmt in reversed(parfor.loop_body[label].body): if isinstance(stmt, ir.Assign) and ( stmt.target.name in parfor_params or stmt.target.name in var_to_param ): lhs = stmt.target.name rhs = stmt.value cur_param = lhs if lhs in parfor_params else var_to_param[lhs] used_vars = [] if isinstance(rhs, ir.Var): used_vars = [rhs.name] elif isinstance(rhs, ir.Expr): used_vars = [v.name for v in stmt.value.list_vars()] param_uses[cur_param].extend(used_vars) for v in used_vars: var_to_param[v] = cur_param # save copy of dependent stmt stmt_cp = copy.deepcopy(stmt) if stmt.value in calltypes: calltypes[stmt_cp.value] = calltypes[stmt.value] param_nodes[cur_param].append(stmt_cp) if isinstance(stmt, Parfor): # recursive parfors can have reductions like test_prange8 get_parfor_reductions( func_ir, stmt, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param, ) for param, used_vars in param_uses.items(): # a parameter is a reduction variable if its value is used to update it # check reduce_varnames since recursive parfors might have processed # param already if param in used_vars and param not in reduce_varnames: reduce_varnames.append(param) param_nodes[param].reverse() reduce_nodes = get_reduce_nodes(param, param_nodes[param], func_ir) gri_out = guard(get_reduction_init, reduce_nodes) if gri_out is not None: init_val, redop = gri_out else: init_val = None redop = None reductions[param] = (init_val, reduce_nodes, redop) return reduce_varnames, reductions
def get_parfor_reductions( parfor, parfor_params, calltypes, reductions=None, reduce_varnames=None, param_uses=None, param_nodes=None, var_to_param=None, ): """find variables that are updated using their previous values and an array item accessed with parfor index, e.g. s = s+A[i] """ if reductions is None: reductions = {} if reduce_varnames is None: reduce_varnames = [] # for each param variable, find what other variables are used to update it # also, keep the related nodes if param_uses is None: param_uses = defaultdict(list) if param_nodes is None: param_nodes = defaultdict(list) if var_to_param is None: var_to_param = {} blocks = wrap_parfor_blocks(parfor) topo_order = find_topo_order(blocks) topo_order = topo_order[1:] # ignore init block unwrap_parfor_blocks(parfor) for label in reversed(topo_order): for stmt in reversed(parfor.loop_body[label].body): if isinstance(stmt, ir.Assign) and ( stmt.target.name in parfor_params or stmt.target.name in var_to_param ): lhs = stmt.target.name rhs = stmt.value cur_param = lhs if lhs in parfor_params else var_to_param[lhs] used_vars = [] if isinstance(rhs, ir.Var): used_vars = [rhs.name] elif isinstance(rhs, ir.Expr): used_vars = [v.name for v in stmt.value.list_vars()] param_uses[cur_param].extend(used_vars) for v in used_vars: var_to_param[v] = cur_param # save copy of dependent stmt stmt_cp = copy.deepcopy(stmt) if stmt.value in calltypes: calltypes[stmt_cp.value] = calltypes[stmt.value] param_nodes[cur_param].append(stmt_cp) if isinstance(stmt, Parfor): # recursive parfors can have reductions like test_prange8 get_parfor_reductions( stmt, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param, ) for param, used_vars in param_uses.items(): # a parameter is a reduction variable if its value is used to update it # check reduce_varnames since recursive parfors might have processed # param already if param in used_vars and param not in reduce_varnames: reduce_varnames.append(param) param_nodes[param].reverse() reduce_nodes = get_reduce_nodes(param, param_nodes[param]) gri_out = guard(get_reduction_init, reduce_nodes) if gri_out is not None: init_val, redop = gri_out else: init_val = None redop = None reductions[param] = (init_val, reduce_nodes, redop) return reduce_varnames, reductions
https://github.com/numba/numba/issues/4738
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 409 if isinstance(inst, _class): --> 410 func(self, inst) 411 return /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/npyufunc/parfor.py in _lower_parfor_parallel(lowerer, parfor) 97 parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( ---> 98 parfor, parfor.params, lowerer.fndesc.calltypes) 99 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_parfor_reductions(parfor, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param) 2968 param_nodes[param].reverse() -> 2969 reduce_nodes = get_reduce_nodes(param, param_nodes[param]) 2970 init_val = guard(get_reduction_init, reduce_nodes) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_reduce_nodes(name, nodes) 3017 non_red_args = [ x for (x, y) in args if y.name != name ] -> 3018 assert len(non_red_args) == 1 3019 args = [ (x, y) for (x, y) in args if x != y.name ] AssertionError: During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-79-3ff90f149e7e> in <module> 1 n_sims = 100 ----> 2 level_data_simulations = run_simulations(n_players, n_sims, t_levels, t_player, player, max_level) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) File "<ipython-input-78-9c8bcba8955a>", line 4: def run_simulations(n_p, n_s, t_lvl, t_plr, plr,mx_lvl): <source elided> # lvl_sims = np.empty(shape=(np.shape(lvl)[0], np.shape(lvl)[1], n_s)) for s in prange(n_s): ^ [1] During: lowering "id=0[LoopNest(index_variable = parfor_index.10, range = (0, n_s, 1))]{12: <ir.Block at <ipython-input-78-9c8bcba8955a> (4)>}Var(parfor_index.10, <ipython-input-78-9c8bcba8955a> (4))" at <ipython-input-78-9c8bcba8955a> (4) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba!
AssertionError
def get_reduce_nodes(name, nodes, func_ir): """ Get nodes that combine the reduction variable with a sentinel variable. Recognizes the first node that combines the reduction variable with another variable. """ reduce_nodes = None defs = {} def lookup(var, varonly=True): val = defs.get(var.name, None) if isinstance(val, ir.Var): return lookup(val) else: return var if (varonly or val == None) else val for i, stmt in enumerate(nodes): lhs = stmt.target rhs = stmt.value defs[lhs.name] = rhs if isinstance(rhs, ir.Var) and rhs.name in defs: rhs = lookup(rhs) if isinstance(rhs, ir.Expr): in_vars = set(lookup(v, True).name for v in rhs.list_vars()) if name in in_vars: next_node = nodes[i + 1] if not ( isinstance(next_node, ir.Assign) and next_node.target.name == name ): raise ValueError( ( "Use of reduction variable " + name + " other than in a supported reduction" " function is not permitted." ) ) if not supported_reduction(rhs, func_ir): raise ValueError( ( "Use of reduction variable " + name + " in an unsupported reduction function." ) ) args = [(x.name, lookup(x, True)) for x in get_expr_args(rhs)] non_red_args = [x for (x, y) in args if y.name != name] assert len(non_red_args) == 1 args = [(x, y) for (x, y) in args if x != y.name] replace_dict = dict(args) replace_dict[non_red_args[0]] = ir.Var( lhs.scope, name + "#init", lhs.loc ) replace_vars_inner(rhs, replace_dict) reduce_nodes = nodes[i:] break assert reduce_nodes, "Invalid reduction format" return reduce_nodes
def get_reduce_nodes(name, nodes): """ Get nodes that combine the reduction variable with a sentinel variable. Recognizes the first node that combines the reduction variable with another variable. """ reduce_nodes = None defs = {} def lookup(var, varonly=True): val = defs.get(var.name, None) if isinstance(val, ir.Var): return lookup(val) else: return var if (varonly or val == None) else val for i, stmt in enumerate(nodes): lhs = stmt.target rhs = stmt.value defs[lhs.name] = rhs if isinstance(rhs, ir.Var) and rhs.name in defs: rhs = lookup(rhs) if isinstance(rhs, ir.Expr): in_vars = set(lookup(v, True).name for v in rhs.list_vars()) if name in in_vars: args = [(x.name, lookup(x, True)) for x in get_expr_args(rhs)] non_red_args = [x for (x, y) in args if y.name != name] assert len(non_red_args) == 1 args = [(x, y) for (x, y) in args if x != y.name] replace_dict = dict(args) replace_dict[non_red_args[0]] = ir.Var( lhs.scope, name + "#init", lhs.loc ) replace_vars_inner(rhs, replace_dict) reduce_nodes = nodes[i:] break assert reduce_nodes, "Invalid reduction format" return reduce_nodes
https://github.com/numba/numba/issues/4738
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 409 if isinstance(inst, _class): --> 410 func(self, inst) 411 return /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/npyufunc/parfor.py in _lower_parfor_parallel(lowerer, parfor) 97 parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( ---> 98 parfor, parfor.params, lowerer.fndesc.calltypes) 99 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_parfor_reductions(parfor, parfor_params, calltypes, reductions, reduce_varnames, param_uses, param_nodes, var_to_param) 2968 param_nodes[param].reverse() -> 2969 reduce_nodes = get_reduce_nodes(param, param_nodes[param]) 2970 init_val = guard(get_reduction_init, reduce_nodes) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/parfor.py in get_reduce_nodes(name, nodes) 3017 non_red_args = [ x for (x, y) in args if y.name != name ] -> 3018 assert len(non_red_args) == 1 3019 args = [ (x, y) for (x, y) in args if x != y.name ] AssertionError: During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-79-3ff90f149e7e> in <module> 1 n_sims = 100 ----> 2 level_data_simulations = run_simulations(n_players, n_sims, t_levels, t_player, player, max_level) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) File "<ipython-input-78-9c8bcba8955a>", line 4: def run_simulations(n_p, n_s, t_lvl, t_plr, plr,mx_lvl): <source elided> # lvl_sims = np.empty(shape=(np.shape(lvl)[0], np.shape(lvl)[1], n_s)) for s in prange(n_s): ^ [1] During: lowering "id=0[LoopNest(index_variable = parfor_index.10, range = (0, n_s, 1))]{12: <ir.Block at <ipython-input-78-9c8bcba8955a> (4)>}Var(parfor_index.10, <ipython-input-78-9c8bcba8955a> (4))" at <ipython-input-78-9c8bcba8955a> (4) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba!
AssertionError
def _get_names(self, obj): """Return a set of names for the given obj, where array and tuples are broken down to their individual shapes or elements. This is safe because both Numba array shapes and Python tuples are immutable. """ if isinstance(obj, ir.Var) or isinstance(obj, str): name = obj if isinstance(obj, str) else obj.name typ = self.typemap[name] if isinstance(typ, types.BaseTuple) or isinstance(typ, types.ArrayCompatible): ndim = typ.ndim if isinstance(typ, types.ArrayCompatible) else len(typ) # Treat 0d array as if it were a scalar. if ndim == 0: return (name,) else: return tuple("{}#{}".format(name, i) for i in range(ndim)) else: return (name,) elif isinstance(obj, ir.Const): if isinstance(obj.value, tuple): return obj.value else: return (obj.value,) elif isinstance(obj, tuple): return tuple(self._get_names(x)[0] for x in obj) elif isinstance(obj, int): return (obj,) else: raise NotImplementedError("ShapeEquivSet does not support {}".format(obj))
def _get_names(self, obj): """Return a set of names for the given obj, where array and tuples are broken down to their individual shapes or elements. This is safe because both Numba array shapes and Python tuples are immutable. """ if isinstance(obj, ir.Var) or isinstance(obj, str): name = obj if isinstance(obj, str) else obj.name typ = self.typemap[name] if isinstance(typ, types.BaseTuple) or isinstance(typ, types.ArrayCompatible): ndim = typ.ndim if isinstance(typ, types.ArrayCompatible) else len(typ) if ndim == 0: return () else: return tuple("{}#{}".format(name, i) for i in range(ndim)) else: return (name,) elif isinstance(obj, ir.Const): if isinstance(obj.value, tuple): return obj.value else: return (obj.value,) elif isinstance(obj, tuple): return tuple(self._get_names(x)[0] for x in obj) elif isinstance(obj, int): return (obj,) else: raise NotImplementedError("ShapeEquivSet does not support {}".format(obj))
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def get_shape_classes(self, name): """Instead of the shape tuple, return tuple of int, where each int is the corresponding class index of the size object. Unknown shapes are given class index -1. Return empty tuple if the input name is a scalar variable. """ if isinstance(name, ir.Var): name = name.name typ = self.typemap[name] if name in self.typemap else None if not ( isinstance(typ, types.BaseTuple) or isinstance(typ, types.SliceType) or isinstance(typ, types.ArrayCompatible) ): return [] # Treat 0d arrays like scalars. if isinstance(typ, types.ArrayCompatible) and typ.ndim == 0: return [] names = self._get_names(name) inds = tuple(self._get_ind(name) for name in names) return inds
def get_shape_classes(self, name): """Instead of the shape tuple, return tuple of int, where each int is the corresponding class index of the size object. Unknown shapes are given class index -1. Return empty tuple if the input name is a scalar variable. """ if isinstance(name, ir.Var): name = name.name typ = self.typemap[name] if name in self.typemap else None if not ( isinstance(typ, types.BaseTuple) or isinstance(typ, types.SliceType) or isinstance(typ, types.ArrayCompatible) ): return [] names = self._get_names(name) inds = tuple(self._get_ind(name) for name in names) return inds
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def _create_gufunc_for_parfor_body( lowerer, parfor, typemap, typingctx, targetctx, flags, locals, has_aliases, index_var_typ, races, ): """ Takes a parfor and creates a gufunc function for its body. There are two parts to this function. 1) Code to iterate across the iteration space as defined by the schedule. 2) The parfor body that does the work for a single point in the iteration space. Part 1 is created as Python text for simplicity with a sentinel assignment to mark the point in the IR where the parfor body should be added. This Python text is 'exec'ed into existence and its IR retrieved with run_frontend. The IR is scanned for the sentinel assignment where that basic block is split and the IR for the parfor body inserted. """ loc = parfor.init_block.loc # The parfor body and the main function body share ir.Var nodes. # We have to do some replacements of Var names in the parfor body to make them # legal parameter names. If we don't copy then the Vars in the main function also # would incorrectly change their name. loop_body = copy.copy(parfor.loop_body) remove_dels(loop_body) parfor_dim = len(parfor.loop_nests) loop_indices = [l.index_variable.name for l in parfor.loop_nests] # Get all the parfor params. parfor_params = parfor.params # Get just the outputs of the parfor. parfor_outputs = numba.parfor.get_parfor_outputs(parfor, parfor_params) # Get all parfor reduction vars, and operators. typemap = lowerer.fndesc.typemap parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( parfor, parfor_params, lowerer.fndesc.calltypes ) # Compute just the parfor inputs as a set difference. parfor_inputs = sorted( list(set(parfor_params) - set(parfor_outputs) - set(parfor_redvars)) ) races = races.difference(set(parfor_redvars)) for race in races: msg = ( "Variable %s used in parallel loop may be written " "to simultaneously by multiple workers and may result " "in non-deterministic or unintended results." % race ) warnings.warn(NumbaParallelSafetyWarning(msg, loc)) replace_var_with_array(races, loop_body, typemap, lowerer.fndesc.calltypes) if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("parfor_outputs = ", parfor_outputs, " ", type(parfor_outputs)) print("parfor_inputs = ", parfor_inputs, " ", type(parfor_inputs)) print("parfor_redvars = ", parfor_redvars, " ", type(parfor_redvars)) # Reduction variables are represented as arrays, so they go under # different names. parfor_redarrs = [] parfor_red_arg_types = [] for var in parfor_redvars: arr = var + "_arr" parfor_redarrs.append(arr) redarraytype = redtyp_to_redarraytype(typemap[var]) parfor_red_arg_types.append(redarraytype) redarrsig = redarraytype_to_sig(redarraytype) if arr in typemap: assert typemap[arr] == redarrsig else: typemap[arr] = redarrsig # Reorder all the params so that inputs go first then outputs. parfor_params = parfor_inputs + parfor_outputs + parfor_redarrs if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("loop_indices = ", loop_indices, " ", type(loop_indices)) print("loop_body = ", loop_body, " ", type(loop_body)) _print_body(loop_body) # Some Var are not legal parameter names so create a dict of potentially illegal # param name to guaranteed legal name. param_dict = legalize_names_with_typemap(parfor_params + parfor_redvars, typemap) if config.DEBUG_ARRAY_OPT >= 1: print("param_dict = ", sorted(param_dict.items()), " ", type(param_dict)) # Some loop_indices are not legal parameter names so create a dict of potentially illegal # loop index to guaranteed legal name. ind_dict = legalize_names_with_typemap(loop_indices, typemap) # Compute a new list of legal loop index names. legal_loop_indices = [ind_dict[v] for v in loop_indices] if config.DEBUG_ARRAY_OPT >= 1: print("ind_dict = ", sorted(ind_dict.items()), " ", type(ind_dict)) print( "legal_loop_indices = ", legal_loop_indices, " ", type(legal_loop_indices) ) for pd in parfor_params: print("pd = ", pd) print("pd type = ", typemap[pd], " ", type(typemap[pd])) # Get the types of each parameter. param_types = [to_scalar_from_0d(typemap[v]) for v in parfor_params] # Calculate types of args passed to gufunc. func_arg_types = [ typemap[v] for v in (parfor_inputs + parfor_outputs) ] + parfor_red_arg_types # Replace illegal parameter names in the loop body with legal ones. replace_var_names(loop_body, param_dict) # remember the name before legalizing as the actual arguments parfor_args = parfor_params # Change parfor_params to be legal names. parfor_params = [param_dict[v] for v in parfor_params] parfor_params_orig = parfor_params parfor_params = [] ascontig = False for pindex in range(len(parfor_params_orig)): if ( ascontig and pindex < len(parfor_inputs) and isinstance(param_types[pindex], types.npytypes.Array) ): parfor_params.append(parfor_params_orig[pindex] + "param") else: parfor_params.append(parfor_params_orig[pindex]) # Change parfor body to replace illegal loop index vars with legal ones. replace_var_names(loop_body, ind_dict) loop_body_var_table = get_name_var_table(loop_body) sentinel_name = get_unused_var_name("__sentinel__", loop_body_var_table) if config.DEBUG_ARRAY_OPT >= 1: print("legal parfor_params = ", parfor_params, " ", type(parfor_params)) # Determine the unique names of the scheduling and gufunc functions. # sched_func_name = "__numba_parfor_sched_%s" % (hex(hash(parfor)).replace("-", "_")) gufunc_name = "__numba_parfor_gufunc_%s" % (hex(hash(parfor)).replace("-", "_")) if config.DEBUG_ARRAY_OPT: # print("sched_func_name ", type(sched_func_name), " ", sched_func_name) print("gufunc_name ", type(gufunc_name), " ", gufunc_name) gufunc_txt = "" # Create the gufunc function. gufunc_txt += ( "def " + gufunc_name + "(sched, " + (", ".join(parfor_params)) + "):\n" ) for pindex in range(len(parfor_inputs)): if ascontig and isinstance(param_types[pindex], types.npytypes.Array): gufunc_txt += ( " " + parfor_params_orig[pindex] + " = np.ascontiguousarray(" + parfor_params[pindex] + ")\n" ) # Add initialization of reduction variables for arr, var in zip(parfor_redarrs, parfor_redvars): # If reduction variable is a scalar then save current value to # temp and accumulate on that temp to prevent false sharing. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[var] + "=" + param_dict[arr] + "[0]\n" else: # The reduction variable is an array so np.copy it to a temp. gufunc_txt += ( " " + param_dict[var] + "=np.copy(" + param_dict[arr] + ")\n" ) # For each dimension of the parfor, create a for loop in the generated gufunc function. # Iterate across the proper values extracted from the schedule. # The form of the schedule is start_dim0, start_dim1, ..., start_dimN, end_dim0, # end_dim1, ..., end_dimN for eachdim in range(parfor_dim): for indent in range(eachdim + 1): gufunc_txt += " " sched_dim = eachdim gufunc_txt += ( "for " + legal_loop_indices[eachdim] + " in range(sched[" + str(sched_dim) + "], sched[" + str(sched_dim + parfor_dim) + "] + np.uint8(1)):\n" ) if config.DEBUG_ARRAY_OPT_RUNTIME: for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += "print(" for eachdim in range(parfor_dim): gufunc_txt += ( '"' + legal_loop_indices[eachdim] + '",' + legal_loop_indices[eachdim] + "," ) gufunc_txt += ")\n" # Add the sentinel assignment so that we can find the loop body position # in the IR. for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += sentinel_name + " = 0\n" # Add assignments of reduction variables (for returning the value) redargstartdim = {} for arr, var in zip(parfor_redarrs, parfor_redvars): # After the gufunc loops, copy the accumulated temp value back to reduction array. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[arr] + "[0] = " + param_dict[var] + "\n" redargstartdim[arr] = 1 else: # After the gufunc loops, copy the accumulated temp array back to reduction array with ":" gufunc_txt += ( " " + param_dict[arr] + "[:] = " + param_dict[var] + "[:]\n" ) redargstartdim[arr] = 0 gufunc_txt += " return None\n" if config.DEBUG_ARRAY_OPT: print("gufunc_txt = ", type(gufunc_txt), "\n", gufunc_txt) # Force gufunc outline into existence. globls = {"np": np} locls = {} exec_(gufunc_txt, globls, locls) gufunc_func = locls[gufunc_name] if config.DEBUG_ARRAY_OPT: print("gufunc_func = ", type(gufunc_func), "\n", gufunc_func) # Get the IR for the gufunc outline. gufunc_ir = compiler.run_frontend(gufunc_func) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump ", type(gufunc_ir)) gufunc_ir.dump() print("loop_body dump ", type(loop_body)) _print_body(loop_body) # rename all variables in gufunc_ir afresh var_table = get_name_var_table(gufunc_ir.blocks) new_var_dict = {} reserved_names = [sentinel_name] + list(param_dict.values()) + legal_loop_indices for name, var in var_table.items(): if not (name in reserved_names): new_var_dict[name] = mk_unique_var(name) replace_var_names(gufunc_ir.blocks, new_var_dict) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump after renaming ") gufunc_ir.dump() gufunc_param_types = [ numba.types.npytypes.Array(index_var_typ, 1, "C") ] + param_types if config.DEBUG_ARRAY_OPT: print( "gufunc_param_types = ", type(gufunc_param_types), "\n", gufunc_param_types ) gufunc_stub_last_label = max(gufunc_ir.blocks.keys()) + 1 # Add gufunc stub last label to each parfor.loop_body label to prevent # label conflicts. loop_body = add_offset_to_labels(loop_body, gufunc_stub_last_label) # new label for splitting sentinel block new_label = max(loop_body.keys()) + 1 # If enabled, add a print statement after every assignment. if config.DEBUG_ARRAY_OPT_RUNTIME: for label, block in loop_body.items(): new_block = block.copy() new_block.clear() loc = block.loc scope = block.scope for inst in block.body: new_block.append(inst) # Append print after assignment if isinstance(inst, ir.Assign): # Only apply to numbers if typemap[inst.target.name] not in types.number_domain: continue # Make constant string strval = "{} =".format(inst.target.name) strconsttyp = types.StringLiteral(strval) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=strval, loc=loc), target=lhs, loc=loc ) typemap[lhs.name] = strconsttyp new_block.append(assign_lhs) # Make print node print_node = ir.Print(args=[lhs, inst.target], vararg=None, loc=loc) new_block.append(print_node) sig = numba.typing.signature( types.none, typemap[lhs.name], typemap[inst.target.name] ) lowerer.fndesc.calltypes[print_node] = sig loop_body[label] = new_block if config.DEBUG_ARRAY_OPT: print("parfor loop body") _print_body(loop_body) wrapped_blocks = wrap_loop_body(loop_body) hoisted, not_hoisted = hoist(parfor_params, loop_body, typemap, wrapped_blocks) start_block = gufunc_ir.blocks[min(gufunc_ir.blocks.keys())] start_block.body = start_block.body[:-1] + hoisted + [start_block.body[-1]] unwrap_loop_body(loop_body) # store hoisted into diagnostics diagnostics = lowerer.metadata["parfor_diagnostics"] diagnostics.hoist_info[parfor.id] = {"hoisted": hoisted, "not_hoisted": not_hoisted} if config.DEBUG_ARRAY_OPT: print("After hoisting") _print_body(loop_body) # Search all the block in the gufunc outline for the sentinel assignment. for label, block in gufunc_ir.blocks.items(): for i, inst in enumerate(block.body): if isinstance(inst, ir.Assign) and inst.target.name == sentinel_name: # We found the sentinel assignment. loc = inst.loc scope = block.scope # split block across __sentinel__ # A new block is allocated for the statements prior to the sentinel # but the new block maintains the current block label. prev_block = ir.Block(scope, loc) prev_block.body = block.body[:i] # The current block is used for statements after the sentinel. block.body = block.body[i + 1 :] # But the current block gets a new label. body_first_label = min(loop_body.keys()) # The previous block jumps to the minimum labelled block of the # parfor body. prev_block.append(ir.Jump(body_first_label, loc)) # Add all the parfor loop body blocks to the gufunc function's # IR. for l, b in loop_body.items(): gufunc_ir.blocks[l] = b body_last_label = max(loop_body.keys()) gufunc_ir.blocks[new_label] = block gufunc_ir.blocks[label] = prev_block # Add a jump from the last parfor body block to the block containing # statements after the sentinel. gufunc_ir.blocks[body_last_label].append(ir.Jump(new_label, loc)) break else: continue break if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump before renaming") gufunc_ir.dump() gufunc_ir.blocks = rename_labels(gufunc_ir.blocks) remove_dels(gufunc_ir.blocks) if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump") gufunc_ir.dump() print("flags", flags) print("typemap", typemap) old_alias = flags.noalias if not has_aliases: if config.DEBUG_ARRAY_OPT: print("No aliases found so adding noalias flag.") flags.noalias = True kernel_func = compiler.compile_ir( typingctx, targetctx, gufunc_ir, gufunc_param_types, types.none, flags, locals ) flags.noalias = old_alias kernel_sig = signature(types.none, *gufunc_param_types) if config.DEBUG_ARRAY_OPT: print("kernel_sig = ", kernel_sig) return kernel_func, parfor_args, kernel_sig, redargstartdim, func_arg_types
def _create_gufunc_for_parfor_body( lowerer, parfor, typemap, typingctx, targetctx, flags, locals, has_aliases, index_var_typ, races, ): """ Takes a parfor and creates a gufunc function for its body. There are two parts to this function. 1) Code to iterate across the iteration space as defined by the schedule. 2) The parfor body that does the work for a single point in the iteration space. Part 1 is created as Python text for simplicity with a sentinel assignment to mark the point in the IR where the parfor body should be added. This Python text is 'exec'ed into existence and its IR retrieved with run_frontend. The IR is scanned for the sentinel assignment where that basic block is split and the IR for the parfor body inserted. """ loc = parfor.init_block.loc # The parfor body and the main function body share ir.Var nodes. # We have to do some replacements of Var names in the parfor body to make them # legal parameter names. If we don't copy then the Vars in the main function also # would incorrectly change their name. loop_body = copy.copy(parfor.loop_body) remove_dels(loop_body) parfor_dim = len(parfor.loop_nests) loop_indices = [l.index_variable.name for l in parfor.loop_nests] # Get all the parfor params. parfor_params = parfor.params # Get just the outputs of the parfor. parfor_outputs = numba.parfor.get_parfor_outputs(parfor, parfor_params) # Get all parfor reduction vars, and operators. typemap = lowerer.fndesc.typemap parfor_redvars, parfor_reddict = numba.parfor.get_parfor_reductions( parfor, parfor_params, lowerer.fndesc.calltypes ) # Compute just the parfor inputs as a set difference. parfor_inputs = sorted( list(set(parfor_params) - set(parfor_outputs) - set(parfor_redvars)) ) races = races.difference(set(parfor_redvars)) for race in races: msg = ( "Variable %s used in parallel loop may be written " "to simultaneously by multiple workers and may result " "in non-deterministic or unintended results." % race ) warnings.warn(NumbaParallelSafetyWarning(msg, loc)) replace_var_with_array(races, loop_body, typemap, lowerer.fndesc.calltypes) if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("parfor_outputs = ", parfor_outputs, " ", type(parfor_outputs)) print("parfor_inputs = ", parfor_inputs, " ", type(parfor_inputs)) print("parfor_redvars = ", parfor_redvars, " ", type(parfor_redvars)) # Reduction variables are represented as arrays, so they go under # different names. parfor_redarrs = [] parfor_red_arg_types = [] for var in parfor_redvars: arr = var + "_arr" parfor_redarrs.append(arr) redarraytype = redtyp_to_redarraytype(typemap[var]) parfor_red_arg_types.append(redarraytype) redarrsig = redarraytype_to_sig(redarraytype) if arr in typemap: assert typemap[arr] == redarrsig else: typemap[arr] = redarrsig # Reorder all the params so that inputs go first then outputs. parfor_params = parfor_inputs + parfor_outputs + parfor_redarrs if config.DEBUG_ARRAY_OPT >= 1: print("parfor_params = ", parfor_params, " ", type(parfor_params)) print("loop_indices = ", loop_indices, " ", type(loop_indices)) print("loop_body = ", loop_body, " ", type(loop_body)) _print_body(loop_body) # Some Var are not legal parameter names so create a dict of potentially illegal # param name to guaranteed legal name. param_dict = legalize_names_with_typemap(parfor_params + parfor_redvars, typemap) if config.DEBUG_ARRAY_OPT >= 1: print("param_dict = ", sorted(param_dict.items()), " ", type(param_dict)) # Some loop_indices are not legal parameter names so create a dict of potentially illegal # loop index to guaranteed legal name. ind_dict = legalize_names_with_typemap(loop_indices, typemap) # Compute a new list of legal loop index names. legal_loop_indices = [ind_dict[v] for v in loop_indices] if config.DEBUG_ARRAY_OPT >= 1: print("ind_dict = ", sorted(ind_dict.items()), " ", type(ind_dict)) print( "legal_loop_indices = ", legal_loop_indices, " ", type(legal_loop_indices) ) for pd in parfor_params: print("pd = ", pd) print("pd type = ", typemap[pd], " ", type(typemap[pd])) # Get the types of each parameter. param_types = [typemap[v] for v in parfor_params] # Calculate types of args passed to gufunc. func_arg_types = [ typemap[v] for v in (parfor_inputs + parfor_outputs) ] + parfor_red_arg_types # Replace illegal parameter names in the loop body with legal ones. replace_var_names(loop_body, param_dict) # remember the name before legalizing as the actual arguments parfor_args = parfor_params # Change parfor_params to be legal names. parfor_params = [param_dict[v] for v in parfor_params] parfor_params_orig = parfor_params parfor_params = [] ascontig = False for pindex in range(len(parfor_params_orig)): if ( ascontig and pindex < len(parfor_inputs) and isinstance(param_types[pindex], types.npytypes.Array) ): parfor_params.append(parfor_params_orig[pindex] + "param") else: parfor_params.append(parfor_params_orig[pindex]) # Change parfor body to replace illegal loop index vars with legal ones. replace_var_names(loop_body, ind_dict) loop_body_var_table = get_name_var_table(loop_body) sentinel_name = get_unused_var_name("__sentinel__", loop_body_var_table) if config.DEBUG_ARRAY_OPT >= 1: print("legal parfor_params = ", parfor_params, " ", type(parfor_params)) # Determine the unique names of the scheduling and gufunc functions. # sched_func_name = "__numba_parfor_sched_%s" % (hex(hash(parfor)).replace("-", "_")) gufunc_name = "__numba_parfor_gufunc_%s" % (hex(hash(parfor)).replace("-", "_")) if config.DEBUG_ARRAY_OPT: # print("sched_func_name ", type(sched_func_name), " ", sched_func_name) print("gufunc_name ", type(gufunc_name), " ", gufunc_name) gufunc_txt = "" # Create the gufunc function. gufunc_txt += ( "def " + gufunc_name + "(sched, " + (", ".join(parfor_params)) + "):\n" ) for pindex in range(len(parfor_inputs)): if ascontig and isinstance(param_types[pindex], types.npytypes.Array): gufunc_txt += ( " " + parfor_params_orig[pindex] + " = np.ascontiguousarray(" + parfor_params[pindex] + ")\n" ) # Add initialization of reduction variables for arr, var in zip(parfor_redarrs, parfor_redvars): # If reduction variable is a scalar then save current value to # temp and accumulate on that temp to prevent false sharing. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[var] + "=" + param_dict[arr] + "[0]\n" else: # The reduction variable is an array so np.copy it to a temp. gufunc_txt += ( " " + param_dict[var] + "=np.copy(" + param_dict[arr] + ")\n" ) # For each dimension of the parfor, create a for loop in the generated gufunc function. # Iterate across the proper values extracted from the schedule. # The form of the schedule is start_dim0, start_dim1, ..., start_dimN, end_dim0, # end_dim1, ..., end_dimN for eachdim in range(parfor_dim): for indent in range(eachdim + 1): gufunc_txt += " " sched_dim = eachdim gufunc_txt += ( "for " + legal_loop_indices[eachdim] + " in range(sched[" + str(sched_dim) + "], sched[" + str(sched_dim + parfor_dim) + "] + np.uint8(1)):\n" ) if config.DEBUG_ARRAY_OPT_RUNTIME: for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += "print(" for eachdim in range(parfor_dim): gufunc_txt += ( '"' + legal_loop_indices[eachdim] + '",' + legal_loop_indices[eachdim] + "," ) gufunc_txt += ")\n" # Add the sentinel assignment so that we can find the loop body position # in the IR. for indent in range(parfor_dim + 1): gufunc_txt += " " gufunc_txt += sentinel_name + " = 0\n" # Add assignments of reduction variables (for returning the value) redargstartdim = {} for arr, var in zip(parfor_redarrs, parfor_redvars): # After the gufunc loops, copy the accumulated temp value back to reduction array. if redtyp_is_scalar(typemap[var]): gufunc_txt += " " + param_dict[arr] + "[0] = " + param_dict[var] + "\n" redargstartdim[arr] = 1 else: # After the gufunc loops, copy the accumulated temp array back to reduction array with ":" gufunc_txt += ( " " + param_dict[arr] + "[:] = " + param_dict[var] + "[:]\n" ) redargstartdim[arr] = 0 gufunc_txt += " return None\n" if config.DEBUG_ARRAY_OPT: print("gufunc_txt = ", type(gufunc_txt), "\n", gufunc_txt) # Force gufunc outline into existence. globls = {"np": np} locls = {} exec_(gufunc_txt, globls, locls) gufunc_func = locls[gufunc_name] if config.DEBUG_ARRAY_OPT: print("gufunc_func = ", type(gufunc_func), "\n", gufunc_func) # Get the IR for the gufunc outline. gufunc_ir = compiler.run_frontend(gufunc_func) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump ", type(gufunc_ir)) gufunc_ir.dump() print("loop_body dump ", type(loop_body)) _print_body(loop_body) # rename all variables in gufunc_ir afresh var_table = get_name_var_table(gufunc_ir.blocks) new_var_dict = {} reserved_names = [sentinel_name] + list(param_dict.values()) + legal_loop_indices for name, var in var_table.items(): if not (name in reserved_names): new_var_dict[name] = mk_unique_var(name) replace_var_names(gufunc_ir.blocks, new_var_dict) if config.DEBUG_ARRAY_OPT: print("gufunc_ir dump after renaming ") gufunc_ir.dump() gufunc_param_types = [ numba.types.npytypes.Array(index_var_typ, 1, "C") ] + param_types if config.DEBUG_ARRAY_OPT: print( "gufunc_param_types = ", type(gufunc_param_types), "\n", gufunc_param_types ) gufunc_stub_last_label = max(gufunc_ir.blocks.keys()) + 1 # Add gufunc stub last label to each parfor.loop_body label to prevent # label conflicts. loop_body = add_offset_to_labels(loop_body, gufunc_stub_last_label) # new label for splitting sentinel block new_label = max(loop_body.keys()) + 1 # If enabled, add a print statement after every assignment. if config.DEBUG_ARRAY_OPT_RUNTIME: for label, block in loop_body.items(): new_block = block.copy() new_block.clear() loc = block.loc scope = block.scope for inst in block.body: new_block.append(inst) # Append print after assignment if isinstance(inst, ir.Assign): # Only apply to numbers if typemap[inst.target.name] not in types.number_domain: continue # Make constant string strval = "{} =".format(inst.target.name) strconsttyp = types.StringLiteral(strval) lhs = ir.Var(scope, mk_unique_var("str_const"), loc) assign_lhs = ir.Assign( value=ir.Const(value=strval, loc=loc), target=lhs, loc=loc ) typemap[lhs.name] = strconsttyp new_block.append(assign_lhs) # Make print node print_node = ir.Print(args=[lhs, inst.target], vararg=None, loc=loc) new_block.append(print_node) sig = numba.typing.signature( types.none, typemap[lhs.name], typemap[inst.target.name] ) lowerer.fndesc.calltypes[print_node] = sig loop_body[label] = new_block if config.DEBUG_ARRAY_OPT: print("parfor loop body") _print_body(loop_body) wrapped_blocks = wrap_loop_body(loop_body) hoisted, not_hoisted = hoist(parfor_params, loop_body, typemap, wrapped_blocks) start_block = gufunc_ir.blocks[min(gufunc_ir.blocks.keys())] start_block.body = start_block.body[:-1] + hoisted + [start_block.body[-1]] unwrap_loop_body(loop_body) # store hoisted into diagnostics diagnostics = lowerer.metadata["parfor_diagnostics"] diagnostics.hoist_info[parfor.id] = {"hoisted": hoisted, "not_hoisted": not_hoisted} if config.DEBUG_ARRAY_OPT: print("After hoisting") _print_body(loop_body) # Search all the block in the gufunc outline for the sentinel assignment. for label, block in gufunc_ir.blocks.items(): for i, inst in enumerate(block.body): if isinstance(inst, ir.Assign) and inst.target.name == sentinel_name: # We found the sentinel assignment. loc = inst.loc scope = block.scope # split block across __sentinel__ # A new block is allocated for the statements prior to the sentinel # but the new block maintains the current block label. prev_block = ir.Block(scope, loc) prev_block.body = block.body[:i] # The current block is used for statements after the sentinel. block.body = block.body[i + 1 :] # But the current block gets a new label. body_first_label = min(loop_body.keys()) # The previous block jumps to the minimum labelled block of the # parfor body. prev_block.append(ir.Jump(body_first_label, loc)) # Add all the parfor loop body blocks to the gufunc function's # IR. for l, b in loop_body.items(): gufunc_ir.blocks[l] = b body_last_label = max(loop_body.keys()) gufunc_ir.blocks[new_label] = block gufunc_ir.blocks[label] = prev_block # Add a jump from the last parfor body block to the block containing # statements after the sentinel. gufunc_ir.blocks[body_last_label].append(ir.Jump(new_label, loc)) break else: continue break if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump before renaming") gufunc_ir.dump() gufunc_ir.blocks = rename_labels(gufunc_ir.blocks) remove_dels(gufunc_ir.blocks) if config.DEBUG_ARRAY_OPT: print("gufunc_ir last dump") gufunc_ir.dump() print("flags", flags) print("typemap", typemap) old_alias = flags.noalias if not has_aliases: if config.DEBUG_ARRAY_OPT: print("No aliases found so adding noalias flag.") flags.noalias = True kernel_func = compiler.compile_ir( typingctx, targetctx, gufunc_ir, gufunc_param_types, types.none, flags, locals ) flags.noalias = old_alias kernel_sig = signature(types.none, *gufunc_param_types) if config.DEBUG_ARRAY_OPT: print("kernel_sig = ", kernel_sig) return kernel_func, parfor_args, kernel_sig, redargstartdim, func_arg_types
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def min_parallel_impl(return_type, arg): # XXX: use prange for 1D arrays since pndindex returns a 1-tuple instead of # integer. This causes type and fusion issues. if arg.ndim == 0: def min_1(in_arr): return in_arr[()] elif arg.ndim == 1: def min_1(in_arr): numba.parfor.init_prange() min_checker(len(in_arr)) val = numba.targets.builtins.get_type_max_value(in_arr.dtype) for i in numba.parfor.internal_prange(len(in_arr)): val = min(val, in_arr[i]) return val else: def min_1(in_arr): numba.parfor.init_prange() min_checker(len(in_arr)) val = numba.targets.builtins.get_type_max_value(in_arr.dtype) for i in numba.pndindex(in_arr.shape): val = min(val, in_arr[i]) return val return min_1
def min_parallel_impl(return_type, arg): # XXX: use prange for 1D arrays since pndindex returns a 1-tuple instead of # integer. This causes type and fusion issues. if arg.ndim == 1: def min_1(in_arr): numba.parfor.init_prange() min_checker(len(in_arr)) val = numba.targets.builtins.get_type_max_value(in_arr.dtype) for i in numba.parfor.internal_prange(len(in_arr)): val = min(val, in_arr[i]) return val else: def min_1(in_arr): numba.parfor.init_prange() min_checker(len(in_arr)) val = numba.targets.builtins.get_type_max_value(in_arr.dtype) for i in numba.pndindex(in_arr.shape): val = min(val, in_arr[i]) return val return min_1
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def max_parallel_impl(return_type, arg): if arg.ndim == 0: def max_1(in_arr): return in_arr[()] elif arg.ndim == 1: def max_1(in_arr): numba.parfor.init_prange() max_checker(len(in_arr)) val = numba.targets.builtins.get_type_min_value(in_arr.dtype) for i in numba.parfor.internal_prange(len(in_arr)): val = max(val, in_arr[i]) return val else: def max_1(in_arr): numba.parfor.init_prange() max_checker(len(in_arr)) val = numba.targets.builtins.get_type_min_value(in_arr.dtype) for i in numba.pndindex(in_arr.shape): val = max(val, in_arr[i]) return val return max_1
def max_parallel_impl(return_type, arg): if arg.ndim == 1: def max_1(in_arr): numba.parfor.init_prange() max_checker(len(in_arr)) val = numba.targets.builtins.get_type_min_value(in_arr.dtype) for i in numba.parfor.internal_prange(len(in_arr)): val = max(val, in_arr[i]) return val else: def max_1(in_arr): numba.parfor.init_prange() max_checker(len(in_arr)) val = numba.targets.builtins.get_type_min_value(in_arr.dtype) for i in numba.pndindex(in_arr.shape): val = max(val, in_arr[i]) return val return max_1
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def sum_parallel_impl(return_type, arg): zero = return_type(0) if arg.ndim == 0: def sum_1(in_arr): return in_arr[()] elif arg.ndim == 1: def sum_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.parfor.internal_prange(len(in_arr)): val += in_arr[i] return val else: def sum_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.pndindex(in_arr.shape): val += in_arr[i] return val return sum_1
def sum_parallel_impl(return_type, arg): zero = return_type(0) if arg.ndim == 1: def sum_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.parfor.internal_prange(len(in_arr)): val += in_arr[i] return val else: def sum_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.pndindex(in_arr.shape): val += in_arr[i] return val return sum_1
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def prod_parallel_impl(return_type, arg): one = return_type(1) if arg.ndim == 0: def prod_1(in_arr): return in_arr[()] elif arg.ndim == 1: def prod_1(in_arr): numba.parfor.init_prange() val = one for i in numba.parfor.internal_prange(len(in_arr)): val *= in_arr[i] return val else: def prod_1(in_arr): numba.parfor.init_prange() val = one for i in numba.pndindex(in_arr.shape): val *= in_arr[i] return val return prod_1
def prod_parallel_impl(return_type, arg): one = return_type(1) if arg.ndim == 1: def prod_1(in_arr): numba.parfor.init_prange() val = one for i in numba.parfor.internal_prange(len(in_arr)): val *= in_arr[i] return val else: def prod_1(in_arr): numba.parfor.init_prange() val = one for i in numba.pndindex(in_arr.shape): val *= in_arr[i] return val return prod_1
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def mean_parallel_impl(return_type, arg): # can't reuse sum since output type is different zero = return_type(0) if arg.ndim == 0: def mean_1(in_arr): return in_arr[()] elif arg.ndim == 1: def mean_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.parfor.internal_prange(len(in_arr)): val += in_arr[i] return val / len(in_arr) else: def mean_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.pndindex(in_arr.shape): val += in_arr[i] return val / in_arr.size return mean_1
def mean_parallel_impl(return_type, arg): # can't reuse sum since output type is different zero = return_type(0) if arg.ndim == 1: def mean_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.parfor.internal_prange(len(in_arr)): val += in_arr[i] return val / len(in_arr) else: def mean_1(in_arr): numba.parfor.init_prange() val = zero for i in numba.pndindex(in_arr.shape): val += in_arr[i] return val / in_arr.size return mean_1
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def var_parallel_impl(return_type, arg): if arg.ndim == 0: def var_1(in_arr): return 0 elif arg.ndim == 1: def var_1(in_arr): # Compute the mean m = in_arr.mean() # Compute the sum of square diffs numba.parfor.init_prange() ssd = 0 for i in numba.parfor.internal_prange(len(in_arr)): val = in_arr[i] - m ssd += np.real(val * np.conj(val)) return ssd / len(in_arr) else: def var_1(in_arr): # Compute the mean m = in_arr.mean() # Compute the sum of square diffs numba.parfor.init_prange() ssd = 0 for i in numba.pndindex(in_arr.shape): val = in_arr[i] - m ssd += np.real(val * np.conj(val)) return ssd / in_arr.size return var_1
def var_parallel_impl(return_type, arg): if arg.ndim == 1: def var_1(in_arr): # Compute the mean m = in_arr.mean() # Compute the sum of square diffs numba.parfor.init_prange() ssd = 0 for i in numba.parfor.internal_prange(len(in_arr)): val = in_arr[i] - m ssd += np.real(val * np.conj(val)) return ssd / len(in_arr) else: def var_1(in_arr): # Compute the mean m = in_arr.mean() # Compute the sum of square diffs numba.parfor.init_prange() ssd = 0 for i in numba.pndindex(in_arr.shape): val = in_arr[i] - m ssd += np.real(val * np.conj(val)) return ssd / in_arr.size return var_1
https://github.com/numba/numba/issues/4748
Traceback (most recent call last): File "<ipython-input-101-c2c55c205bd8>", line 1, in <module> runfile('C:/Users/rpham/Desktop/FIN_Library/test.py', wdir='C:/Users/rpham/Desktop/FIN_Library') File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "C:\Users\rpham\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "C:/Users/rpham/Desktop/FIN_Library/test.py", line 19, in <module> result = fama_macbeth_numba(df,'period','ret',['exmkt','smb','hml'],intercept=True,parallel=True) File "C:\Users\rpham\Desktop\FIN_Library\finance_byu\fama_macbeth.py", line 202, in fama_macbeth_numba gammas = _ols_numba_parallel(d,ti,np.array(yvari),np.array(xvari)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 370, in _compile_for_args raise e File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 327, in _compile_for_args return self.compile(tuple(argtypes)) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 659, in compile cres = self._compiler.compile(args, return_type) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\dispatcher.py", line 83, in compile pipeline_class=self.pipeline_class) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 955, in compile_extra return pipeline.compile_extra(func) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 377, in compile_extra return self._compile_bytecode() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 886, in _compile_bytecode return self._compile_core() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 873, in _compile_core res = pm.run(self.status) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 254, in run raise patched_exception File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 245, in run stage() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\compiler.py", line 565, in stage_parfor_pass parfor_pass.run() File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\parfor.py", line 1448, in run self.array_analysis.run(self.func_ir.blocks) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 916, in run pre, post = self._analyze_inst(label, scope, equiv_set, inst) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 987, in _analyze_inst equiv_set.insert_equiv(lhs, shape) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in insert_equiv obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 445, in <listcomp> obj_names = [self._get_names(x) for x in objs] File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in _get_names return tuple(self._get_names(x)[0] for x in obj) File "C:\Users\rpham\Anaconda3\lib\site-packages\numba\array_analysis.py", line 363, in <genexpr> return tuple(self._get_names(x)[0] for x in obj) IndexError: Failed in nopython mode pipeline (step: convert to parfors) tuple index out of range
IndexError
def get_call_table( blocks, call_table=None, reverse_call_table=None, topological_ordering=True ): """returns a dictionary of call variables and their references.""" # call_table example: c = np.zeros becomes c:["zeroes", np] # reverse_call_table example: c = np.zeros becomes np_var:c if call_table is None: call_table = {} if reverse_call_table is None: reverse_call_table = {} if topological_ordering: order = find_topo_order(blocks) else: order = list(blocks.keys()) for label in reversed(order): for inst in reversed(blocks[label].body): if isinstance(inst, ir.Assign): lhs = inst.target.name rhs = inst.value if isinstance(rhs, ir.Expr) and rhs.op == "call": call_table[rhs.func.name] = [] if isinstance(rhs, ir.Expr) and rhs.op == "getattr": if lhs in call_table: call_table[lhs].append(rhs.attr) reverse_call_table[rhs.value.name] = lhs if lhs in reverse_call_table: call_var = reverse_call_table[lhs] call_table[call_var].append(rhs.attr) reverse_call_table[rhs.value.name] = call_var if isinstance(rhs, ir.Global): if lhs in call_table: call_table[lhs].append(rhs.value) if lhs in reverse_call_table: call_var = reverse_call_table[lhs] call_table[call_var].append(rhs.value) if isinstance(rhs, ir.FreeVar): if lhs in call_table: call_table[lhs].append(rhs.value) if lhs in reverse_call_table: call_var = reverse_call_table[lhs] call_table[call_var].append(rhs.value) if isinstance(rhs, ir.Var): if lhs in call_table: call_table[lhs].append(rhs.name) reverse_call_table[rhs.name] = lhs if lhs in reverse_call_table: call_var = reverse_call_table[lhs] call_table[call_var].append(rhs.name) for T, f in call_table_extensions.items(): if isinstance(inst, T): f(inst, call_table, reverse_call_table) return call_table, reverse_call_table
def get_call_table( blocks, call_table=None, reverse_call_table=None, topological_ordering=True ): """returns a dictionary of call variables and their references.""" # call_table example: c = np.zeros becomes c:["zeroes", np] # reverse_call_table example: c = np.zeros becomes np_var:c if call_table is None: call_table = {} if reverse_call_table is None: reverse_call_table = {} if topological_ordering: order = find_topo_order(blocks) else: order = list(blocks.keys()) for label in reversed(order): for inst in reversed(blocks[label].body): if isinstance(inst, ir.Assign): lhs = inst.target.name rhs = inst.value if isinstance(rhs, ir.Expr) and rhs.op == "call": call_table[rhs.func.name] = [] if isinstance(rhs, ir.Expr) and rhs.op == "getattr": if lhs in call_table: call_table[lhs].append(rhs.attr) reverse_call_table[rhs.value.name] = lhs if lhs in reverse_call_table: call_var = reverse_call_table[lhs] call_table[call_var].append(rhs.attr) reverse_call_table[rhs.value.name] = call_var if isinstance(rhs, ir.Global): if lhs in call_table: call_table[lhs].append(rhs.value) if lhs in reverse_call_table: call_var = reverse_call_table[lhs] call_table[call_var].append(rhs.value) if isinstance(rhs, ir.FreeVar): if lhs in call_table: call_table[lhs].append(rhs.value) if lhs in reverse_call_table: call_var = reverse_call_table[lhs] call_table[call_var].append(rhs.value) for T, f in call_table_extensions.items(): if isinstance(inst, T): f(inst, call_table, reverse_call_table) return call_table, reverse_call_table
https://github.com/numba/numba/issues/4696
## run this: ```python @njit(parallel=True) def stencil_test2(A): @stencil def fun (a): c = 2 return 0.3 * (a[-c+1] + a[0] + a[c-1]) B = fun(A) return B stencil_test2(np.arange(10)) ``` ## see this: ```python /Users/bennettd/miniconda3/lib/python3.7/site-packages/numba/compiler.py:602: NumbaPerformanceWarning: The keyword argument 'parallel=True' was specified but no transformation for parallel execution was possible. To find out why, try turning on parallel diagnostics, see http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics for help. File "<ipython-input-575-2412dcac74fb>", line 2: @njit(parallel=True) def stencil_test2(A): ^ self.func_ir.loc)) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~/miniconda3/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 300 ty = self.typeof(inst.target.name) --> 301 val = self.lower_assign(ty, inst) 302 self.storevar(val, inst.target.name) ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_assign(self, ty, inst) 458 elif isinstance(value, ir.Expr): --> 459 return self.lower_expr(ty, value) 460 ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_expr(self, resty, expr) 918 elif expr.op == 'call': --> 919 res = self.lower_call(resty, expr) 920 return res ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_call(self, resty, expr) 710 else: --> 711 res = self._lower_call_normal(fnty, expr, signature) 712 ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in _lower_call_normal(self, fnty, expr, signature) 889 --> 890 res = impl(self.builder, argvals, self.loc) 891 return res ~/miniconda3/lib/python3.7/site-packages/numba/targets/base.py in __call__(self, builder, args, loc) 1131 def __call__(self, builder, args, loc=None): -> 1132 res = self._imp(self._context, builder, self._sig, args, loc=loc) 1133 self._context.add_linking_libs(getattr(self, 'libs', ())) ~/miniconda3/lib/python3.7/site-packages/numba/targets/base.py in wrapper(*args, **kwargs) 1156 kwargs.pop('loc') # drop unused loc -> 1157 return fn(*args, **kwargs) 1158 ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in __call__(self, context, builder, sig, args) 30 cres = self.stencilFunc.compile_for_argtys(sig.args, {}, ---> 31 sig.return_type, None) 32 res = context.call_internal(builder, cres.fndesc, sig, args) ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in compile_for_argtys(self, argtys, kwtys, return_type, sigret) 362 new_func = self._stencil_wrapper(result, sigret, return_type, --> 363 typemap, calltypes, *argtys) 364 return new_func ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in _stencil_wrapper(self, result, sigret, return_type, typemap, calltypes, *args) 522 kernel_copy, index_vars, the_array.ndim, --> 523 self.neighborhood, standard_indexed, typemap, copy_calltypes) 524 if self.neighborhood is None: ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in add_indices_to_kernel(self, kernel, index_names, ndim, neighborhood, standard_indexed, typemap, calltypes) 194 else: --> 195 raise ValueError("stencil kernel index is not " 196 "constant, 'neighborhood' option required") ValueError: stencil kernel index is not constant, 'neighborhood' option required During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-575-2412dcac74fb> in <module> 7 B = fun(A) 8 return B ----> 9 stencil_test2(np.arange(10)) ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument ~/miniconda3/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion ~/miniconda3/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): ~/miniconda3/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that ~/miniconda3/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 ~/miniconda3/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) stencil kernel index is not constant, 'neighborhood' option required File "<ipython-input-575-2412dcac74fb>", line 7: def fun (a): <source elided> return 0.3 * (a[-c+1] + a[0] + a[c-1]) B = fun(A) ^ [1] During: lowering "$B.9417 = call $fun.9416(A, func=$fun.9416, args=[Var(A, <ipython-input-575-2412dcac74fb> (3))], kws=(), vararg=None)" at <ipython-input-575-2412dcac74fb> (7) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba! ```
ValueError
def run(self): """Finds all calls to StencilFuncs in the IR and converts them to parfor.""" from numba.stencil import StencilFunc # Get all the calls in the function IR. call_table, _ = get_call_table(self.func_ir.blocks) stencil_calls = [] stencil_dict = {} for call_varname, call_list in call_table.items(): for one_call in call_list: if isinstance(one_call, StencilFunc): # Remember all calls to StencilFuncs. stencil_calls.append(call_varname) stencil_dict[call_varname] = one_call if not stencil_calls: return # return early if no stencil calls found # find and transform stencil calls for label, block in self.func_ir.blocks.items(): for i, stmt in reversed(list(enumerate(block.body))): # Found a call to a StencilFunc. if ( isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr) and stmt.value.op == "call" and stmt.value.func.name in stencil_calls ): kws = dict(stmt.value.kws) # Create dictionary of input argument number to # the argument itself. input_dict = { i: stmt.value.args[i] for i in range(len(stmt.value.args)) } in_args = stmt.value.args arg_typemap = tuple(self.typemap[i.name] for i in in_args) for arg_type in arg_typemap: if isinstance(arg_type, types.BaseTuple): raise ValueError( "Tuple parameters not supported " "for stencil kernels in parallel=True mode." ) out_arr = kws.get("out") # Get the StencilFunc object corresponding to this call. sf = stencil_dict[stmt.value.func.name] stencil_ir, rt, arg_to_arr_dict = get_stencil_ir( sf, self.typingctx, arg_typemap, block.scope, block.loc, input_dict, self.typemap, self.calltypes, ) index_offsets = sf.options.get("index_offsets", None) gen_nodes = self._mk_stencil_parfor( label, in_args, out_arr, stencil_ir, index_offsets, stmt.target, rt, sf, arg_to_arr_dict, ) block.body = block.body[:i] + gen_nodes + block.body[i + 1 :] # Found a call to a stencil via numba.stencil(). elif ( isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr) and stmt.value.op == "call" and guard(find_callname, self.func_ir, stmt.value) == ("stencil", "numba") ): # remove dummy stencil() call stmt.value = ir.Const(0, stmt.loc)
def run(self): """Finds all calls to StencilFuncs in the IR and converts them to parfor.""" from numba.stencil import StencilFunc # Get all the calls in the function IR. call_table, _ = get_call_table(self.func_ir.blocks) stencil_calls = [] stencil_dict = {} for call_varname, call_list in call_table.items(): if len(call_list) == 1 and isinstance(call_list[0], StencilFunc): # Remember all calls to StencilFuncs. stencil_calls.append(call_varname) stencil_dict[call_varname] = call_list[0] if not stencil_calls: return # return early if no stencil calls found # find and transform stencil calls for label, block in self.func_ir.blocks.items(): for i, stmt in reversed(list(enumerate(block.body))): # Found a call to a StencilFunc. if ( isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr) and stmt.value.op == "call" and stmt.value.func.name in stencil_calls ): kws = dict(stmt.value.kws) # Create dictionary of input argument number to # the argument itself. input_dict = { i: stmt.value.args[i] for i in range(len(stmt.value.args)) } in_args = stmt.value.args arg_typemap = tuple(self.typemap[i.name] for i in in_args) for arg_type in arg_typemap: if isinstance(arg_type, types.BaseTuple): raise ValueError( "Tuple parameters not supported " "for stencil kernels in parallel=True mode." ) out_arr = kws.get("out") # Get the StencilFunc object corresponding to this call. sf = stencil_dict[stmt.value.func.name] stencil_ir, rt, arg_to_arr_dict = get_stencil_ir( sf, self.typingctx, arg_typemap, block.scope, block.loc, input_dict, self.typemap, self.calltypes, ) index_offsets = sf.options.get("index_offsets", None) gen_nodes = self._mk_stencil_parfor( label, in_args, out_arr, stencil_ir, index_offsets, stmt.target, rt, sf, arg_to_arr_dict, ) block.body = block.body[:i] + gen_nodes + block.body[i + 1 :] # Found a call to a stencil via numba.stencil(). elif ( isinstance(stmt, ir.Assign) and isinstance(stmt.value, ir.Expr) and stmt.value.op == "call" and guard(find_callname, self.func_ir, stmt.value) == ("stencil", "numba") ): # remove dummy stencil() call stmt.value = ir.Const(0, stmt.loc)
https://github.com/numba/numba/issues/4696
## run this: ```python @njit(parallel=True) def stencil_test2(A): @stencil def fun (a): c = 2 return 0.3 * (a[-c+1] + a[0] + a[c-1]) B = fun(A) return B stencil_test2(np.arange(10)) ``` ## see this: ```python /Users/bennettd/miniconda3/lib/python3.7/site-packages/numba/compiler.py:602: NumbaPerformanceWarning: The keyword argument 'parallel=True' was specified but no transformation for parallel execution was possible. To find out why, try turning on parallel diagnostics, see http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics for help. File "<ipython-input-575-2412dcac74fb>", line 2: @njit(parallel=True) def stencil_test2(A): ^ self.func_ir.loc)) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~/miniconda3/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 661 try: --> 662 yield 663 except NumbaError as e: ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_inst(self, inst) 300 ty = self.typeof(inst.target.name) --> 301 val = self.lower_assign(ty, inst) 302 self.storevar(val, inst.target.name) ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_assign(self, ty, inst) 458 elif isinstance(value, ir.Expr): --> 459 return self.lower_expr(ty, value) 460 ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_expr(self, resty, expr) 918 elif expr.op == 'call': --> 919 res = self.lower_call(resty, expr) 920 return res ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_call(self, resty, expr) 710 else: --> 711 res = self._lower_call_normal(fnty, expr, signature) 712 ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in _lower_call_normal(self, fnty, expr, signature) 889 --> 890 res = impl(self.builder, argvals, self.loc) 891 return res ~/miniconda3/lib/python3.7/site-packages/numba/targets/base.py in __call__(self, builder, args, loc) 1131 def __call__(self, builder, args, loc=None): -> 1132 res = self._imp(self._context, builder, self._sig, args, loc=loc) 1133 self._context.add_linking_libs(getattr(self, 'libs', ())) ~/miniconda3/lib/python3.7/site-packages/numba/targets/base.py in wrapper(*args, **kwargs) 1156 kwargs.pop('loc') # drop unused loc -> 1157 return fn(*args, **kwargs) 1158 ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in __call__(self, context, builder, sig, args) 30 cres = self.stencilFunc.compile_for_argtys(sig.args, {}, ---> 31 sig.return_type, None) 32 res = context.call_internal(builder, cres.fndesc, sig, args) ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in compile_for_argtys(self, argtys, kwtys, return_type, sigret) 362 new_func = self._stencil_wrapper(result, sigret, return_type, --> 363 typemap, calltypes, *argtys) 364 return new_func ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in _stencil_wrapper(self, result, sigret, return_type, typemap, calltypes, *args) 522 kernel_copy, index_vars, the_array.ndim, --> 523 self.neighborhood, standard_indexed, typemap, copy_calltypes) 524 if self.neighborhood is None: ~/miniconda3/lib/python3.7/site-packages/numba/stencil.py in add_indices_to_kernel(self, kernel, index_names, ndim, neighborhood, standard_indexed, typemap, calltypes) 194 else: --> 195 raise ValueError("stencil kernel index is not " 196 "constant, 'neighborhood' option required") ValueError: stencil kernel index is not constant, 'neighborhood' option required During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-575-2412dcac74fb> in <module> 7 B = fun(A) 8 return B ----> 9 stencil_test2(np.arange(10)) ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 393 e.patch_message(''.join(e.args) + help_msg) 394 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 395 raise e 396 397 def inspect_llvm(self, signature=None): ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 350 argtypes.append(self.typeof_pyval(a)) 351 try: --> 352 return self.compile(tuple(argtypes)) 353 except errors.TypingError as e: 354 # Intercept typing error that may be due to an argument ~/miniconda3/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, sig) 691 692 self._cache_misses[sig] += 1 --> 693 cres = self._compiler.compile(args, return_type) 694 self.add_overload(cres) 695 self._cache.save_overload(sig, cres) ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in compile(self, args, return_type) 74 75 def compile(self, args, return_type): ---> 76 status, retval = self._compile_cached(args, return_type) 77 if status: 78 return retval ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_cached(self, args, return_type) 88 89 try: ---> 90 retval = self._compile_core(args, return_type) 91 except errors.TypingError as e: 92 self._failed_cache[key] = e ~/miniconda3/lib/python3.7/site-packages/numba/dispatcher.py in _compile_core(self, args, return_type) 106 args=args, return_type=return_type, 107 flags=flags, locals=self.locals, --> 108 pipeline_class=self.pipeline_class) 109 # Check typing error if object mode is used 110 if cres.typing_error is not None and not flags.enable_pyobject: ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 970 pipeline = pipeline_class(typingctx, targetctx, library, 971 args, return_type, flags, locals) --> 972 return pipeline.compile_extra(func) 973 974 ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in compile_extra(self, func) 388 self.lifted = () 389 self.lifted_from = None --> 390 return self._compile_bytecode() 391 392 def compile_ir(self, func_ir, lifted=(), lifted_from=None): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in _compile_bytecode(self) 901 """ 902 assert self.func_ir is None --> 903 return self._compile_core() 904 905 def _compile_ir(self): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in _compile_core(self) 888 self.define_pipelines(pm) 889 pm.finalize() --> 890 res = pm.run(self.status) 891 if res is not None: 892 # Early pipeline completion ~/miniconda3/lib/python3.7/site-packages/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 264 # No more fallback pipelines? 265 if is_final_pipeline: --> 266 raise patched_exception 267 # Go to next fallback pipeline 268 else: ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in run(self, status) 255 try: 256 event("-- %s" % stage_name) --> 257 stage() 258 except _EarlyPipelineCompletion as e: 259 return e.result ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in stage_nopython_backend(self) 762 """ 763 lowerfn = self.backend_nopython_mode --> 764 self._backend(lowerfn, objectmode=False) 765 766 def stage_compile_interp_mode(self): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in _backend(self, lowerfn, objectmode) 701 self.library.enable_object_caching() 702 --> 703 lowered = lowerfn() 704 signature = typing.signature(self.return_type, *self.args) 705 self.cr = compile_result( ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in backend_nopython_mode(self) 688 self.calltypes, 689 self.flags, --> 690 self.metadata) 691 692 def _backend(self, lowerfn, objectmode): ~/miniconda3/lib/python3.7/site-packages/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1141 lower = lowering.Lower(targetctx, library, fndesc, interp, 1142 metadata=metadata) -> 1143 lower.lower() 1144 if not flags.no_cpython_wrapper: 1145 lower.create_cpython_wrapper(flags.release_gil) ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() ~/miniconda3/lib/python3.7/site-packages/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): ~/miniconda3/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that ~/miniconda3/lib/python3.7/site-packages/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 668 from numba import config 669 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 670 six.reraise(type(newerr), newerr, tb) 671 672 ~/miniconda3/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) stencil kernel index is not constant, 'neighborhood' option required File "<ipython-input-575-2412dcac74fb>", line 7: def fun (a): <source elided> return 0.3 * (a[-c+1] + a[0] + a[c-1]) B = fun(A) ^ [1] During: lowering "$B.9417 = call $fun.9416(A, func=$fun.9416, args=[Var(A, <ipython-input-575-2412dcac74fb> (3))], kws=(), vararg=None)" at <ipython-input-575-2412dcac74fb> (7) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.45.1. Please report the error message and traceback, along with a minimal reproducer at: https://github.com/numba/numba/issues/new If more help is needed please feel free to speak to the Numba core developers directly at: https://gitter.im/numba/numba Thanks in advance for your help in improving Numba! ```
ValueError
def __getitem__(self, item): if isinstance(item, slice): start, stop, step = item.indices(self.size) stride = step * self.stride start = self.start + start * abs(self.stride) stop = self.start + stop * abs(self.stride) if stride == 0: size = 1 else: size = _compute_size(start, stop, stride) ret = Dim(start=start, stop=stop, size=size, stride=stride, single=False) return ret else: sliced = self[item : item + 1] if sliced.size != 1: raise IndexError return Dim( start=sliced.start, stop=sliced.stop, size=sliced.size, stride=sliced.stride, single=True, )
def __getitem__(self, item): if isinstance(item, slice): start, stop, step = item.indices(self.size) stride = step * self.stride start = self.start + start * abs(self.stride) stop = self.start + stop * abs(self.stride) if stride == 0: size = 1 else: size = _compute_size(start, stop, stride) ret = Dim(start=start, stop=stop, size=size, stride=stride, single=False) return ret else: sliced = self[item : item + 1] return Dim( start=sliced.start, stop=sliced.stop, size=sliced.size, stride=sliced.stride, single=True, )
https://github.com/numba/numba/issues/4201
from numba import cuda a = cuda.device_array((5,)) a[:] = range(5) # this throws an AssertionError ... for v in a: ... print(v) ... 0.0 1.0 2.0 3.0 4.0 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/leofang/conda_envs/cupy_dev/lib/python3.6/site-packages/numba/cuda/cudadrv/devices.py", line 212, in _require_cuda_context return fn(*args, **kws) File "/home/leofang/conda_envs/cupy_dev/lib/python3.6/site-packages/numba/cuda/cudadrv/devicearray.py", line 479, in __getitem__ return self._do_getitem(item) File "/home/leofang/conda_envs/cupy_dev/lib/python3.6/site-packages/numba/cuda/cudadrv/devicearray.py", line 489, in _do_getitem arr = self._dummy.__getitem__(item) File "/home/leofang/conda_envs/cupy_dev/lib/python3.6/site-packages/numba/dummyarray.py", line 219, in __getitem__ dims = [dim.__getitem__(it) for dim, it in zip(self.dims, item)] File "/home/leofang/conda_envs/cupy_dev/lib/python3.6/site-packages/numba/dummyarray.py", line 219, in <listcomp> dims = [dim.__getitem__(it) for dim, it in zip(self.dims, item)] File "/home/leofang/conda_envs/cupy_dev/lib/python3.6/site-packages/numba/dummyarray.py", line 78, in __getitem__ single=True, File "/home/leofang/conda_envs/cupy_dev/lib/python3.6/site-packages/numba/dummyarray.py", line 51, in __init__ assert not single or size == 1 AssertionError # but manually limiting the range works fine ... for i in range(5): ... print(a[i]) ... 0.0 1.0 2.0 3.0 4.0
AssertionError
def __init__(self, py_func, identity=None, cache=False, targetoptions={}): if isinstance(py_func, Dispatcher): py_func = py_func.py_func dispatcher = jit(target="npyufunc", cache=cache, **targetoptions)(py_func) self._initialize(dispatcher, identity)
def __init__(self, py_func, identity=None, cache=False, targetoptions={}): if isinstance(py_func, Dispatcher): py_func = py_func.py_func self.targetoptions = targetoptions.copy() kws = {} kws["identity"] = ufuncbuilder.parse_identity(identity) dispatcher = jit(target="npyufunc", cache=cache)(py_func) super(DUFunc, self).__init__(dispatcher, **kws) # Loop over a copy of the keys instead of the keys themselves, # since we're changing the dictionary while looping. self._install_type() self._lower_me = DUFuncLowerer(self) self._install_cg() self.__name__ = py_func.__name__ self.__doc__ = py_func.__doc__
https://github.com/numba/numba/issues/2943
<class 'numpy.ufunc'> b'\x80\x03cnumpy.core\n_ufunc_reconstruct\nq\x00X\x0b\x00\x00\x00__mp_main__q\x01X\x04\x00\x00\x00inc2q\x02\x86q\x03Rq\x04.' <class 'numba.npyufunc.dufunc.DUFunc'> Traceback (most recent call last): File "vectorize_pickle.py", line 15, in <module> print(pickle.dumps(inc1)) TypeError: can't pickle DUFunc objects
TypeError
def _compile_core(self, sig, flags, locals): """ Trigger the compiler on the core function or load a previously compiled version from the cache. Returns the CompileResult. """ typingctx = self.targetdescr.typing_context targetctx = self.targetdescr.target_context @contextmanager def store_overloads_on_success(): # use to ensure overloads are stored on success try: yield except Exception: raise else: exists = self.overloads.get(cres.signature) if exists is None: self.overloads[cres.signature] = cres # Use cache and compiler in a critical section with global_compiler_lock: with store_overloads_on_success(): # attempt look up of existing cres = self.cache.load_overload(sig, targetctx) if cres is not None: return cres # Compile args, return_type = sigutils.normalize_signature(sig) cres = compiler.compile_extra( typingctx, targetctx, self.py_func, args=args, return_type=return_type, flags=flags, locals=locals, ) # cache lookup failed before so safe to save self.cache.save_overload(sig, cres) return cres
def _compile_core(self, sig, flags, locals): """ Trigger the compiler on the core function or load a previously compiled version from the cache. Returns the CompileResult. """ typingctx = self.targetdescr.typing_context targetctx = self.targetdescr.target_context @contextmanager def store_overloads_on_success(): # use to ensure overloads are stored on success try: yield except: raise else: exists = self.overloads.get(cres.signature) if exists is None: self.overloads[cres.signature] = cres # Use cache and compiler in a critical section with global_compiler_lock: with store_overloads_on_success(): # attempt look up of existing cres = self.cache.load_overload(sig, targetctx) if cres is not None: return cres # Compile args, return_type = sigutils.normalize_signature(sig) cres = compiler.compile_extra( typingctx, targetctx, self.py_func, args=args, return_type=return_type, flags=flags, locals=locals, ) # cache lookup failed before so safe to save self.cache.save_overload(sig, cres) return cres
https://github.com/numba/numba/issues/2943
<class 'numpy.ufunc'> b'\x80\x03cnumpy.core\n_ufunc_reconstruct\nq\x00X\x0b\x00\x00\x00__mp_main__q\x01X\x04\x00\x00\x00inc2q\x02\x86q\x03Rq\x04.' <class 'numba.npyufunc.dufunc.DUFunc'> Traceback (most recent call last): File "vectorize_pickle.py", line 15, in <module> print(pickle.dumps(inc1)) TypeError: can't pickle DUFunc objects
TypeError
def store_overloads_on_success(): # use to ensure overloads are stored on success try: yield except Exception: raise else: exists = self.overloads.get(cres.signature) if exists is None: self.overloads[cres.signature] = cres
def store_overloads_on_success(): # use to ensure overloads are stored on success try: yield except: raise else: exists = self.overloads.get(cres.signature) if exists is None: self.overloads[cres.signature] = cres
https://github.com/numba/numba/issues/2943
<class 'numpy.ufunc'> b'\x80\x03cnumpy.core\n_ufunc_reconstruct\nq\x00X\x0b\x00\x00\x00__mp_main__q\x01X\x04\x00\x00\x00inc2q\x02\x86q\x03Rq\x04.' <class 'numba.npyufunc.dufunc.DUFunc'> Traceback (most recent call last): File "vectorize_pickle.py", line 15, in <module> print(pickle.dumps(inc1)) TypeError: can't pickle DUFunc objects
TypeError
def build_ufunc(self): with global_compiler_lock: dtypelist = [] ptrlist = [] if not self.nb_func: raise TypeError("No definition") # Get signature in the order they are added keepalive = [] cres = None for sig in self._sigs: cres = self._cres[sig] dtypenums, ptr, env = self.build(cres, sig) dtypelist.append(dtypenums) ptrlist.append(utils.longint(ptr)) keepalive.append((cres.library, env)) datlist = [None] * len(ptrlist) if cres is None: if PYVERSION >= (3, 0): argspec = inspect.getfullargspec(self.py_func) else: argspec = inspect.getargspec(self.py_func) inct = len(argspec.args) else: inct = len(cres.signature.args) outct = 1 # Becareful that fromfunc does not provide full error checking yet. # If typenum is out-of-bound, we have nasty memory corruptions. # For instance, -1 for typenum will cause segfault. # If elements of type-list (2nd arg) is tuple instead, # there will also memory corruption. (Seems like code rewrite.) ufunc = _internal.fromfunc( self.py_func.__name__, self.py_func.__doc__, ptrlist, dtypelist, inct, outct, datlist, keepalive, self.identity, ) return ufunc
def build_ufunc(self): with global_compiler_lock: dtypelist = [] ptrlist = [] if not self.nb_func: raise TypeError("No definition") # Get signature in the order they are added keepalive = [] cres = None for sig in self._sigs: cres = self._cres[sig] dtypenums, ptr, env = self.build(cres, sig) dtypelist.append(dtypenums) ptrlist.append(utils.longint(ptr)) keepalive.append((cres.library, env)) datlist = [None] * len(ptrlist) if cres is None: if PYVERSION >= (3, 0): argspec = inspect.getfullargspec(self.py_func) else: argspec = inspect.getargspec(self.py_func) inct = len(argspec.args) else: inct = len(cres.signature.args) outct = 1 # Becareful that fromfunc does not provide full error checking yet. # If typenum is out-of-bound, we have nasty memory corruptions. # For instance, -1 for typenum will cause segfault. # If elements of type-list (2nd arg) is tuple instead, # there will also memory corruption. (Seems like code rewrite.) ufunc = _internal.fromfunc( self.py_func.__name__, self.py_func.__doc__, ptrlist, dtypelist, inct, outct, datlist, keepalive, self.identity, ) return ufunc
https://github.com/numba/numba/issues/2943
<class 'numpy.ufunc'> b'\x80\x03cnumpy.core\n_ufunc_reconstruct\nq\x00X\x0b\x00\x00\x00__mp_main__q\x01X\x04\x00\x00\x00inc2q\x02\x86q\x03Rq\x04.' <class 'numba.npyufunc.dufunc.DUFunc'> Traceback (most recent call last): File "vectorize_pickle.py", line 15, in <module> print(pickle.dumps(inc1)) TypeError: can't pickle DUFunc objects
TypeError
def build_ufunc(self): dtypelist = [] ptrlist = [] if not self.nb_func: raise TypeError("No definition") # Get signature in the order they are added keepalive = [] for sig in self._sigs: cres = self._cres[sig] dtypenums, ptr, env = self.build(cres) dtypelist.append(dtypenums) ptrlist.append(utils.longint(ptr)) keepalive.append((cres.library, env)) datlist = [None] * len(ptrlist) inct = len(self.sin) outct = len(self.sout) # Pass envs to fromfuncsig to bind to the lifetime of the ufunc object ufunc = _internal.fromfunc( self.py_func.__name__, self.py_func.__doc__, ptrlist, dtypelist, inct, outct, datlist, keepalive, self.identity, self.signature, ) return ufunc
def build_ufunc(self): dtypelist = [] ptrlist = [] if not self.nb_func: raise TypeError("No definition") # Get signature in the order they are added keepalive = [] for sig in self._sigs: cres = self._cres[sig] dtypenums, ptr, env = self.build(cres) dtypelist.append(dtypenums) ptrlist.append(utils.longint(ptr)) keepalive.append((cres.library, env)) datlist = [None] * len(ptrlist) inct = len(self.sin) outct = len(self.sout) # Pass envs to fromfuncsig to bind to the lifetime of the ufunc object ufunc = _internal.fromfunc( self.py_func.__name__, self.py_func.__doc__, ptrlist, dtypelist, inct, outct, datlist, keepalive, self.identity, self.signature, ) return ufunc
https://github.com/numba/numba/issues/2943
<class 'numpy.ufunc'> b'\x80\x03cnumpy.core\n_ufunc_reconstruct\nq\x00X\x0b\x00\x00\x00__mp_main__q\x01X\x04\x00\x00\x00inc2q\x02\x86q\x03Rq\x04.' <class 'numba.npyufunc.dufunc.DUFunc'> Traceback (most recent call last): File "vectorize_pickle.py", line 15, in <module> print(pickle.dumps(inc1)) TypeError: can't pickle DUFunc objects
TypeError
def _get_incref_decref(context, module, datamodel, container_type): assert datamodel.contains_nrt_meminfo() fe_type = datamodel.fe_type data_ptr_ty = datamodel.get_data_type().as_pointer() refct_fnty = ir.FunctionType(ir.VoidType(), [data_ptr_ty]) incref_fn = module.get_or_insert_function( refct_fnty, name=".numba_{}_incref${}".format(container_type, fe_type), ) builder = ir.IRBuilder(incref_fn.append_basic_block()) context.nrt.incref( builder, fe_type, datamodel.load_from_data_pointer(builder, incref_fn.args[0]), ) builder.ret_void() decref_fn = module.get_or_insert_function( refct_fnty, name=".numba_{}_decref${}".format(container_type, fe_type), ) builder = ir.IRBuilder(decref_fn.append_basic_block()) context.nrt.decref( builder, fe_type, datamodel.load_from_data_pointer(builder, decref_fn.args[0]), ) builder.ret_void() return incref_fn, decref_fn
def _get_incref_decref(context, module, datamodel, container_type): assert datamodel.contains_nrt_meminfo() fe_type = datamodel.fe_type data_ptr_ty = datamodel.get_data_type().as_pointer() refct_fnty = ir.FunctionType(ir.VoidType(), [data_ptr_ty]) incref_fn = module.get_or_insert_function( refct_fnty, name=".numba_{}_incref${}".format(container_type, fe_type), ) builder = ir.IRBuilder(incref_fn.append_basic_block()) context.nrt.incref(builder, fe_type, builder.load(incref_fn.args[0])) builder.ret_void() decref_fn = module.get_or_insert_function( refct_fnty, name=".numba_{}_decref${}".format(container_type, fe_type), ) builder = ir.IRBuilder(decref_fn.append_basic_block()) context.nrt.decref(builder, fe_type, builder.load(decref_fn.args[0])) builder.ret_void() return incref_fn, decref_fn
https://github.com/numba/numba/issues/4520
TypingError Traceback (most recent call last) <ipython-input-45-d29ae2daf2f2> in <module> ----> 1 l = numba.typed.List.empty_list(numba.typeof((0.0, "hello", True))) /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/typed/typedlist.py in empty_list(cls, item_type) 149 of the list . 150 """ --> 151 return cls(lsttype=ListType(item_type)) 152 153 def __init__(self, **kwargs): /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/typed/typedlist.py in __init__(self, **kwargs) 164 """ 165 if kwargs: --> 166 self._list_type, self._opaque = self._parse_arg(**kwargs) 167 else: 168 self._list_type = None /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/typed/typedlist.py in _parse_arg(self, lsttype, meminfo) 175 opaque = meminfo 176 else: --> 177 opaque = _make_list(lsttype.item_type) 178 return lsttype, opaque 179 /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 374 e.patch_message(msg) 375 --> 376 error_rewrite(e, 'typing') 377 except errors.UnsupportedError as e: 378 # Something unsupported is present in the user code, add help info /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/dispatcher.py in error_rewrite(e, issue_type) 341 raise e 342 else: --> 343 reraise(type(e), e, None) 344 345 argtypes = [] /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb) 656 value = tp() 657 if value.__traceback__ is not tb: --> 658 raise value.with_traceback(tb) 659 raise value 660 TypingError: Failed in nopython mode pipeline (step: nopython frontend) Invalid use of Function(<function new_list at 0x7f29d63d4510>) with argument(s) of type(s): (typeref[(unicode_type, bool)]) * parameterized In definition 0: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) expecting {{i8*, i64, i32, i32, i64, i8*, i8*}, i1} but got {{i8*, i64, i32, i32, i64, i8*, i8*}, i8} File "../../opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py", line 347: def imp(item): <source elided> lp = _list_new(itemty) _list_set_method_table(lp, itemty) ^ [1] During: lowering "$0.7 = call $0.4(lp, $0.6, func=$0.4, args=[Var(lp, /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py (346)), Var($0.6, /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py (347))], kws=(), vararg=None)" at /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py (347) raised from /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/six.py:659 In definition 1: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) expecting {{i8*, i64, i32, i32, i64, i8*, i8*}, i1} but got {{i8*, i64, i32, i32, i64, i8*, i8*}, i8} File "../../opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py", line 347: def imp(item): <source elided> lp = _list_new(itemty) _list_set_method_table(lp, itemty) ^ [1] During: lowering "$0.7 = call $0.4(lp, $0.6, func=$0.4, args=[Var(lp, /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py (346)), Var($0.6, /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py (347))], kws=(), vararg=None)" at /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/listobject.py (347) raised from /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/six.py:659 This error is usually caused by passing an argument of a type that is unsupported by the named function. [1] During: resolving callee type: Function(<function new_list at 0x7f29d63d4510>) [2] During: typing of call at /opt/anaconda/envs/test/lib/python3.7/site-packages/numba/typed/typedlist.py (29)
TypingError
def unicode_find(a, b): if isinstance(b, types.UnicodeType): def find_impl(a, b): return _find(substr=b, s=a) return find_impl if isinstance(b, types.UnicodeCharSeq): def find_impl(a, b): return a.find(str(b)) return find_impl
def unicode_find(a, b): if isinstance(b, types.UnicodeType): def find_impl(a, b): return _find(substr=b, s=a) return find_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def find_impl(a, b): return a.find(str(b))
def find_impl(a, b): return _find(substr=b, s=a)
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_startswith(a, b): if isinstance(b, types.UnicodeType): def startswith_impl(a, b): return _cmp_region(a, 0, b, 0, len(b)) == 0 return startswith_impl if isinstance(b, types.UnicodeCharSeq): def startswith_impl(a, b): return a.startswith(str(b)) return startswith_impl
def unicode_startswith(a, b): if isinstance(b, types.UnicodeType): def startswith_impl(a, b): return _cmp_region(a, 0, b, 0, len(b)) == 0 return startswith_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def startswith_impl(a, b): return a.startswith(str(b))
def startswith_impl(a, b): return _cmp_region(a, 0, b, 0, len(b)) == 0
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_endswith(a, b): if isinstance(b, types.UnicodeType): def endswith_impl(a, b): a_offset = len(a) - len(b) if a_offset < 0: return False return _cmp_region(a, a_offset, b, 0, len(b)) == 0 return endswith_impl if isinstance(b, types.UnicodeCharSeq): def endswith_impl(a, b): return a.endswith(str(b)) return endswith_impl
def unicode_endswith(a, b): if isinstance(b, types.UnicodeType): def endswith_impl(a, b): a_offset = len(a) - len(b) if a_offset < 0: return False return _cmp_region(a, a_offset, b, 0, len(b)) == 0 return endswith_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def endswith_impl(a, b): return a.endswith(str(b))
def endswith_impl(a, b): a_offset = len(a) - len(b) if a_offset < 0: return False return _cmp_region(a, a_offset, b, 0, len(b)) == 0
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_split(a, sep=None, maxsplit=-1): if not ( maxsplit == -1 or isinstance(maxsplit, (types.Omitted, types.Integer, types.IntegerLiteral)) ): return None # fail typing if maxsplit is not an integer if isinstance(sep, types.UnicodeCharSeq): def split_impl(a, sep, maxsplit=1): return a.split(str(sep), maxsplit=maxsplit) return split_impl if isinstance(sep, types.UnicodeType): def split_impl(a, sep, maxsplit=-1): a_len = len(a) sep_len = len(sep) if sep_len == 0: raise ValueError("empty separator") parts = [] last = 0 idx = 0 if sep_len == 1 and maxsplit == -1: sep_code_point = _get_code_point(sep, 0) for idx in range(a_len): if _get_code_point(a, idx) == sep_code_point: parts.append(a[last:idx]) last = idx + 1 else: split_count = 0 while idx < a_len and (maxsplit == -1 or split_count < maxsplit): if _cmp_region(a, idx, sep, 0, sep_len) == 0: parts.append(a[last:idx]) idx += sep_len last = idx split_count += 1 else: idx += 1 if last <= a_len: parts.append(a[last:]) return parts return split_impl elif ( sep is None or isinstance(sep, types.NoneType) or getattr(sep, "value", False) is None ): def split_whitespace_impl(a, sep=None, maxsplit=-1): a_len = len(a) parts = [] last = 0 idx = 0 split_count = 0 in_whitespace_block = True for idx in range(a_len): code_point = _get_code_point(a, idx) is_whitespace = _is_whitespace(code_point) if in_whitespace_block: if is_whitespace: pass # keep consuming space else: last = idx # this is the start of the next string in_whitespace_block = False else: if not is_whitespace: pass # keep searching for whitespace transition else: parts.append(a[last:idx]) in_whitespace_block = True split_count += 1 if maxsplit != -1 and split_count == maxsplit: break if last <= a_len and not in_whitespace_block: parts.append(a[last:]) return parts return split_whitespace_impl
def unicode_split(a, sep=None, maxsplit=-1): if not ( maxsplit == -1 or isinstance(maxsplit, (types.Omitted, types.Integer, types.IntegerLiteral)) ): return None # fail typing if maxsplit is not an integer if isinstance(sep, types.UnicodeType): def split_impl(a, sep, maxsplit=-1): a_len = len(a) sep_len = len(sep) if sep_len == 0: raise ValueError("empty separator") parts = [] last = 0 idx = 0 if sep_len == 1 and maxsplit == -1: sep_code_point = _get_code_point(sep, 0) for idx in range(a_len): if _get_code_point(a, idx) == sep_code_point: parts.append(a[last:idx]) last = idx + 1 else: split_count = 0 while idx < a_len and (maxsplit == -1 or split_count < maxsplit): if _cmp_region(a, idx, sep, 0, sep_len) == 0: parts.append(a[last:idx]) idx += sep_len last = idx split_count += 1 else: idx += 1 if last <= a_len: parts.append(a[last:]) return parts return split_impl elif ( sep is None or isinstance(sep, types.NoneType) or getattr(sep, "value", False) is None ): def split_whitespace_impl(a, sep=None, maxsplit=-1): a_len = len(a) parts = [] last = 0 idx = 0 split_count = 0 in_whitespace_block = True for idx in range(a_len): code_point = _get_code_point(a, idx) is_whitespace = _is_whitespace(code_point) if in_whitespace_block: if is_whitespace: pass # keep consuming space else: last = idx # this is the start of the next string in_whitespace_block = False else: if not is_whitespace: pass # keep searching for whitespace transition else: parts.append(a[last:idx]) in_whitespace_block = True split_count += 1 if maxsplit != -1 and split_count == maxsplit: break if last <= a_len and not in_whitespace_block: parts.append(a[last:]) return parts return split_whitespace_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_center(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def center_impl(string, width, fillchar): return string.center(width, str(fillchar)) return center_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def center_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string allmargin = width - str_len lmargin = (allmargin // 2) + (allmargin & width & 1) rmargin = allmargin - lmargin l_string = fillchar * lmargin if lmargin == rmargin: return l_string + string + l_string else: return l_string + string + (fillchar * rmargin) return center_impl
def unicode_center(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def center_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string allmargin = width - str_len lmargin = (allmargin // 2) + (allmargin & width & 1) rmargin = allmargin - lmargin l_string = fillchar * lmargin if lmargin == rmargin: return l_string + string + l_string else: return l_string + string + (fillchar * rmargin) return center_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def center_impl(string, width, fillchar): return string.center(width, str(fillchar))
def center_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string allmargin = width - str_len lmargin = (allmargin // 2) + (allmargin & width & 1) rmargin = allmargin - lmargin l_string = fillchar * lmargin if lmargin == rmargin: return l_string + string + l_string else: return l_string + string + (fillchar * rmargin)
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_ljust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def ljust_impl(string, width, fillchar): return string.ljust(width, str(fillchar)) return ljust_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def ljust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = string + (fillchar * (width - str_len)) return newstr return ljust_impl
def unicode_ljust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def ljust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = string + (fillchar * (width - str_len)) return newstr return ljust_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def ljust_impl(string, width, fillchar): return string.ljust(width, str(fillchar))
def ljust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = string + (fillchar * (width - str_len)) return newstr
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_rjust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if isinstance(fillchar, types.UnicodeCharSeq): def rjust_impl(string, width, fillchar): return string.rjust(width, str(fillchar)) return rjust_impl if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def rjust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = (fillchar * (width - str_len)) + string return newstr return rjust_impl
def unicode_rjust(string, width, fillchar=" "): if not isinstance(width, types.Integer): raise TypingError("The width must be an Integer") if not ( fillchar == " " or isinstance(fillchar, (types.Omitted, types.UnicodeType)) ): raise TypingError("The fillchar must be a UnicodeType") def rjust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = (fillchar * (width - str_len)) + string return newstr return rjust_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def rjust_impl(string, width, fillchar): return string.rjust(width, str(fillchar))
def rjust_impl(string, width, fillchar=" "): str_len = len(string) fillchar_len = len(fillchar) if fillchar_len != 1: raise ValueError("The fill character must be exactly one character long") if width <= str_len: return string newstr = (fillchar * (width - str_len)) + string return newstr
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_join(sep, parts): if isinstance(parts, types.List): if isinstance(parts.dtype, types.UnicodeType): def join_list_impl(sep, parts): return join_list(sep, parts) return join_list_impl elif isinstance(parts.dtype, types.UnicodeCharSeq): def join_list_impl(sep, parts): _parts = [str(p) for p in parts] return join_list(sep, _parts) return join_list_impl else: pass # lists of any other type not supported elif isinstance(parts, types.IterableType): def join_iter_impl(sep, parts): parts_list = [p for p in parts] return join_list(sep, parts_list) return join_iter_impl elif isinstance(parts, types.UnicodeType): # Temporary workaround until UnicodeType is iterable def join_str_impl(sep, parts): parts_list = [parts[i] for i in range(len(parts))] return join_list(sep, parts_list) return join_str_impl
def unicode_join(sep, parts): if isinstance(parts, types.List): if isinstance(parts.dtype, types.UnicodeType): def join_list_impl(sep, parts): return join_list(sep, parts) return join_list_impl else: pass # lists of any other type not supported elif isinstance(parts, types.IterableType): def join_iter_impl(sep, parts): parts_list = [p for p in parts] return join_list(sep, parts_list) return join_iter_impl elif isinstance(parts, types.UnicodeType): # Temporary workaround until UnicodeType is iterable def join_str_impl(sep, parts): parts_list = [parts[i] for i in range(len(parts))] return join_list(sep, parts_list) return join_str_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def join_list_impl(sep, parts): _parts = [str(p) for p in parts] return join_list(sep, _parts)
def join_list_impl(sep, parts): return join_list(sep, parts)
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_lstrip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def lstrip_impl(string, chars): return string.lstrip(str(chars)) return lstrip_impl unicode_strip_types_check(chars) def lstrip_impl(string, chars=None): return string[unicode_strip_left_bound(string, chars) :] return lstrip_impl
def unicode_lstrip(string, chars=None): unicode_strip_types_check(chars) def lstrip_impl(string, chars=None): return string[unicode_strip_left_bound(string, chars) :] return lstrip_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def lstrip_impl(string, chars): return string.lstrip(str(chars))
def lstrip_impl(string, chars=None): return string[unicode_strip_left_bound(string, chars) :]
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_rstrip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def rstrip_impl(string, chars): return string.rstrip(str(chars)) return rstrip_impl unicode_strip_types_check(chars) def rstrip_impl(string, chars=None): return string[: unicode_strip_right_bound(string, chars)] return rstrip_impl
def unicode_rstrip(string, chars=None): unicode_strip_types_check(chars) def rstrip_impl(string, chars=None): return string[: unicode_strip_right_bound(string, chars)] return rstrip_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def rstrip_impl(string, chars): return string.rstrip(str(chars))
def rstrip_impl(string, chars=None): return string[: unicode_strip_right_bound(string, chars)]
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_strip(string, chars=None): if isinstance(chars, types.UnicodeCharSeq): def strip_impl(string, chars): return string.strip(str(chars)) return strip_impl unicode_strip_types_check(chars) def strip_impl(string, chars=None): lb = unicode_strip_left_bound(string, chars) rb = unicode_strip_right_bound(string, chars) return string[lb:rb] return strip_impl
def unicode_strip(string, chars=None): unicode_strip_types_check(chars) def strip_impl(string, chars=None): lb = unicode_strip_left_bound(string, chars) rb = unicode_strip_right_bound(string, chars) return string[lb:rb] return strip_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def strip_impl(string, chars): return string.strip(str(chars))
def strip_impl(string, chars=None): lb = unicode_strip_left_bound(string, chars) rb = unicode_strip_right_bound(string, chars) return string[lb:rb]
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def unicode_concat(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def concat_impl(a, b): new_length = a._length + b._length new_kind = _pick_kind(a._kind, b._kind) new_ascii = _pick_ascii(a._is_ascii, b._is_ascii) result = _empty_string(new_kind, new_length, new_ascii) for i in range(len(a)): _set_code_point(result, i, _get_code_point(a, i)) for j in range(len(b)): _set_code_point(result, len(a) + j, _get_code_point(b, j)) return result return concat_impl if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeCharSeq): def concat_impl(a, b): return a + str(b) return concat_impl
def unicode_concat(a, b): if isinstance(a, types.UnicodeType) and isinstance(b, types.UnicodeType): def concat_impl(a, b): new_length = a._length + b._length new_kind = _pick_kind(a._kind, b._kind) new_ascii = _pick_ascii(a._is_ascii, b._is_ascii) result = _empty_string(new_kind, new_length, new_ascii) for i in range(len(a)): _set_code_point(result, i, _get_code_point(a, i)) for j in range(len(b)): _set_code_point(result, len(a) + j, _get_code_point(b, j)) return result return concat_impl
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def concat_impl(a, b): return a + str(b)
def concat_impl(a, b): new_length = a._length + b._length new_kind = _pick_kind(a._kind, b._kind) new_ascii = _pick_ascii(a._is_ascii, b._is_ascii) result = _empty_string(new_kind, new_length, new_ascii) for i in range(len(a)): _set_code_point(result, i, _get_code_point(a, i)) for j in range(len(b)): _set_code_point(result, len(a) + j, _get_code_point(b, j)) return result
https://github.com/numba/numba/issues/4416
Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1032, in lower_expr impl = self.context.get_function("static_getitem", signature) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 551, in get_function return self.get_function(fn, sig, _firstcall=False) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 553, in get_function raise NotImplementedError("No definition for lowering %s%s" % (key, sig)) NotImplementedError: No definition for lowering static_getitem(array([unichr x 1], 1d, C), Literal[int](0)) -> [unichr x 1] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pearu/git/Quansight/numba/numba/errors.py", line 662, in new_error_context yield File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 301, in lower_inst val = self.lower_assign(ty, inst) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 459, in lower_assign return self.lower_expr(ty, value) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 1041, in lower_expr expr.index_var, signature) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 600, in lower_getitem res = impl(self.builder, castvals) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1132, in __call__ res = self._imp(self._context, builder, self._sig, args, loc=loc) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 1157, in wrapper return fn(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 422, in getitem_arraynd_intp aryty, ary, (idxty,), (idx,)) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 406, in _getitem_array_generic return load_item(context, builder, aryty, dataptr) File "/home/pearu/git/Quansight/numba/numba/targets/arrayobj.py", line 127, in load_item align=align) File "/home/pearu/git/Quansight/numba/numba/targets/base.py", line 492, in unpack_value return dm.load_from_data_pointer(builder, ptr, align) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 87, in load_from_data_pointer return self.from_data(builder, builder.load(ptr, align=align)) File "/home/pearu/git/Quansight/numba/numba/datamodel/models.py", line 70, in from_data raise NotImplementedError(self) NotImplementedError: <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bug_lowering_unicodecharseq.py", line 8, in <module> foo(np.array(['a'])) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 395, in _compile_for_args raise e File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 352, in _compile_for_args return self.compile(tuple(argtypes)) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 693, in compile cres = self._compiler.compile(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 76, in compile status, retval = self._compile_cached(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 90, in _compile_cached retval = self._compile_core(args, return_type) File "/home/pearu/git/Quansight/numba/numba/dispatcher.py", line 108, in _compile_core pipeline_class=self.pipeline_class) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 972, in compile_extra return pipeline.compile_extra(func) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 390, in compile_extra return self._compile_bytecode() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 903, in _compile_bytecode return self._compile_core() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 890, in _compile_core res = pm.run(self.status) File "/home/pearu/git/Quansight/numba/numba/compiler_lock.py", line 32, in _acquire_compile_lock return func(*args, **kwargs) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 266, in run raise patched_exception File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 257, in run stage() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 764, in stage_nopython_backend self._backend(lowerfn, objectmode=False) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 703, in _backend lowered = lowerfn() File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 690, in backend_nopython_mode self.metadata) File "/home/pearu/git/Quansight/numba/numba/compiler.py", line 1143, in native_lowering_stage lower.lower() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 177, in lower self.lower_normal_function(self.fndesc) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 218, in lower_normal_function entry_block_tail = self.lower_function_body() File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 243, in lower_function_body self.lower_block(block) File "/home/pearu/git/Quansight/numba/numba/lowering.py", line 258, in lower_block self.lower_inst(inst) File "/home/pearu/mconda3/envs/numba-dev/lib/python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "/home/pearu/git/Quansight/numba/numba/errors.py", line 670, in new_error_context six.reraise(type(newerr), newerr, tb) File "/home/pearu/git/Quansight/numba/numba/six.py", line 659, in reraise raise value numba.errors.LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) <numba.datamodel.models.UnicodeCharSeq object at 0x7f8674a8c400> File "bug_lowering_unicodecharseq.py", line 6: def foo(x): return x[0] ^ [1] During: lowering "$0.3 = static_getitem(value=x, index=0, index_var=$const0.2)" at bug_lowering_unicodecharseq.py (6) ------------------------------------------------------------------------------- This should not have happened, a problem has occurred in Numba's internals. You are currently using Numba version 0.46.0dev0+43.g8b5726899.dirty.
NotImplementedError
def register_binary_operator_kernel(op, kernel, inplace=False): def lower_binary_operator(context, builder, sig, args): return numpy_ufunc_kernel( context, builder, sig, args, kernel, explicit_output=False ) def lower_inplace_operator(context, builder, sig, args): # The visible signature is (A, B) -> A # The implementation's signature (with explicit output) # is (A, B, A) -> A args = tuple(args) + (args[0],) sig = typing.signature(sig.return_type, *sig.args + (sig.args[0],)) return numpy_ufunc_kernel( context, builder, sig, args, kernel, explicit_output=True ) _any = types.Any _arr_kind = types.Array formal_sigs = [(_arr_kind, _arr_kind), (_any, _arr_kind), (_arr_kind, _any)] for sig in formal_sigs: if not inplace: lower(op, *sig)(lower_binary_operator) else: lower(op, *sig)(lower_inplace_operator)
def register_binary_operator_kernel(op, kernel, inplace=False): def lower_binary_operator(context, builder, sig, args): return numpy_ufunc_kernel( context, builder, sig, args, kernel, explicit_output=False ) def lower_inplace_operator(context, builder, sig, args): # The visible signature is (A, B) -> A # The implementation's signature (with explicit output) # is (A, B, A) -> A args = args + (args[0],) sig = typing.signature(sig.return_type, *sig.args + (sig.args[0],)) return numpy_ufunc_kernel( context, builder, sig, args, kernel, explicit_output=True ) _any = types.Any _arr_kind = types.Array formal_sigs = [(_arr_kind, _arr_kind), (_any, _arr_kind), (_arr_kind, _any)] for sig in formal_sigs: if not inplace: lower(op, *sig)(lower_binary_operator) else: lower(op, *sig)(lower_inplace_operator)
https://github.com/numba/numba/issues/4131
TypeError Traceback (most recent call last) ~/dev/numba/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 660 try: --> 661 yield 662 except NumbaError as e: ~/dev/numba/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 ~/dev/numba/numba/lowering.py in lower_inst(self, inst) 300 ty = self.typeof(inst.target.name) --> 301 val = self.lower_assign(ty, inst) 302 self.storevar(val, inst.target.name) ~/dev/numba/numba/lowering.py in lower_assign(self, ty, inst) 458 elif isinstance(value, ir.Expr): --> 459 return self.lower_expr(ty, value) 460 ~/dev/numba/numba/lowering.py in lower_expr(self, resty, expr) 917 elif expr.op == 'call': --> 918 res = self.lower_call(resty, expr) 919 return res ~/dev/numba/numba/lowering.py in lower_call(self, resty, expr) 710 else: --> 711 res = self._lower_call_normal(fnty, expr, signature) 712 ~/dev/numba/numba/lowering.py in _lower_call_normal(self, fnty, expr, signature) 889 --> 890 res = impl(self.builder, argvals, self.loc) 891 return res ~/dev/numba/numba/targets/base.py in __call__(self, builder, args, loc) 1131 def __call__(self, builder, args, loc=None): -> 1132 res = self._imp(self._context, builder, self._sig, args, loc=loc) 1133 self._context.add_linking_libs(getattr(self, 'libs', ())) ~/dev/numba/numba/targets/base.py in wrapper(*args, **kwargs) 1156 kwargs.pop('loc') # drop unused loc -> 1157 return fn(*args, **kwargs) 1158 ~/dev/numba/numba/targets/npyimpl.py in lower_inplace_operator(context, builder, sig, args) 497 # is (A, B, A) -> A --> 498 args = args + (args[0],) 499 sig = typing.signature(sig.return_type, *sig.args + (sig.args[0],)) TypeError: can only concatenate list (not "tuple") to list During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-5-a36eda57cdc1> in <module> ----> 1 f(A) ~/dev/numba/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 368 e.patch_message(''.join(e.args) + help_msg) 369 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 370 raise e 371 372 def inspect_llvm(self, signature=None): ~/dev/numba/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 325 argtypes.append(self.typeof_pyval(a)) 326 try: --> 327 return self.compile(tuple(argtypes)) 328 except errors.TypingError as e: 329 # Intercept typing error that may be due to an argument ~/dev/numba/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/dev/numba/numba/dispatcher.py in compile(self, sig) 657 658 self._cache_misses[sig] += 1 --> 659 cres = self._compiler.compile(args, return_type) 660 self.add_overload(cres) 661 self._cache.save_overload(sig, cres) ~/dev/numba/numba/dispatcher.py in compile(self, args, return_type) 81 args=args, return_type=return_type, 82 flags=flags, locals=self.locals, ---> 83 pipeline_class=self.pipeline_class) 84 # Check typing error if object mode is used 85 if cres.typing_error is not None and not flags.enable_pyobject: ~/dev/numba/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 953 pipeline = pipeline_class(typingctx, targetctx, library, 954 args, return_type, flags, locals) --> 955 return pipeline.compile_extra(func) 956 957 ~/dev/numba/numba/compiler.py in compile_extra(self, func) 375 self.lifted = () 376 self.lifted_from = None --> 377 return self._compile_bytecode() 378 379 def compile_ir(self, func_ir, lifted=(), lifted_from=None): ~/dev/numba/numba/compiler.py in _compile_bytecode(self) 884 """ 885 assert self.func_ir is None --> 886 return self._compile_core() 887 888 def _compile_ir(self): ~/dev/numba/numba/compiler.py in _compile_core(self) 871 self.define_pipelines(pm) 872 pm.finalize() --> 873 res = pm.run(self.status) 874 if res is not None: 875 # Early pipeline completion ~/dev/numba/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/dev/numba/numba/compiler.py in run(self, status) 252 # No more fallback pipelines? 253 if is_final_pipeline: --> 254 raise patched_exception 255 # Go to next fallback pipeline 256 else: ~/dev/numba/numba/compiler.py in run(self, status) 243 try: 244 event("-- %s" % stage_name) --> 245 stage() 246 except _EarlyPipelineCompletion as e: 247 return e.result ~/dev/numba/numba/compiler.py in stage_nopython_backend(self) 745 """ 746 lowerfn = self.backend_nopython_mode --> 747 self._backend(lowerfn, objectmode=False) 748 749 def stage_compile_interp_mode(self): ~/dev/numba/numba/compiler.py in _backend(self, lowerfn, objectmode) 685 self.library.enable_object_caching() 686 --> 687 lowered = lowerfn() 688 signature = typing.signature(self.return_type, *self.args) 689 self.cr = compile_result( ~/dev/numba/numba/compiler.py in backend_nopython_mode(self) 672 self.calltypes, 673 self.flags, --> 674 self.metadata) 675 676 def _backend(self, lowerfn, objectmode): ~/dev/numba/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1122 lower = lowering.Lower(targetctx, library, fndesc, interp, 1123 metadata=metadata) -> 1124 lower.lower() 1125 if not flags.no_cpython_wrapper: 1126 lower.create_cpython_wrapper(flags.release_gil) ~/dev/numba/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) ~/dev/numba/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block ~/dev/numba/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() ~/dev/numba/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): ~/dev/miniconda3/envs/DEV/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that ~/dev/numba/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 667 from numba import config 668 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 669 six.reraise(type(newerr), newerr, tb) 670 671 ~/dev/numba/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) can only concatenate list (not "tuple") to list File "<ipython-input-4-a98347f692b7>", line 3: def f(A): return operator.iadd(A, A) ^ [1] During: lowering "$0.5 = call $0.2(A, A, func=$0.2, args=[Var(A, <ipython-input-4-a98347f692b7> (3)), Var(A, <ipython-input-4-a98347f692b7> (3))], kws=(), vararg=None)" at <ipython-input-4-a98347f692b7> (3)
TypeError
def lower_inplace_operator(context, builder, sig, args): # The visible signature is (A, B) -> A # The implementation's signature (with explicit output) # is (A, B, A) -> A args = tuple(args) + (args[0],) sig = typing.signature(sig.return_type, *sig.args + (sig.args[0],)) return numpy_ufunc_kernel(context, builder, sig, args, kernel, explicit_output=True)
def lower_inplace_operator(context, builder, sig, args): # The visible signature is (A, B) -> A # The implementation's signature (with explicit output) # is (A, B, A) -> A args = args + (args[0],) sig = typing.signature(sig.return_type, *sig.args + (sig.args[0],)) return numpy_ufunc_kernel(context, builder, sig, args, kernel, explicit_output=True)
https://github.com/numba/numba/issues/4131
TypeError Traceback (most recent call last) ~/dev/numba/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 660 try: --> 661 yield 662 except NumbaError as e: ~/dev/numba/numba/lowering.py in lower_block(self, block) 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 ~/dev/numba/numba/lowering.py in lower_inst(self, inst) 300 ty = self.typeof(inst.target.name) --> 301 val = self.lower_assign(ty, inst) 302 self.storevar(val, inst.target.name) ~/dev/numba/numba/lowering.py in lower_assign(self, ty, inst) 458 elif isinstance(value, ir.Expr): --> 459 return self.lower_expr(ty, value) 460 ~/dev/numba/numba/lowering.py in lower_expr(self, resty, expr) 917 elif expr.op == 'call': --> 918 res = self.lower_call(resty, expr) 919 return res ~/dev/numba/numba/lowering.py in lower_call(self, resty, expr) 710 else: --> 711 res = self._lower_call_normal(fnty, expr, signature) 712 ~/dev/numba/numba/lowering.py in _lower_call_normal(self, fnty, expr, signature) 889 --> 890 res = impl(self.builder, argvals, self.loc) 891 return res ~/dev/numba/numba/targets/base.py in __call__(self, builder, args, loc) 1131 def __call__(self, builder, args, loc=None): -> 1132 res = self._imp(self._context, builder, self._sig, args, loc=loc) 1133 self._context.add_linking_libs(getattr(self, 'libs', ())) ~/dev/numba/numba/targets/base.py in wrapper(*args, **kwargs) 1156 kwargs.pop('loc') # drop unused loc -> 1157 return fn(*args, **kwargs) 1158 ~/dev/numba/numba/targets/npyimpl.py in lower_inplace_operator(context, builder, sig, args) 497 # is (A, B, A) -> A --> 498 args = args + (args[0],) 499 sig = typing.signature(sig.return_type, *sig.args + (sig.args[0],)) TypeError: can only concatenate list (not "tuple") to list During handling of the above exception, another exception occurred: LoweringError Traceback (most recent call last) <ipython-input-5-a36eda57cdc1> in <module> ----> 1 f(A) ~/dev/numba/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 368 e.patch_message(''.join(e.args) + help_msg) 369 # ignore the FULL_TRACEBACKS config, this needs reporting! --> 370 raise e 371 372 def inspect_llvm(self, signature=None): ~/dev/numba/numba/dispatcher.py in _compile_for_args(self, *args, **kws) 325 argtypes.append(self.typeof_pyval(a)) 326 try: --> 327 return self.compile(tuple(argtypes)) 328 except errors.TypingError as e: 329 # Intercept typing error that may be due to an argument ~/dev/numba/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/dev/numba/numba/dispatcher.py in compile(self, sig) 657 658 self._cache_misses[sig] += 1 --> 659 cres = self._compiler.compile(args, return_type) 660 self.add_overload(cres) 661 self._cache.save_overload(sig, cres) ~/dev/numba/numba/dispatcher.py in compile(self, args, return_type) 81 args=args, return_type=return_type, 82 flags=flags, locals=self.locals, ---> 83 pipeline_class=self.pipeline_class) 84 # Check typing error if object mode is used 85 if cres.typing_error is not None and not flags.enable_pyobject: ~/dev/numba/numba/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class) 953 pipeline = pipeline_class(typingctx, targetctx, library, 954 args, return_type, flags, locals) --> 955 return pipeline.compile_extra(func) 956 957 ~/dev/numba/numba/compiler.py in compile_extra(self, func) 375 self.lifted = () 376 self.lifted_from = None --> 377 return self._compile_bytecode() 378 379 def compile_ir(self, func_ir, lifted=(), lifted_from=None): ~/dev/numba/numba/compiler.py in _compile_bytecode(self) 884 """ 885 assert self.func_ir is None --> 886 return self._compile_core() 887 888 def _compile_ir(self): ~/dev/numba/numba/compiler.py in _compile_core(self) 871 self.define_pipelines(pm) 872 pm.finalize() --> 873 res = pm.run(self.status) 874 if res is not None: 875 # Early pipeline completion ~/dev/numba/numba/compiler_lock.py in _acquire_compile_lock(*args, **kwargs) 30 def _acquire_compile_lock(*args, **kwargs): 31 with self: ---> 32 return func(*args, **kwargs) 33 return _acquire_compile_lock 34 ~/dev/numba/numba/compiler.py in run(self, status) 252 # No more fallback pipelines? 253 if is_final_pipeline: --> 254 raise patched_exception 255 # Go to next fallback pipeline 256 else: ~/dev/numba/numba/compiler.py in run(self, status) 243 try: 244 event("-- %s" % stage_name) --> 245 stage() 246 except _EarlyPipelineCompletion as e: 247 return e.result ~/dev/numba/numba/compiler.py in stage_nopython_backend(self) 745 """ 746 lowerfn = self.backend_nopython_mode --> 747 self._backend(lowerfn, objectmode=False) 748 749 def stage_compile_interp_mode(self): ~/dev/numba/numba/compiler.py in _backend(self, lowerfn, objectmode) 685 self.library.enable_object_caching() 686 --> 687 lowered = lowerfn() 688 signature = typing.signature(self.return_type, *self.args) 689 self.cr = compile_result( ~/dev/numba/numba/compiler.py in backend_nopython_mode(self) 672 self.calltypes, 673 self.flags, --> 674 self.metadata) 675 676 def _backend(self, lowerfn, objectmode): ~/dev/numba/numba/compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata) 1122 lower = lowering.Lower(targetctx, library, fndesc, interp, 1123 metadata=metadata) -> 1124 lower.lower() 1125 if not flags.no_cpython_wrapper: 1126 lower.create_cpython_wrapper(flags.release_gil) ~/dev/numba/numba/lowering.py in lower(self) 175 if self.generator_info is None: 176 self.genlower = None --> 177 self.lower_normal_function(self.fndesc) 178 else: 179 self.genlower = self.GeneratorLower(self) ~/dev/numba/numba/lowering.py in lower_normal_function(self, fndesc) 216 # Init argument values 217 self.extract_function_arguments() --> 218 entry_block_tail = self.lower_function_body() 219 220 # Close tail of entry block ~/dev/numba/numba/lowering.py in lower_function_body(self) 241 bb = self.blkmap[offset] 242 self.builder.position_at_end(bb) --> 243 self.lower_block(block) 244 245 self.post_lower() ~/dev/numba/numba/lowering.py in lower_block(self, block) 256 with new_error_context('lowering "{inst}" at {loc}', inst=inst, 257 loc=self.loc, errcls_=defaulterrcls): --> 258 self.lower_inst(inst) 259 260 def create_cpython_wrapper(self, release_gil=False): ~/dev/miniconda3/envs/DEV/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 128 value = type() 129 try: --> 130 self.gen.throw(type, value, traceback) 131 except StopIteration as exc: 132 # Suppress StopIteration *unless* it's the same exception that ~/dev/numba/numba/errors.py in new_error_context(fmt_, *args, **kwargs) 667 from numba import config 668 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None --> 669 six.reraise(type(newerr), newerr, tb) 670 671 ~/dev/numba/numba/six.py in reraise(tp, value, tb) 657 if value.__traceback__ is not tb: 658 raise value.with_traceback(tb) --> 659 raise value 660 661 else: LoweringError: Failed in nopython mode pipeline (step: nopython mode backend) can only concatenate list (not "tuple") to list File "<ipython-input-4-a98347f692b7>", line 3: def f(A): return operator.iadd(A, A) ^ [1] During: lowering "$0.5 = call $0.2(A, A, func=$0.2, args=[Var(A, <ipython-input-4-a98347f692b7> (3)), Var(A, <ipython-input-4-a98347f692b7> (3))], kws=(), vararg=None)" at <ipython-input-4-a98347f692b7> (3)
TypeError
def _get_or_create_context_uncached(self, devnum): """See also ``get_or_create_context(devnum)``. This version does not read the cache. """ with self._lock: # Try to get the active context in the CUDA stack or # activate GPU-0 with the primary context with driver.get_active_context() as ac: if not ac: return self._activate_context_for(0) else: # Get primary context for the active device ctx = self.gpus[ac.devnum].get_primary_context() # Is active context the primary context? if ctx.handle.value != ac.context_handle.value: msg = "Numba cannot operate on non-primary CUDA context {:x}" raise RuntimeError(msg.format(ac.context_handle.value)) # Ensure the context is ready ctx.prepare_for_use() return ctx
def _get_or_create_context_uncached(self, devnum): """See also ``get_or_create_context(devnum)``. This version does not read the cache. """ with self._lock: # Try to get the active context in the CUDA stack or # activate GPU-0 with the primary context with driver.get_active_context() as ac: if not ac: return self._activate_context_for(0) else: # Get primary context for the active device ctx = self.gpus[ac.devnum].get_primary_context() # Is active context the primary context? if ctx.handle.value != ac.context_handle.value: msg = "Numba cannot operate on non-primary CUDA context {:x}" raise RuntimeError(msg.format(ac.context_handle.value)) return ctx
https://github.com/numba/numba/issues/4352
Traceback (most recent call last): File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 745, in _exitfunc f() File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 669, in __call__ return info.func(*info.args, **(info.kwargs or {})) File "/conda/envs/gdf/lib/python3.6/site-packages/numba/cuda/cudadrv/driver.py", line 1037, in core dealloc.add_item(module_unload, handle) AttributeError: 'NoneType' object has no attribute 'add_item'
AttributeError
def push(self): """ Pushes this context on the current CPU Thread. """ driver.cuCtxPushCurrent(self.handle) self.prepare_for_use()
def push(self): """ Pushes this context on the current CPU Thread. """ driver.cuCtxPushCurrent(self.handle) # setup *deallocations* as the context becomes active for the first time if self.deallocations is None: self.deallocations = _PendingDeallocs(self.get_memory_info().total)
https://github.com/numba/numba/issues/4352
Traceback (most recent call last): File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 745, in _exitfunc f() File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 669, in __call__ return info.func(*info.args, **(info.kwargs or {})) File "/conda/envs/gdf/lib/python3.6/site-packages/numba/cuda/cudadrv/driver.py", line 1037, in core dealloc.add_item(module_unload, handle) AttributeError: 'NoneType' object has no attribute 'add_item'
AttributeError
def _module_finalizer(context, handle): dealloc = context.deallocations modules = context.modules def core(): shutting_down = utils.shutting_down # early bind def module_unload(handle): # If we are not shutting down, we must be called due to # Context.reset() of Context.unload_module(). Both must have # cleared the module reference from the context. assert shutting_down() or handle.value not in modules driver.cuModuleUnload(handle) if dealloc is not None: dealloc.add_item(module_unload, handle) else: # Check the impossible case. assert shutting_down(), ( "dealloc is None but interpreter is not being shutdown!" ) return core
def _module_finalizer(context, handle): dealloc = context.deallocations modules = context.modules def core(): shutting_down = utils.shutting_down # early bind def module_unload(handle): # If we are not shutting down, we must be called due to # Context.reset() of Context.unload_module(). Both must have # cleared the module reference from the context. assert shutting_down() or handle.value not in modules driver.cuModuleUnload(handle) dealloc.add_item(module_unload, handle) return core
https://github.com/numba/numba/issues/4352
Traceback (most recent call last): File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 745, in _exitfunc f() File "/conda/envs/gdf/lib/python3.6/site-packages/numba/utils.py", line 669, in __call__ return info.func(*info.args, **(info.kwargs or {})) File "/conda/envs/gdf/lib/python3.6/site-packages/numba/cuda/cudadrv/driver.py", line 1037, in core dealloc.add_item(module_unload, handle) AttributeError: 'NoneType' object has no attribute 'add_item'
AttributeError