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

Commit 89dd36b

Browse files
densmirn1e-toVyacheslav-SmirnovPokhodenkoSAkozlov-alexey
authored
Update feature/groupby_optimization from master (#843)
* Improve boxing (#832) * Specify sdc version from channel for examples testing (#837) * Specify sdc version from channel for examples testing It occurs that conda resolver can take Intel SDC package not from first channel where it is found. Specify particular SDC version to avoid this in examples for now. Also print info for environment creation and package installing * Fix incerrectly used f-string * Fix log_info call * Numba 0.49.0 all (#824) * Fix run tests Remove import of _getitem_array1d * expectedFailure * expectedFailure-2 * expectedFailure-3 * Conda recipe numba==0.49 * expectedFailure-4 * Refactor imports from Numba * Unskip tests * Fix using of numpy_support.from_dtype() * Unskip tests * Fix DataFrame tests with rewrite IR without Del statements * Unskip tests * Fix corr_overload with type inference error for none < 1 * Fix hpat_pandas_series_cov with type inference error for none < 2 * Unskip tests * Unskip tests * Fixed iternext_series_array with using _getitem_array1d. _getitem_array1d is replaced with _getitem_array_single_int in Numba 0.49. * Unskip tests * Unskip old test * Fix Series.at * Unskip tests * Add decrefs in boxing (#836) * Adding extension type for pd.RangeIndex (#820) * Adding extension type for pd.RangeIndex This commit adds Numba extension types for pandas.RangeIndex class, allowing creation of pd.RangeIndex objects and passing and returning them to/from nopython functions. * Applying review comments * Fix for PR 831 (#839) * Update pyarrow version to 0.17.0 Update recipe, code and docs. * Disable intel channel * Disable intel channel for testing * Fix remarks Co-authored-by: Vyacheslav Smirnov <vyacheslav.s.smirnov@intel.com> * Update to Numba 0.49.1 (#838) * Update to Numba 0.49.1 * Fix requirements.txt Co-authored-by: Elena Totmenina <totmeninal@mail.ru> Co-authored-by: Vyacheslav-Smirnov <51660067+Vyacheslav-Smirnov@users.noreply.github.com> Co-authored-by: Sergey Pokhodenko <sergey.pokhodenko@intel.com> Co-authored-by: Alexey Kozlov <52973316+kozlov-alexey@users.noreply.github.com> Co-authored-by: Vyacheslav Smirnov <vyacheslav.s.smirnov@intel.com>
1 parent 58193c4 commit 89dd36b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1292
-370
lines changed

README.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ the code by leveraging modern hardware instructions and by utilizing all availab
2323

2424
Intel® SDC documentation can be found `here <https://intelpython.github.io/sdc-doc/>`_.
2525

26-
Intel® SDC uses special Numba build based on ``0.48.0`` tag for build and run.
27-
Required Numba version can be installed from ``intel/label/beta`` channel from the Anaconda Cloud.
28-
2926
.. note::
3027
For maximum performance and stability, please use numba from ``intel/label/beta`` channel.
3128

@@ -61,9 +58,6 @@ If you do not have conda, we recommend using Miniconda3::
6158
./miniconda.sh -b
6259
export PATH=$HOME/miniconda3/bin:$PATH
6360

64-
Intel® SDC uses special Numba build based on ``0.48.0`` tag for build and run.
65-
Required Numba version can be installed from ``intel/label/beta`` channel from the Anaconda Cloud.
66-
6761
.. note::
6862
For maximum performance and stability, please use numba from ``intel/label/beta`` channel.
6963

@@ -88,7 +82,7 @@ Building on Linux with setuptools
8882

8983
PYVER=<3.6 or 3.7>
9084
NUMPYVER=<1.16 or 1.17>
91-
conda create -n sdc-env -q -y -c intel/label/beta -c defaults -c intel -c conda-forge python=$PYVER numpy=$NUMPYVER numba=0.48.0 pandas=0.25.3 pyarrow=0.15.1 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 numba=0.49 pandas=0.25.3 pyarrow=0.17.0 gcc_linux-64 gxx_linux-64
9286
source activate sdc-env
9387
git clone https://github.com/IntelPython/sdc.git
9488
cd sdc
@@ -126,7 +120,7 @@ Building on Windows with setuptools
126120

127121
set PYVER=<3.6 or 3.7>
128122
set NUMPYVER=<1.16 or 1.17>
129-
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% numba=0.48.0 pandas=0.25.3 pyarrow=0.15.1
123+
conda create -n sdc-env -c intel/label/beta -c defaults -c intel -c conda-forge python=%PYVER% numpy=%NUMPYVER% numba=0.49 pandas=0.25.3 pyarrow=0.17.0
130124
conda activate sdc-env
131125
set INCLUDE=%INCLUDE%;%CONDA_PREFIX%\Library\include
132126
set LIB=%LIB%;%CONDA_PREFIX%\Library\lib

buildscripts/build.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535

3636
def build(sdc_utils):
3737
os.chdir(str(sdc_utils.src_path))
38-
# For Windows build do not use intel channel due to build issue
39-
if platform.system() == 'Windows':
40-
sdc_utils.channels = '-c intel/label/beta -c defaults -c conda-forge'
4138

4239
sdc_utils.log_info('Start Intel SDC build', separate=True)
4340
conda_build_cmd = ' '.join([

buildscripts/run_examples.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def run_examples(sdc_utils):
9090
sdc_utils.log_info('Run Intel(R) SDC examples', separate=True)
9191
sdc_utils.log_info(sdc_utils.line_double)
9292
sdc_utils.create_environment()
93-
sdc_utils.install_conda_package(['sdc'])
93+
sdc_package = f'sdc={sdc_utils.get_sdc_version_from_channel()}'
94+
sdc_utils.install_conda_package([sdc_package])
9495

9596
run_examples(sdc_utils)

buildscripts/sdc-conda-recipe/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{% set NUMBA_VERSION = "==0.48" %}
1+
{% set NUMBA_VERSION = "==0.49.1" %}
22
{% set PANDAS_VERSION = "==0.25.3" %}
3-
{% set PYARROW_VERSION = "==0.15.1" %}
3+
{% set PYARROW_VERSION = "==0.17.0" %}
44

55
package:
66
name: sdc

buildscripts/utilities.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727

2828

29+
import json
2930
import os
3031
import platform
3132
import re
@@ -51,7 +52,7 @@ def __init__(self, python, sdc_local_channel=None):
5152
self.line_single = '-'*80
5253

5354
# Set channels
54-
self.channel_list = ['-c', 'intel/label/beta', '-c', 'intel', '-c', 'defaults', '-c', 'conda-forge']
55+
self.channel_list = ['-c', 'intel/label/beta', '-c', 'defaults', '-c', 'conda-forge']
5556
if sdc_local_channel:
5657
sdc_local_channel = Path(sdc_local_channel).resolve().as_uri()
5758
self.channel_list = ['-c', sdc_local_channel] + self.channel_list
@@ -87,7 +88,7 @@ def create_environment(self, packages_list=[]):
8788
# Create Intel SDC environment
8889
create_args = ['-q', '-y', '-n', self.env_name, f'python={self.python}']
8990
create_args += packages_list + self.channel_list + ['--override-channels']
90-
self.__run_conda_command(Conda_Commands.CREATE, create_args)
91+
self.log_info(self.__run_conda_command(Conda_Commands.CREATE, create_args))
9192

9293
return
9394

@@ -97,7 +98,7 @@ def install_conda_package(self, packages_list):
9798
self.log_info(f'Install {" ".join(packages_list)} to {self.env_name} conda environment')
9899
install_args = ['-n', self.env_name]
99100
install_args += self.channel_list + ['--override-channels', '-q', '-y'] + packages_list
100-
self.__run_conda_command(Conda_Commands.INSTALL, install_args)
101+
self.log_info(self.__run_conda_command(Conda_Commands.INSTALL, install_args))
101102

102103
return
103104

@@ -135,3 +136,19 @@ def log_info(self, msg, separate=False):
135136
if separate:
136137
print(f'{time.strftime("%d/%m/%Y %H:%M:%S")}: {self.line_double}', flush=True)
137138
print(f'{time.strftime("%d/%m/%Y %H:%M:%S")}: {msg}', flush=True)
139+
140+
def get_sdc_version_from_channel(self):
141+
python_version = 'py' + self.python.replace('.', '')
142+
143+
# Get Intel SDC version from first channel in channel_list
144+
search_args = ['sdc', '-c', self.channel_list[1], '--override-channels', '--json']
145+
search_result = self.__run_conda_command(Conda_Commands.SEARCH, search_args)
146+
147+
repo_data = json.loads(search_result)
148+
for package_data in repo_data['sdc']:
149+
sdc_version = package_data['version']
150+
sdc_build = package_data['build']
151+
if python_version in sdc_build:
152+
break
153+
154+
return f'{sdc_version}={sdc_build}'

docs/source/compilation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Output:
3535

3636
Traceback (most recent call last):
3737
...
38-
numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
38+
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
3939
Unknown attribute 'read_excel' of type Module(<module 'pandas' from ...)
4040

4141

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
numpy>=1.16
22
pandas==0.25.3
3-
pyarrow==0.15.1
4-
numba==0.48
3+
pyarrow==0.17.0
4+
numba==0.49.1

sdc/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
import sdc.datatypes.hpat_pandas_stringmethods_functions
4646
import sdc.datatypes.hpat_pandas_groupby_functions
4747

48+
import sdc.extensions.indexes.range_index_ext
49+
4850
from ._version import get_versions
4951

5052
if not sdc.config.config_pipeline_hpat_default:
@@ -57,8 +59,8 @@
5759
"""
5860

5961
# sdc.config.numba_compiler_define_nopython_pipeline_orig = \
60-
# numba.compiler.DefaultPassBuilder.define_nopython_pipeline
61-
# numba.compiler.DefaultPassBuilder.define_nopython_pipeline = \
62+
# numba.core.compiler.DefaultPassBuilder.define_nopython_pipeline
63+
# numba.core.compiler.DefaultPassBuilder.define_nopython_pipeline = \
6264
# sdc.datatypes.hpat_pandas_dataframe_pass.sdc_nopython_pipeline_lite_register
6365

6466
import sdc.rewrites.dataframe_constructor

sdc/compiler.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
from sdc.hiframes.hiframes_typed import HiFramesTypedPass
3535
from sdc.hiframes.dataframe_pass import DataFramePass
3636
import numba
37-
import numba.compiler
38-
from numba.compiler import DefaultPassBuilder
37+
import numba.core.compiler
38+
from numba.core.compiler import DefaultPassBuilder
3939
from numba import ir_utils, ir, postproc
40-
from numba.targets.registry import CPUDispatcher
41-
from numba.ir_utils import guard, get_definition
42-
from numba.inline_closurecall import inline_closure_call
40+
from numba.core.registry import CPUDispatcher
41+
from numba.core.ir_utils import guard, get_definition
42+
from numba.core.inline_closurecall import inline_closure_call
4343
from numba.typed_passes import (NopythonTypeInference, AnnotateTypes, ParforPass, IRLegalization)
4444
from numba.untyped_passes import (DeadBranchPrune, InlineInlinables, InlineClosureLikes)
4545
from sdc import config
4646
from sdc.distributed import DistributedPass
4747

48-
from numba.compiler_machinery import FunctionPass, register_pass
48+
from numba.core.compiler_machinery import FunctionPass, register_pass
4949

5050
# workaround for Numba #3876 issue with large labels in mortgage benchmark
5151
binding.set_option("tmp", "-non-global-value-max-name-size=2048")
@@ -143,7 +143,7 @@ def run_pass(self, state):
143143
return True
144144

145145

146-
class SDCPipeline(numba.compiler.CompilerBase):
146+
class SDCPipeline(numba.core.compiler.CompilerBase):
147147
"""SDC compiler pipeline
148148
"""
149149

@@ -170,7 +170,7 @@ def __init__(self):
170170
pass
171171

172172
def run_pass(self, state):
173-
numba.parfor.lower_parfor_sequential(
173+
numba.parfors.parfor.lower_parfor_sequential(
174174
state.typingctx, state.func_ir, state.typemap, state.calltypes)
175175

176176
return True

sdc/cv_ext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
import numba
2929
import sdc
3030
from numba import types
31-
from numba.typing.templates import infer_global, AbstractTemplate, infer, signature
31+
from numba.core.typing.templates import infer_global, AbstractTemplate, infer, signature
3232
from numba.extending import lower_builtin, overload, intrinsic
33-
from numba import cgutils
33+
from numba.core import cgutils
3434
from sdc.str_ext import string_type
35-
from numba.targets.imputils import impl_ret_new_ref, impl_ret_borrowed
36-
from numba.targets.arrayobj import _empty_nd_impl
35+
from numba.core.imputils import impl_ret_new_ref, impl_ret_borrowed
36+
from numba.np.arrayobj import _empty_nd_impl
3737

3838
import cv2
3939
import numpy as np

0 commit comments

Comments
 (0)