Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit 7524c59

Browse files
Move to Numba 0.52 (#939)
* Taking numba from master * Moving to Numba 0.52 commit 3182540b127268ace11cf4042cd87f044875d9fa Author: Kozlov, Alexey <alexey.kozlov@intel.com> Date: Wed Oct 21 19:49:58 2020 +0300 Cleaning up before squash commit 895668116542fe3057f73fcb276c441cbde66747 Author: Kozlov, Alexey <alexey.kozlov@intel.com> Date: Tue Oct 13 17:31:34 2020 +0300 Workaround for set from str_arr problem * Fixing correct NUMBA_VERSION * Remove intel/label/beta channel from Azure CI builds
1 parent 97cff23 commit 7524c59

9 files changed

Lines changed: 18 additions & 15 deletions

File tree

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Building on Linux with setuptools
8282

8383
export PYVER=<3.6 or 3.7>
8484
export NUMPYVER=<1.16 or 1.17>
85-
conda create -n sdc-env -q -y -c intel/label/beta -c defaults -c intel -c conda-forge python=$PYVER numpy=$NUMPYVER tbb-devel tbb4py numba=0.49 pandas=1.0.5 pyarrow=0.17.0 gcc_linux-64 gxx_linux-64
85+
conda create -n sdc-env -q -y -c intel/label/beta -c defaults -c intel -c conda-forge python=$PYVER numpy=$NUMPYVER tbb-devel tbb4py numba=0.52 pandas=1.0.5 pyarrow=0.17.0 gcc_linux-64 gxx_linux-64
8686
source activate sdc-env
8787
git clone https://github.com/IntelPython/sdc.git
8888
cd sdc
@@ -120,7 +120,7 @@ Building on Windows with setuptools
120120

121121
set PYVER=<3.6 or 3.7>
122122
set NUMPYVER=<1.16 or 1.17>
123-
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% tbb-devel tbb4py numba=0.49 pandas=1.0.5 pyarrow=0.17.0
123+
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% tbb-devel tbb4py numba=0.52 pandas=1.0.5 pyarrow=0.17.0
124124
conda activate sdc-env
125125
set INCLUDE=%INCLUDE%;%CONDA_PREFIX%\Library\include
126126
set LIB=%LIB%;%CONDA_PREFIX%\Library\lib

buildscripts/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(self, python, sdc_local_channel=None):
5252
self.line_single = '-'*80
5353

5454
# Set channels
55-
self.channel_list = ['-c', 'intel/label/beta', '-c', 'defaults', '-c', 'conda-forge']
55+
self.channel_list = ['-c', 'defaults', '-c', 'conda-forge']
5656
if sdc_local_channel:
5757
sdc_local_channel = Path(sdc_local_channel).resolve().as_uri()
5858
self.channel_list = ['-c', sdc_local_channel] + self.channel_list

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set NUMBA_VERSION = "==0.51.2" %}
1+
{% set NUMBA_VERSION = "==0.52.0" %}
22
{% set PANDAS_VERSION = "==1.0.5" %}
33
{% set PYARROW_VERSION = "==0.17.0" %}
44

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
numpy>=1.16
2-
pandas==0.25.3
2+
pandas==1.0.5
33
pyarrow==0.17.0
4-
numba==0.51.2
4+
numba==0.52.0
55
tbb
66
tbb-devel

sdc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
# re-export from Numba
3030
from numba import (typeof, prange, pndindex, gdb, gdb_breakpoint, gdb_init,
31-
stencil, threading_layer, jitclass, objmode)
31+
stencil, threading_layer, objmode)
3232

3333
import sdc.config
3434
import sdc.set_ext

sdc/datatypes/hpat_pandas_series_functions.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
from sdc.hiframes.api import isna
7373
from sdc.datatypes.hpat_pandas_groupby_functions import init_series_groupby
7474
from sdc.utilities.prange_utils import parallel_chunks
75+
from sdc.set_ext import build_set
7576

7677
from .pandas_series_functions import apply
7778
from .pandas_series_functions import map as _map
@@ -652,7 +653,7 @@ def sdc_pandas_series_setitem_idx_bool_array_align_impl(self, idx, value):
652653
# and filtered indexes are looked in value.index, and if found corresponding value is set
653654
if value_is_series == True: # noqa
654655
value_index, self_index = value.index, self.index
655-
unique_value_indices, unique_self_indices = set(value_index), set(self_index)
656+
unique_value_indices, unique_self_indices = build_set(value_index), build_set(self_index)
656657

657658
# pandas behaves differently if value.index has duplicates and if it has no
658659
# in case of duplicates in value.index assignment is made via positions
@@ -702,7 +703,7 @@ def sdc_pandas_series_setitem_idx_bool_series_align_impl(self, idx, value):
702703
# and filtered indexes are either looked in value.index (if value is a Series)
703704
# or in self.index (if value is scalar or array)
704705
filtered_idx_indices = idx_index[idx._data]
705-
filtered_idx_indices_set = set(filtered_idx_indices)
706+
filtered_idx_indices_set = build_set(filtered_idx_indices)
706707
if value_is_series == True: # noqa
707708

708709
if len(filtered_idx_indices_set) != len(filtered_idx_indices):
@@ -2074,7 +2075,7 @@ def hpat_pandas_series_isin_impl(self, values):
20742075
# return pandas.Series (np.isin (self._data, values))
20752076

20762077
values = str_list_to_array(list(values))
2077-
values = set(values)
2078+
values = build_set(values)
20782079
data_len = len(self._data)
20792080
result = numpy.empty(data_len, dtype=numpy.bool_)
20802081
for i in prange(data_len):
@@ -2086,7 +2087,7 @@ def hpat_pandas_series_isin_impl(self, values):
20862087
# TODO: replace with below line when Numba supports np.isin in nopython mode
20872088
# return pandas.Series (np.isin (self._data, values))
20882089

2089-
values = set(values)
2090+
values = build_set(values)
20902091
data_len = len(self._data)
20912092
result = numpy.empty(data_len, dtype=numpy.bool_)
20922093
for i in prange(data_len):
@@ -3447,7 +3448,7 @@ def hpat_pandas_series_unique_str_impl(self):
34473448
Test: python -m sdc.runtests sdc.tests.test_series.TestSeries.test_unique_str
34483449
'''
34493450

3450-
str_set = set(self._data)
3451+
str_set = build_set(self._data)
34513452
return to_array(str_set)
34523453

34533454
return hpat_pandas_series_unique_str_impl
@@ -3579,7 +3580,7 @@ def hpat_pandas_series_nunique_str_impl(self, dropna=True):
35793580
if dropna:
35803581
nan_mask = self.isna()
35813582
data = self._data[~nan_mask._data]
3582-
unique_values = set(data)
3583+
unique_values = build_set(data)
35833584
return len(unique_values)
35843585

35853586
return hpat_pandas_series_nunique_str_impl
@@ -3592,7 +3593,7 @@ def hpat_pandas_series_nunique_impl(self, dropna=True):
35923593
data_mask_for_nan = numpy.isnan(self._data)
35933594
nan_exists = numpy.any(data_mask_for_nan)
35943595
data_no_nan = self._data[~data_mask_for_nan]
3595-
data_set = set(data_no_nan)
3596+
data_set = build_set(data_no_nan)
35963597
if dropna or not nan_exists:
35973598
return len(data_set)
35983599
else:

sdc/set_ext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def _build_str_set_impl(A):
128128
str_set.add(_str)
129129
return str_set
130130

131+
131132
# TODO: remove since probably unused
132133
@overload(set)
133134
def init_set_string_array(A):

sdc/tests/test_hpat_jit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from sdc import *
3737
from sdc.tests.test_base import TestCase
3838
from sdc.tests.test_utils import skip_numba_jit
39+
from numba.experimental import jitclass
3940

4041

4142
class TestHpatJitIssues(TestCase):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def run(self):
377377
'numpy>=1.16',
378378
'pandas>=1.0',
379379
'pyarrow==0.17.0',
380-
'numba>=0.51.2,<0.52',
380+
'numba>=0.52.0,<0.53',
381381
'tbb'
382382
],
383383
cmdclass=sdc_build_commands,

0 commit comments

Comments
 (0)