Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Ipykernel dies when .compile() method runs/completes #105

Open
yusuf-jkhan1 opened this issue Mar 11, 2023 · 2 comments
Open

Ipykernel dies when .compile() method runs/completes #105

yusuf-jkhan1 opened this issue Mar 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@yusuf-jkhan1
Copy link

yusuf-jkhan1 commented Mar 11, 2023

Summary

Ipykernel dies when .compile() method runs/completes

Description

On MacOS with Docker.
Ran docker pull of latest concrete-numpy image.
Ran docker from terminal with docker run --rm -it -p 8888:8888 <image_id>

When running first concrete-numpy example kernel dies and restarts when .compile() method is called

import concrete.numpy as cnp

def add(x, y):
    return x + y

compiler = cnp.Compiler(add, {"x": "encrypted", "y": "encrypted"})
inputset = [(2, 3), (0, 0), (1, 6), (7, 7), (7, 1), (3, 2), (6, 1), (1, 7), (4, 5), (5, 4)]

print(f"Compiling...")
circuit = compiler.compile(inputset)

print(f"Generating keys...") #Never printed, kernel crashes and restarts
circuit.keygen()

examples = [(3, 4), (1, 2), (7, 7), (0, 0)]
for example in examples:
    encrypted_example = circuit.encrypt(*example)
    encrypted_result = circuit.run(encrypted_example)
    result = circuit.decrypt(encrypted_result)
    print(f"Evaluation of {' + '.join(map(str, example))} homomorphically = {result}")

Notebook throws this
The kernel appears to have died. It will restart automatically.

Unfortunately jupyter server logs from the running docker container don't seem to show anything useful beyond this:

2023-03-10 22:54:58 [I 07:54:58.381 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
2023-03-10 22:54:58 WARNING:root:kernel 2f2a2a20-f70b-467d-add5-50da66cc979f restarted

Steps to reproduce

  1. $docker pull zamafhe/concrete-numpy:v1.0.0
  2. $docker run --rm -it -p 8888:8888 zamafhe/concrete-numpy:v1.0.0
  3. Open Jupyter Notebook from token authenticated link provided in docker log
  4. Run example python code above.

Misc Details

This is an awesome project and I want to try develop a few unsupervised algorithms not yet in concreteML and tackle some of the bounties you guys have

@yusuf-jkhan1 yusuf-jkhan1 added the bug Something isn't working label Mar 11, 2023
@umut-sahin
Copy link
Collaborator

We're aware of some issues with macOS and docker at the moment, we're investigating. I'll keep you updated in this issue once the bug is fixed and the fix is released.

@aquint-zama
Copy link
Contributor

aquint-zama commented Apr 14, 2023

the new version of concrete-numpy (renamed concrete-python) now supports Apple Silicon processor, could you please install concrete-python 1.0.0, look at this UPGRADING.md document and see if it fixes your issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants