ogrisel / pygbm

Experimental Gradient Boosting Machines in Python with numba.
MIT License
183 stars 32 forks source link

Recent Numba not usable with pygbm #98

Open esc opened 4 years ago

esc commented 4 years ago

I am seeing the following:

::>> running: 'conda run -n pygbm pytest'
ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['pytest']' command failed.  (See above for error)
============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/circleci/repo/pygbm
collected 0 items / 9 errors

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_binning.py ____________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_binning.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_binning.py:5: in <module>
    from pygbm.binning import BinMapper, _find_binning_thresholds, _map_to_bins
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
_______________ ERROR collecting tests/test_compare_lightgbm.py ________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_compare_lightgbm.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compare_lightgbm.py:7: in <module>
    from pygbm import GradientBoostingRegressor, GradientBoostingClassifier
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
_______________ ERROR collecting tests/test_gradient_boosting.py _______________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_gradient_boosting.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_gradient_boosting.py:8: in <module>
    from pygbm import GradientBoostingClassifier
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
____________________ ERROR collecting tests/test_grower.py _____________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_grower.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_grower.py:7: in <module>
    from pygbm.grower import TreeGrower
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
___________________ ERROR collecting tests/test_histogram.py ___________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_histogram.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_histogram.py:5: in <module>
    from pygbm.histogram import _build_histogram_naive
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
_____________________ ERROR collecting tests/test_loss.py ______________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_loss.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_loss.py:8: in <module>
    from pygbm.loss import _LOSSES
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
___________________ ERROR collecting tests/test_plotting.py ____________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_plotting.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_plotting.py:5: in <module>
    from pygbm.grower import TreeGrower
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
___________________ ERROR collecting tests/test_predictor.py ___________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_predictor.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_predictor.py:9: in <module>
    from pygbm.grower import TreeGrower
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)
___________________ ERROR collecting tests/test_splitting.py ___________________
ImportError while importing test module '/home/circleci/repo/pygbm/tests/test_splitting.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../miniconda3/envs/pygbm/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_splitting.py:6: in <module>
    from pygbm.splitting import _find_histogram_split
pygbm/__init__.py:1: in <module>
    from pygbm.gradient_boosting import GradientBoostingClassifier
pygbm/gradient_boosting.py:18: in <module>
    from pygbm.grower import TreeGrower
pygbm/grower.py:11: in <module>
    from .splitting import (SplittingContext, split_indices, find_node_split,
pygbm/splitting.py:9: in <module>
    from numba import njit, jitclass, prange, float32, uint8, uint32
E   ImportError: cannot import name 'jitclass' from 'numba' (/home/circleci/repo/miniconda3/envs/pygbm/lib/python3.8/site-packages/numba/__init__.py)

The fix is easy, jitclass must now be imported so: from numba.experimental import jitclass. I can submit a patch if need be.

esc commented 4 years ago

FYI: these are the relevant versions

# Name                    Version                   Build  Channel
llvmlite                  0.35.0rc3        py38hf484d3e_0    numba/label/dev
numba                     0.52.0rc2       np1.11py3.8h04863e7_gc1fa8487a_10    numba/label/dev
pygbm                     0.1.0                     dev_0    <develop>