Kernel Crash When Compiling Model

I am trying to follow along with the simple Linear Regression example (docs/advanced_examples/LinearRegression.ipynb), but my kernel crashes every time I run the compile line: fhe_circuit = concrete_lr.compile(X_train).

Python Version: 3.8.8
Numpy Version: 1.24.4
Concrete Versions:

  • concrete==4.18.2
  • concrete-compiler==0.10.0
  • concrete-ml==0.3.0
  • concrete-numpy==0.7.0

Hello, it seems you have very deprecated version: Concrete ML eg today is 1.5.0 (concrete-ml · PyPI) and 0.3 seems to be from 2022 (concrete-ml · PyPI).

Could you launch an pip install concrete-ml --upgrade and pip install concrete-python --upgrade please?

Note that concrete package is not ours, it’s something else

For some reason, even after running pip install concrete-ml --upgrade, the version of concrete-ml remains at 0.3.0. Also, pip install concrete-python --upgrade yields the errors:
" ERROR: Could not find a version that satisfies the requirement concrete-python (from versions: none)
ERROR: No matching distribution found for concrete-python"

here, it looks more like a python / pip installation problem
we’ll help next week

Trying pip install --force-reinstall -v concrete-ml==1.5.0 yields a similar error as above:
" ERROR: Could not find a version that satisfies the requirement concrete-python==2.6.0-rc1 (from concrete-ml) (from versions: none)
ERROR: No matching distribution found for concrete-python==2.6.0-rc1"

Hello @aneesh,
We are indeed getting a few similar reports recently. Could you provide more information about your configuration ? In particular :

  • your OS and architecture
  • are you using conda ?
  • are you using docker ? a virtual environment ?

Thanks !

  • Mac OS, arm64 architecture
  • No, not using conda
  • Yes, using a venv

Thanks @aneesh ,
You could start to follow the steps in Troubleshooting Concrete installation - #2 ! Tell me if that fixes your issue :slight_smile:

I realize that the architecture is arm64, but the python architecture in the venv is x86 for some reason. I have tried to search how to change the python architecture but haven’t found anything that seems to work. Would you be able to provide any assistance with this?

Hello again @aneesh ,

This is very weird indeed, are you using pyenv by any chance ? I can see that there are a few topics on the subject :

You might also be interested in python - virtual environment's architecture made by pipenv become intel chip on apple mac m1 - Stack Overflow

Unfortunately, all I can advise you here is to try to properly re-install your venv, I’m not too familiar with this behavior. We recently got a user on discord having the same sort of issue using conda : Discord

Hope that can help !

Thanks! I was able to create a new pyenv venv, but I still am experiencing the kernel crashing every time I run the compile line: fhe_circuit = concrete_lr.compile(X_train)

python version: 3.9.19
numpy version: 1.23.5
concrete-ml version: 1.5.0
concrete-python version: 2.6.0

But do you confirm that your pyenv venv now has the right architecture (arm64) ?

If you installed pyenv with brew, could you run brew config and share your output ? This is to make sure you have an arm brew and not x86 (refs ARM Brew or x86 Brew? · Homebrew · Discussion #3223 · GitHub).

Else, I would advise you to take another look at the links I shared above in order to make sure you have an pyenv venv with an arm architecture. If that does not work, then maybe you could try to use a Python built-in venv and see if it solves your issue.

Hope that helps !

brew config output:
“HOMEBREW_VERSION: 4.2.18

CPU: octa-core 64-bit arm_firestorm_icestorm

macOS: 14.1.1-arm64
CLT: N/A
Xcode: 14.1
Rosetta 2: false”

I also tried Python’s built-in venv, and it gives the same error where the kernel crashes whenever I try to ful the line fhe_circuit = concrete_lr.compile(X_train)

Ok thanks a lot, looks like your brew and venv are now right indeed !

Do you have Xcode installed ? If not, you simply need to run xcode-select --install (refs Troubleshooting Concrete installation)

In that does not fix your problem, it would be great if you could share your crash’ complete traceback (if there is one) !

I just tested and got the same crash, I suspect it to be linked with Sample code crashes on Apple M1 · Issue #790 · zama-ai/concrete · GitHub
With the internal build fixing this issue I no longer have the Kernel Crash with the LinearRegression Example.

Indeed, we recently discovered an issue that sometimes happen with M1 machines. If the steps I gave above do not solve your issue, the solution might simply be to wait for our next release, which we will try to publish as soon as we can.

Ok sounds good! Would you be able to notify me once the next release is published? Thanks!

@aneesh yes of course, will do !