Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into guilhermeleobas/arr…
Browse files Browse the repository at this point in the history
…_ravel
  • Loading branch information
guilhermeleobas committed Nov 8, 2022
2 parents fa69396 + 0413a91 commit 52bdecb
Show file tree
Hide file tree
Showing 44 changed files with 2,817 additions and 1,867 deletions.
1 change: 0 additions & 1 deletion .flake8
Expand Up @@ -170,7 +170,6 @@ exclude =
numba/tests/test_enums.py
numba/tests/test_profiler.py
numba/tests/test_numpyadapt.py
numba/tests/test_stencils.py
numba/tests/cache_usecases.py
numba/tests/true_div_usecase.py
numba/tests/test_dataflow.py
Expand Down
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/first_rc_checklist.md
Expand Up @@ -17,10 +17,16 @@ labels: task
* [ ] Merge change log changes.
- [ ] "PR with changelog entries".
* [ ] Create X.Y release branch.
* [ ] Create PR against the release branch to make `numba/testing/main.py`
to refer to `origin/releaseX.Y` instead of `origin/main`.
* [ ] Dependency version pinning on release branch
* [ ] Pin llvmlite to `>=0.A.0rc1,<0.A+1.0`.
* [ ] Pin NumPy if needed
* [ ] Pin TBB if needed
* [ ] Run the HEAD of the release branch through the build farm and confirm:
* [ ] Build farm CPU testing has passed.
* [ ] Build farm CUDA testing has passed.
* [ ] Build farm wheel testing has passed.
* [ ] Annotated tag `X.Y.Zrc1` on release branch (no `v` prefix).
* [ ] Build and upload conda packages on buildfarm (check "upload").
* [ ] Build wheels and sdist on the buildfarm (check "upload").
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/sub_rc_checklist.md
Expand Up @@ -20,6 +20,10 @@ labels: task
* [ ] Merge change log modifications and cherry-picks to X.Y release branch.
* [ ] https://github.com/numba/numba/pull/XXXX
* [ ] Review, merge and check execution of release notebook. (FINAL ONLY)
* [ ] Run the HEAD of the release branch through the build farm and confirm:
* [ ] Build farm CPU testing has passed.
* [ ] Build farm CUDA testing has passed
* [ ] Build farm wheel testing has passed
* [ ] Annotated tag X.Y.Z on release branch (no `v` prefix).
* [ ] Build and upload conda packages on buildfarm (check `upload`).
* [ ] Build wheels and sdist on the buildfarm (check "upload").
Expand Down
40 changes: 40 additions & 0 deletions CHANGE_LOG
@@ -1,3 +1,43 @@
Version 0.56.4 (3 November, 2022)
---------------------------------

This is a bugfix release to fix a regression in the CUDA target in relation to
the ``.view()`` method on CUDA device arrays that is present when using NumPy
version 1.23.0 or later.

Pull-Requests:

* PR `#8537 <https://github.com/numba/numba/pull/8537>`_: Make ol_compatible_view accessible on all targets (`gmarkall <https://github.com/gmarkall>`_)
* PR `#8552 <https://github.com/numba/numba/pull/8552>`_: Update version support table for 0.56.4. (`stuartarchibald <https://github.com/stuartarchibald>`_)
* PR `#8553 <https://github.com/numba/numba/pull/8553>`_: Update CHANGE_LOG for 0.56.4 (`stuartarchibald <https://github.com/stuartarchibald>`_)
* PR `#8570 <https://github.com/numba/numba/pull/8570>`_: Release 0.56 branch: Fix overloads with ``target="generic"`` for CUDA (`gmarkall <https://github.com/gmarkall>`_)
* PR `#8571 <https://github.com/numba/numba/pull/8571>`_: Additional update to CHANGE_LOG for 0.56.4 (`stuartarchibald <https://github.com/stuartarchibald>`_)

Authors:

* `gmarkall <https://github.com/gmarkall>`_
* `stuartarchibald <https://github.com/stuartarchibald>`_

Version 0.56.3 (13 October, 2022)
---------------------------------

This is a bugfix release to remove the version restriction applied to the
``setuptools`` package and to fix a bug in the CUDA target in relation to
copying zero length device arrays to zero length host arrays.

Pull-Requests:

* PR `#8475 <https://github.com/numba/numba/pull/8475>`_: Remove setuptools version pin (`gmarkall <https://github.com/gmarkall>`_)
* PR `#8482 <https://github.com/numba/numba/pull/8482>`_: Fix #8477: Allow copies with different strides for 0-length data (`gmarkall <https://github.com/gmarkall>`_)
* PR `#8486 <https://github.com/numba/numba/pull/8486>`_: Restrict the TBB development package to supported version in Azure. (`stuartarchibald <https://github.com/stuartarchibald>`_)
* PR `#8503 <https://github.com/numba/numba/pull/8503>`_: Update version support table for 0.56.3 (`stuartarchibald <https://github.com/stuartarchibald>`_)
* PR `#8504 <https://github.com/numba/numba/pull/8504>`_: Update CHANGE_LOG for 0.56.3 (`stuartarchibald <https://github.com/stuartarchibald>`_)

Authors:

* `gmarkall <https://github.com/gmarkall>`_
* `stuartarchibald <https://github.com/stuartarchibald>`_

Version 0.56.2 (1 September, 2022)
----------------------------------

Expand Down
9 changes: 8 additions & 1 deletion buildscripts/gpuci/build.sh
Expand Up @@ -24,6 +24,13 @@ else
export NUMBA_CUDA_USE_NVIDIA_BINDING=0;
fi;

# Test with different NumPy versions with each toolkit (it's not worth testing
# the Cartesian product of versions here, we just need to test with different
# CUDA and NumPy versions).
declare -A CTK_NUMPY_VMAP=( ["11.0"]="1.19" ["11.1"]="1.21" ["11.2"]="1.22" ["11.5"]="1.23")
NUMPY_VER="${CTK_NUMPY_VMAP[$CUDA_TOOLKIT_VER]}"


################################################################################
# SETUP - Check environment
################################################################################
Expand All @@ -40,7 +47,7 @@ gpuci_mamba_retry create -n numba_ci -y \
"python=${PYTHON_VER}" \
"cudatoolkit=${CUDA_TOOLKIT_VER}" \
"numba/label/dev::llvmlite" \
"numpy=1.21" \
"numpy=${NUMPY_VER}" \
"scipy" \
"cffi" \
"psutil" \
Expand Down
5 changes: 1 addition & 4 deletions buildscripts/incremental/setup_conda_environment.cmd
Expand Up @@ -5,7 +5,6 @@ set CONDA_CONFIG=cmd /C conda config
%CONDA_CONFIG% --set remote_connect_timeout_secs 30.15
%CONDA_CONFIG% --set remote_max_retries 10
%CONDA_CONFIG% --set remote_read_timeout_secs 120.2
%CONDA_CONFIG% --set restore_free_channel true
%CONDA_CONFIG% --set show_channel_urls true
cmd /C conda info
%CONDA_CONFIG% --show
Expand All @@ -22,11 +21,9 @@ call deactivate
@rem Display root environment (for debugging)
conda list
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
conda create -n %CONDA_ENV% -q -y python=%PYTHON% numpy=%NUMPY% cffi pip jinja2 ipython gitpython pyyaml
conda create -n %CONDA_ENV% -q -y python=%PYTHON% numpy=%NUMPY% cffi pip scipy jinja2 ipython gitpython pyyaml

call activate %CONDA_ENV%
@rem Scipy comes from conda-forge for NumPy 1.23
if %NUMPY% == "1.23" (%CONDA_INSTALL% conda-forge::scipy) else (%CONDA_INSTALL% scipy)
@rem Install latest llvmlite build
%CONDA_INSTALL% -c numba/label/dev llvmlite=0.40
@rem Install required backports for older Pythons
Expand Down
9 changes: 2 additions & 7 deletions buildscripts/incremental/setup_conda_environment.sh
Expand Up @@ -48,12 +48,7 @@ if [ "${VANILLA_INSTALL}" != "yes" ]; then
# dependencies, but exercised in the test suite
# pexpect is used to run the gdb tests.
# ipykernel is used for testing ipython behaviours.
$CONDA_INSTALL ${EXTRA_CHANNELS} cffi jinja2 ipython ipykernel pygments pexpect
if [[ "$NUMPY" == "1.23" ]] ; then
$CONDA_INSTALL ${EXTRA_CHANNELS} conda-forge::scipy
else
$CONDA_INSTALL ${EXTRA_CHANNELS} scipy
fi
$CONDA_INSTALL ${EXTRA_CHANNELS} cffi jinja2 ipython ipykernel scipy pygments pexpect
fi

# Install the compiler toolchain and gdb (if available)
Expand All @@ -73,7 +68,7 @@ $CONDA_INSTALL -c numba/label/dev llvmlite=0.40
if [ $PYTHON \< "3.9" ]; then $CONDA_INSTALL importlib_metadata; fi

# Install dependencies for building the documentation
if [ "$BUILD_DOC" == "yes" ]; then $CONDA_INSTALL sphinx=2.4.4 docutils=0.17 sphinx_rtd_theme pygments numpydoc; fi
if [ "$BUILD_DOC" == "yes" ]; then $CONDA_INSTALL sphinx docutils sphinx_rtd_theme pygments numpydoc; fi
if [ "$BUILD_DOC" == "yes" ]; then $PIP_INSTALL rstcheck; fi
# Install dependencies for code coverage (codecov.io)
if [ "$RUN_COVERAGE" == "yes" ]; then $PIP_INSTALL codecov; fi
Expand Down
4 changes: 3 additions & 1 deletion docs/source/cuda-reference/kernel.rst
Expand Up @@ -59,7 +59,9 @@ creating a specialized instance:
.. autoclass:: numba.cuda.dispatcher.CUDADispatcher
:members: inspect_asm, inspect_llvm, inspect_sass, inspect_types,
get_regs_per_thread, specialize, specialized, extensions, forall,
get_shared_mem_per_block, get_const_mem_size
get_shared_mem_per_block, get_const_mem_size,
get_local_mem_per_thread



Intrinsic Attributes and Functions
Expand Down
12 changes: 5 additions & 7 deletions docs/source/extending/low-level.rst
Expand Up @@ -59,13 +59,11 @@ and typing *operations* (or *functions*) on known value types.
existing default (e.g. to treat ``float`` as ``numba.float32`` instead of
``numba.float64``).

.. decorator:: as_numba_type.register

Register the decorated function as a type inference function used by
``as_numba_type`` when trying to infer the Numba type of a Python type.
The decorated function is called with a single *py_type* argument
and returns either a corresponding Numba type, or None if it cannot infer
that *py_type*.
This function can also be used as a decorator. It registers the decorated
function as a type inference function used by ``as_numba_type`` when trying
to infer the Numba type of a Python type. The decorated function is called
with a single *py_type* argument and returns either a corresponding Numba
type, or ``None`` if it cannot infer that *py_type*.


Lowering
Expand Down
3 changes: 3 additions & 0 deletions docs/source/reference/numpysupported.rst
Expand Up @@ -391,6 +391,8 @@ Reductions
The following reduction functions are supported:

* :func:`numpy.diff` (only the 2 first arguments)
* :func:`numpy.amin` (only the first argument, also aliased as np.min)
* :func:`numpy.amax` (only the first argument, also aliased as np.max)
* :func:`numpy.median` (only the first argument)
* :func:`numpy.nancumprod` (only the first argument)
* :func:`numpy.nancumsum` (only the first argument)
Expand Down Expand Up @@ -479,6 +481,7 @@ The following top-level functions are supported:
* :func:`numpy.histogram` (only the 3 first arguments)
* :func:`numpy.hstack`
* :func:`numpy.identity`
* :func:`numpy.isclose`
* :func:`numpy.kaiser`
* :func:`numpy.iscomplex`
* :func:`numpy.iscomplexobj`
Expand Down
46 changes: 23 additions & 23 deletions docs/source/reference/pysupported.rst
Expand Up @@ -1238,29 +1238,29 @@ Third-party modules
Similarly to ctypes, Numba is able to call into `cffi`_-declared external
functions, using the following C types and any derived pointer types:

* :c:type:`char`
* :c:type:`short`
* :c:type:`int`
* :c:type:`long`
* :c:type:`long long`
* :c:type:`unsigned char`
* :c:type:`unsigned short`
* :c:type:`unsigned int`
* :c:type:`unsigned long`
* :c:type:`unsigned long long`
* :c:type:`int8_t`
* :c:type:`uint8_t`
* :c:type:`int16_t`
* :c:type:`uint16_t`
* :c:type:`int32_t`
* :c:type:`uint32_t`
* :c:type:`int64_t`
* :c:type:`uint64_t`
* :c:type:`float`
* :c:type:`double`
* :c:type:`ssize_t`
* :c:type:`size_t`
* :c:type:`void`
* :c:expr:`char`
* :c:expr:`short`
* :c:expr:`int`
* :c:expr:`long`
* :c:expr:`long long`
* :c:expr:`unsigned char`
* :c:expr:`unsigned short`
* :c:expr:`unsigned int`
* :c:expr:`unsigned long`
* :c:expr:`unsigned long long`
* :c:expr:`int8_t`
* :c:expr:`uint8_t`
* :c:expr:`int16_t`
* :c:expr:`uint16_t`
* :c:expr:`int32_t`
* :c:expr:`uint32_t`
* :c:expr:`int64_t`
* :c:expr:`uint64_t`
* :c:expr:`float`
* :c:expr:`double`
* :c:expr:`ssize_t`
* :c:expr:`size_t`
* :c:expr:`void`

The ``from_buffer()`` method of ``cffi.FFI`` and ``CompiledFFI`` objects is
supported for passing Numpy arrays and other buffer-like objects. Only
Expand Down
4 changes: 4 additions & 0 deletions docs/source/user/installing.rst
Expand Up @@ -261,6 +261,10 @@ information.
+===========+==============+===========================+============================+==============================+===================+=============================+
| 0.57.x | TBC | 3.8.x <= version < 3.12 | 1.19 <= version < 1.24 | 0.40.x | 11.x | 2021.x |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| 0.56.4 | 2022-11-03 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.24 | 0.39.x | 11.x | 2021.x |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| 0.56.3 | 2022-10-13 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.24 | 0.39.x | 11.x | 2021.x |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| 0.56.2 | 2022-09-01 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.24 | 0.39.x | 11.x | 2021.x |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| 0.56.1 | NO RELEASE | | | | | |
Expand Down
9 changes: 6 additions & 3 deletions docs/source/user/jitclass.rst
Expand Up @@ -99,7 +99,8 @@ First, using explicit Numba types and explicit construction.

.. code-block:: python
from numba import jitclass, types, typed
from numba import types, typed
from numba.experimental import jitclass
# key and value types
kv_ty = (types.int64, types.unicode_type)
Expand Down Expand Up @@ -131,7 +132,8 @@ example:

.. code-block:: python
from numba import jitclass, typed, typeof
from numba import typed, typeof
from numba.experimental import jitclass
d = typed.Dict()
d[1] = "apple"
Expand All @@ -158,7 +160,8 @@ instance of the type specified.

.. code-block:: python
from numba import jitclass, types
from numba import types
from numba.experimental import jitclass
dict_ty = types.DictType(types.int64, types.unicode_type)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user/pycc.rst
Expand Up @@ -25,7 +25,7 @@ Benefits

.. seealso::
Compiled extension modules are discussed in the
`Python packaging user guide <https://packaging.python.org/en/latest/extensions/>`_.
`Python packaging user guide <https://packaging.python.org/en/latest/guides/packaging-binary-extensions/>`_.


Limitations
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user/stencil.rst
Expand Up @@ -213,8 +213,8 @@ rather than relative indexing::
``StencilFunc``
===============

The stencil decorator returns a callable object of type ``StencilFunc``.
``StencilFunc`` objects contains a number of attributes but the only one of
The stencil decorator returns a callable object of type ``StencilFunc``. A
``StencilFunc`` object contains a number of attributes but the only one of
potential interest to users is the ``neighborhood`` attribute.
If the ``neighborhood`` option was passed to the stencil decorator then
the provided neighborhood is stored in this attribute. Else, upon
Expand Down
15 changes: 8 additions & 7 deletions docs/source/user/troubleshoot.rst
Expand Up @@ -797,7 +797,7 @@ the line in which the access violation occurred is printed.

Continuing the example as a debugging session demonstration, first ``index``
can be printed, and it is evidently 1e9. Printing ``c`` shows that it is a
structure, so the type needs looking up and it can be seen that is it an
structure, so the type needs looking up and it can be seen that it is an
``array(float64, 1d, C)`` type. Given the segfault came from an invalid access
it would be informative to check the number of items in the array and compare
that to the index requested. Inspecting the ``nitems`` member of the structure
Expand Down Expand Up @@ -874,12 +874,13 @@ breakpoint was hit, and after a ``continue`` was issued, it broke again at line
Debugging in parallel regions
-----------------------------

The follow example is quite involved, it executes with ``gdb`` instrumentation
from the outset as per the example above, but it also uses threads and makes use
of the breakpoint functionality. Further, the last iteration of the parallel
section calls the function ``work``, which is actually just a binding to
``glibc``'s ``free(3)`` in this case, but could equally be some involved
function that is presenting a segfault for unknown reasons.
The following example is quite involved, it executes with ``gdb``
instrumentation from the outset as per the example above, but it also uses
threads and makes use of the breakpoint functionality. Further, the last
iteration of the parallel section calls the function ``work``, which is
actually just a binding to ``glibc``'s ``free(3)`` in this case, but could
equally be some involved function that is presenting a segfault for unknown
reasons.

.. code-block:: python
:linenos:
Expand Down
12 changes: 8 additions & 4 deletions numba/_numba_common.h
Expand Up @@ -10,11 +10,15 @@
* but are not exposed outside of a shared library or executable.
* Note this is default behaviour for global symbols under Windows.
*/
#if (__has_attribute(visibility) || \
(defined(__GNUC__) && __GNUC__ >= 4))
#define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden")))
#if defined(_MSC_VER)
#define VISIBILITY_HIDDEN
#define VISIBILITY_GLOBAL __declspec(dllexport)
#elif (__has_attribute(visibility) || (defined(__GNUC__) && __GNUC__ >= 4))
#define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden")))
#define VISIBILITY_GLOBAL __attribute__ ((visibility("default")))
#else
#define VISIBILITY_HIDDEN
#define VISIBILITY_HIDDEN
#define VISIBILITY_GLOBAL
#endif

/*
Expand Down
3 changes: 3 additions & 0 deletions numba/cext/cext.h
Expand Up @@ -9,6 +9,9 @@
#define NUMBA_EXPORT_FUNC(_rettype) VISIBILITY_HIDDEN _rettype
#define NUMBA_EXPORT_DATA(_vartype) VISIBILITY_HIDDEN _vartype

/* Use to declare a symbol as exported (global). */
#define NUMBA_GLOBAL_FUNC(_rettype) VISIBILITY_GLOBAL _rettype

NUMBA_EXPORT_FUNC(Py_ssize_t)
aligned_size(Py_ssize_t sz);

Expand Down

0 comments on commit 52bdecb

Please sign in to comment.