You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an issue stub to track support for NumPy 1.25. Anticipated release date (guessing based on previous release cadence) will be sometime near the middle of 2023.
Performed an initial test with 1.25rc0 from pip and llvmlite from conda on x86-64 Ubuntu Linux with Python 3.11 coming from conda. Running the test suite using NUMPY_EXPERIMENTAL_DTYPE_API=1 python runtests.py -m 11 produced failures in the following tests:
Fancy indexing (numba.tests.test_fancy_indexing.TestFancyIndexingMultiDim.test_getitem) all produced errors similar to
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/tests/test_fancy_indexing.py", line 449, in test_getitem
self.check_getitem_indices(self.shape, idx)
File "/home/andre/workspace/numba/numba/tests/test_fancy_indexing.py", line 409, in check_getitem_indices
self.assertNotIn(expected.base, orig_base)
File "/home/andre/miniconda3/envs/numpy1.25/lib/python3.11/unittest/case.py", line 1144, in assertNotIn
if member in container:
^^^^^^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (5,6,7,8,9,10) (5,1,9,10)
This test is repeated many times with different parameters, but they all fail in the same way.
ufuncs and comparison operators (numba.tests.test_ufuncs.TestLoopTypesInt.test_equal_Qq_?, numba.tests.test_ufuncs.TestLoopTypesInt.test_greater_Qq_?, numba.tests.test_ufuncs.TestLoopTypesInt.test_greater_equal_Qq_?, numba.tests.test_ufuncs.TestLoopTypesInt.test_greater_qQ_?, numba.tests.test_ufuncs.TestLoopTypesInt.test_less_Qq_?, numba.tests.test_ufuncs.TestLoopTypesInt.test_less_equal_qQ_?, numba.tests.test_ufuncs.TestLoopTypesInt.test_not_equal_Qq_?)
This is for equals, but the other are similar:
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/core/typeinfer.py", line 155, in propagate
constraint(typeinfer)
File "/home/andre/workspace/numba/numba/core/typeinfer.py", line 578, in __call__
self.resolve(typeinfer, typevars, fnty)
File "/home/andre/workspace/numba/numba/core/typeinfer.py", line 601, in resolve
sig = typeinfer.resolve_call(fnty, pos_args, kw_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typeinfer.py", line 1557, in resolve_call
return self.context.resolve_function_type(fnty, pos_args, kw_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typing/context.py", line 213, in resolve_function_type
raise last_exception
File "/home/andre/workspace/numba/numba/core/typing/context.py", line 196, in resolve_function_type
res = self._resolve_user_function_type(func, args, kws)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typing/context.py", line 248, in _resolve_user_function_type
return func.get_call_type(self, args, kws)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/types/functions.py", line 331, in get_call_type
failures.raise_error()
File "/home/andre/workspace/numba/numba/core/types/functions.py", line 227, in raise_error
raise errors.TypingError(self.format())
numba.core.errors.TypingError: No implementation of function Function(<ufunc 'equal'>) found for signature:
>>> equal(array(uint64, 1d, C), array(int64, 1d, C), array(bool, 1d, C))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'Numpy_rules_ufunc.generic': File: numba/core/typing/npydecl.py: Line 97.
With argument(s): '(array(uint64, 1d, C), array(int64, 1d, C), array(bool, 1d, C))':
Rejected as the implementation raised a specific error:
TypingError: ufunc 'equal' using the loop 'Qq->?' not supported in this mode
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/core/types/functions.py", line 308, in get_call_type
sig = temp.apply(nolitargs, nolitkws)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typing/templates.py", line 351, in apply
sig = generic(args, kws)
^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typing/npydecl.py", line 111, in generic
raise TypingError(msg=msg.format(ufunc.__name__, ufunc_loop.ufunc_sig))
numba.core.errors.TypingError: ufunc 'equal' using the loop 'Qq->?' not supported in this mode
raised from /home/andre/workspace/numba/numba/core/typing/npydecl.py:111
During: resolving callee type: Function(<ufunc 'equal'>)
During: typing of call at <string> (2)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/tests/test_ufuncs.py", line 1472, in test_template
self._check_loop(fn, ufunc, loop)
File "/home/andre/workspace/numba/numba/tests/test_ufuncs.py", line 1418, in _check_loop
self._check_ufunc_with_dtypes(fn, ufunc, letter_types)
File "/home/andre/workspace/numba/numba/tests/test_ufuncs.py", line 1434, in _check_ufunc_with_dtypes
cfunc = njit(arg_nbty)(fn)
^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/decorators.py", line 241, in wrapper
disp.compile(sig)
File "/home/andre/workspace/numba/numba/core/dispatcher.py", line 965, in compile
cres = self._compiler.compile(args, return_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/dispatcher.py", line 129, in compile
raise retval
File "/home/andre/workspace/numba/numba/core/dispatcher.py", line 139, in _compile_cached
retval = self._compile_core(args, return_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/dispatcher.py", line 152, in _compile_core
cres = compiler.compile_extra(self.targetdescr.typing_context,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/compiler.py", line 762, in compile_extra
return pipeline.compile_extra(func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/compiler.py", line 460, in compile_extra
return self._compile_bytecode()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/compiler.py", line 528, in _compile_bytecode
return self._compile_core()
^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/compiler.py", line 507, in _compile_core
raise e
File "/home/andre/workspace/numba/numba/core/compiler.py", line 494, in _compile_core
pm.run(self.state)
File "/home/andre/workspace/numba/numba/core/compiler_machinery.py", line 368, in run
raise patched_exception
File "/home/andre/workspace/numba/numba/core/compiler_machinery.py", line 356, in run
self._runPass(idx, pass_inst, state)
File "/home/andre/workspace/numba/numba/core/compiler_lock.py", line 35, in _acquire_compile_lock
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/compiler_machinery.py", line 311, in _runPass
mutated |= check(pss.run_pass, internal_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/compiler_machinery.py", line 273, in check
mangled = func(compiler_state)
^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typed_passes.py", line 110, in run_pass
typemap, return_type, calltypes, errs = type_inference_stage(
^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typed_passes.py", line 88, in type_inference_stage
errs = infer.propagate(raise_errors=raise_errors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typeinfer.py", line 1086, in propagate
raise errors[0]
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<ufunc 'equal'>) found for signature:
>>> equal(array(uint64, 1d, C), array(int64, 1d, C), array(bool, 1d, C))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'Numpy_rules_ufunc.generic': File: numba/core/typing/npydecl.py: Line 97.
With argument(s): '(array(uint64, 1d, C), array(int64, 1d, C), array(bool, 1d, C))':
Rejected as the implementation raised a specific error:
TypingError: ufunc 'equal' using the loop 'Qq->?' not supported in this mode
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/core/types/functions.py", line 308, in get_call_type
sig = temp.apply(nolitargs, nolitkws)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typing/templates.py", line 351, in apply
sig = generic(args, kws)
^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/core/typing/npydecl.py", line 111, in generic
raise TypingError(msg=msg.format(ufunc.__name__, ufunc_loop.ufunc_sig))
numba.core.errors.TypingError: ufunc 'equal' using the loop 'Qq->?' not supported in this mode
raised from /home/andre/workspace/numba/numba/core/typing/npydecl.py:111
During: resolving callee type: Function(<ufunc 'equal'>)
During: typing of call at <string> (2)
File "<string>", line 2:
<source missing, REPL/exec in use?>
Numeric differences
======================================================================
FAIL: test_explicit_output (numba.tests.test_array_exprs.TestArrayExpressions.test_explicit_output)
Check that ufunc calls with explicit outputs are not rewritten.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/tests/test_array_exprs.py", line 387, in test_explicit_output
ns = self._test_explicit_output_function(explicit_output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/tests/test_array_exprs.py", line 247, in _test_explicit_output_function
self.assertPreciseEqual(expected, run_func(control_cfunc))
File "/home/andre/workspace/numba/numba/tests/support.py", line 431, in assertPreciseEqual
self.fail("when comparing %s and %s: %s" % (first, second, failure_msg))
AssertionError: when comparing [2. 2.54030231 2.58385316 3.0100075 4.34635638 6.28366219
7.96017029 8.75390225 8.85449997 9.08886974] and [2. 2.54030231 2.58385316 3.0100075 4.34635638 6.28366219
7.96017029 8.75390225 8.85449997 9.08886974]: 8.753902254343306 != 8.753902254343304
======================================================================
FAIL: test_index_ufunc (numba.tests.test_extending.TestPandasLike.test_index_ufunc)
Check Numpy ufunc on an Index object.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/tests/test_extending.py", line 641, in test_index_ufunc
self.assertPreciseEqual(ii._data, np.cos(np.sin(i._data)))
File "/home/andre/workspace/numba/numba/tests/support.py", line 431, in assertPreciseEqual
self.fail("when comparing %s and %s: %s" % (first, second, failure_msg))
AssertionError: when comparing [0.60858395 0.54922627 0.57440088] and [0.60858395 0.54922627 0.57440088]: 0.549226270051226 != 0.5492262700512262
======================================================================
FAIL: test_series_ufunc (numba.tests.test_extending.TestPandasLike.test_series_ufunc)
Check Numpy ufunc on an Series object.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/tests/test_extending.py", line 688, in test_series_ufunc
self.assertPreciseEqual(ss._values, np.cos(np.sin(s._values)))
File "/home/andre/workspace/numba/numba/tests/support.py", line 431, in assertPreciseEqual
self.fail("when comparing %s and %s: %s" % (first, second, failure_msg))
AssertionError: when comparing [0.66636675 0.61430028 0.99005909] and [0.66636675 0.61430028 0.99005909]: 0.9900590857598653 != 0.9900590857598652
Running python runtests.py -m 11 without the NUMPY_EXPERIMENTAL_DTYPE_API environment variables yields:
RuntimeError: The new DType API is currently in an exploratory phase and should NOT be used for production code. Expect modifications and crashes! To experiment with the new API you must set `NUMPY_EXPERIMENTAL_DTYPE_API=1` as an environment variable.
Traceback (most recent call last):
File "/home/andre/workspace/numba/numba/testing/__init__.py", line 29, in load_testsuite
suite.addTests(loader.loadTestsFromName(f))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/miniconda3/envs/numpy1.25/lib/python3.11/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/andre/workspace/numba/numba/tests/npyufunc/test_gufunc.py", line 5, in <module>
import numpy.core.umath_tests as ut
File "/home/andre/miniconda3/envs/numpy1.25/lib/python3.11/site-packages/numpy/core/umath_tests.py", line 13, in <module>
from ._umath_tests import *
RuntimeError: cannot load _umath_tests module.
Activity
apmasell commentedon Jun 8, 2023
Performed an initial test with 1.25rc0 from pip and llvmlite from conda on x86-64 Ubuntu Linux with Python 3.11 coming from conda. Running the test suite using
NUMPY_EXPERIMENTAL_DTYPE_API=1 python runtests.py -m 11produced failures in the following tests:numba.tests.test_fancy_indexing.TestFancyIndexingMultiDim.test_getitem) all produced errors similar toThis test is repeated many times with different parameters, but they all fail in the same way.
numba.tests.test_ufuncs.TestLoopTypesInt.test_equal_Qq_?,numba.tests.test_ufuncs.TestLoopTypesInt.test_greater_Qq_?,numba.tests.test_ufuncs.TestLoopTypesInt.test_greater_equal_Qq_?,numba.tests.test_ufuncs.TestLoopTypesInt.test_greater_qQ_?,numba.tests.test_ufuncs.TestLoopTypesInt.test_less_Qq_?,numba.tests.test_ufuncs.TestLoopTypesInt.test_less_equal_qQ_?,numba.tests.test_ufuncs.TestLoopTypesInt.test_not_equal_Qq_?)This is for equals, but the other are similar:
I've omitted a number of parallel/parfors tests that I think are due to my environment.
apmasell commentedon Jun 9, 2023
Running
python runtests.py -m 11without theNUMPY_EXPERIMENTAL_DTYPE_APIenvironment variables yields:apmasell commentedon Jun 12, 2023
These bugs are fixed in #9011
esc commentedon Jun 27, 2023
This work (the PR at #9011) is now scheduled for inclusion in 0.58.
esc commentedon Aug 1, 2023
#9105 was merged and this can now be closed.