Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel crashed when executing gpboost code #69

Closed
melantha-wang opened this issue Jun 26, 2022 · 10 comments
Closed

Kernel crashed when executing gpboost code #69

melantha-wang opened this issue Jun 26, 2022 · 10 comments

Comments

@melantha-wang
Copy link

Hi Fabio,

Thanks for the awesome package! I just started to play around with the Python package and when running this code example in jupyter I kept receiving this error message:

The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click [here](https://aka.ms/vscodeJupyterKernelCrash) for more info. View Jupyter [log](command:jupyter.viewOutput) for further details.
Canceled future for execute_request message before replies were done

I was able to import the library but Python would crash as soon as I run this line:

gp_model = gpb.GPModel(group_data=group, likelihood="gaussian")

Do you have any idea what could have caused this? I'm working on a M1 machine in case that can be relevant.

@fabsig
Copy link
Owner

fabsig commented Jun 27, 2022

Thank you for reporting this!

There is currently no pre-compiled version on PyPI for the Mac M1. This means that you have to to do the compilation yourself. See the discussion #51 for more details.

@fabsig fabsig closed this as completed Jun 27, 2022
@fabsig
Copy link
Owner

fabsig commented Jun 27, 2022

FYI: The R package has a pre-compiled macOS arm64 on CRAN.

@melantha-wang
Copy link
Author

Thanks for your reply!

Unfortunately I'm still experiencing the same issue after building the package (using Apple Clang and cmake) and installing from the source. I didn't get any error message during the installation process so it all seemed to work fine but the code just didn't run. The R package is a workable solution but I would love to know if there's anything else I can do to resolve this. Thanks!

@fabsig
Copy link
Owner

fabsig commented Jun 27, 2022

Thank you for your update.

Unfortunately, I cannot reproduce this. I have tried installing the gpboost Python package on a M1 Mac mini on scaleway and it works without any problems for me both using clang or gcc after following these instructions.

@estsauver once mentioned in #51 the option to fund a scaleway instance for GPBoost. Unfortunately, I have not heard anything so far. Once this is set up, I can provide a pre-compiled macOS arm64 version on PyPI.

@fabsig
Copy link
Owner

fabsig commented Jun 27, 2022

@melantha-wang: Just to double check that it is not an issue with the sklearn interface: does this code work for you?

@melantha-wang
Copy link
Author

Unfortunately that didn't work either. It crashes as soon as I run gp_model = gpb.GPModel(likelihood="gaussian", group_data=np.array([0, 1, 2])).

One thing I just noticed was that if I installed from source, I can only see the egg-info (gpboost-0.7.7-py3.9.egg-info) and not the actual package in the site-packages/ directory. I did successfully pip installed the package before so didn't notice this until I uninstalled and reinstalled. Can that be the issue?

@fabsig
Copy link
Owner

fabsig commented Jun 27, 2022

Yes, this is probably the reason. You need to have a gpboost directory with a lib_gpboost.so file in it. This is the file where all the compiled C++ functions are. Your code crashes when Python tries to call this the first time (and probably does not find it). You might want to uninstall and re-install. Also make sure that the installation including the compilation ends successfully.

@fabsig
Copy link
Owner

fabsig commented Aug 19, 2022

A macOS arm64 chip pre-compiled version is now on PyPI. You should now be able to install with pip on M1 / M2 Macs without any problems as compilation is not required anymore.

@melantha-wang
Copy link
Author

Thanks for the update! I'm still having the same issue of kernel crashing though... (I can install & import successfully but the kernel crashed every time I tried to call a function within the package).

@fabsig
Copy link
Owner

fabsig commented Aug 29, 2022

Thank you for your feedback. Two things that might help:

  • In case you migrated from an older Mac, you need to uninstall homebrew and reinstall it before you install libomp (to make sure that the arm64 version is used)
  • Use Miniforge (brew install miniforge and conda init "$(basename "${SHELL}")") instead of say Anaconda

With this, it it runs on my arm64 Mac. I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants