Comments (4)
Alright, thank you very much for your help!
from concrete-numpy.
Hello,
I tried to recreate the error you get but I couldn't. Here is what I did:
Created a new virtual env using:
$ python3.8 -m venv .venv
Activated it:
$ source .venv/bin/activate
Installed concrete-numpy:
$ pip install concrete-numpy
Here is the state of the environment:
$ pip freeze
concrete-compiler==0.6.0
concrete-numpy==0.5.0
cycler==0.11.0
fonttools==4.33.3
kiwisolver==1.4.3
loguru==0.5.3
matplotlib==3.5.2
networkx==2.8.4
numpy==1.23.0
packaging==21.3
Pillow==9.1.1
pyparsing==3.0.9
python-dateutil==2.8.2
PyYAML==6.0
six==1.16.0
torch==1.11.0
typing_extensions==4.2.0
Finally ran this code:
import concrete.numpy as hnp
import numpy as np
squared = hnp.LookupTable([i ** 2 for i in range(4)])
cubed = hnp.LookupTable([i ** 3 for i in range(4)])
table = hnp.MultiLookupTable([
[squared, cubed],
[squared, cubed],
[squared, cubed],
])
def f(x):
return table[x]
t_lookup_inputset = [
np.array([[0, 0], [0, 1], [0, 2]], dtype=np.uint8),
np.array([[1, 1], [1, 2], [1, 3]], dtype=np.uint8),
np.array([[2, 1], [2, 2], [2, 3]], dtype=np.uint8),
]
compiler = hnp.NPFHECompiler(
f, {"x": "encrypted"}
)
print('compiling the circuit')
table_circuit = compiler.compile_on_inputset(t_lookup_inputset)
print('compile done')
inp = np.array([[0, 1], [1, 1], [1, 2]], dtype=np.uint8)
print(table_circuit.encrypt_run_decrypt(inp))
This is the output I get:
compiling the circuit
compile done
[[0 1]
[1 1]
[1 8]]
Could you verify that it's working? And if it's not working could you share reproduction steps.
Thanks.
from concrete-numpy.
Hi Metu,
Thank you for your swift reply! I just checked again, and it seems to be working without issues. I am using jupyter notebooks, so maybe I had some artifacts left from the other things I have tried. A small additional question, how do I fix the
WARNING: You are currently using the software variant of concrete-csprng which does not have access to a hardware source of randomness. To ensure the security of your application, please arrange to provide a secret by using the `concrete_csprng::set_soft_rdseed_secret` function.
Since I am working in Python and this seems to be a Rust function?
Thank you!
Best,
Mirza
from concrete-numpy.
This warning could happen if you are a non-x86 architecture, say on Apple Silicon for example (that is my case). And in that case you cant use hardware acceleration and have slower performances. It is indeed in one of the Rust dependency of concrete-numpy.
More info on the issue here: https://community.zama.ai/t/support-for-hardware-source-of-randomness-in-docker-vm/44
from concrete-numpy.
Related Issues (14)
- Use multiprocessing to avoid crashes
- Ipykernel dies when .compile() method runs/completes HOT 2
- Fix broken link to the table lookups tutorial in the README file HOT 1
- [Question]: Disabling concrete-csprng warning HOT 2
- Not installing with pip in googlecloab HOT 1
- AttributeError: 'FHECircuit' object has no attribute 'encrypt_run_decrypt' HOT 2
- Unable to install through PIP HOT 5
- Is it possible to implement.sum and.array in numpy? Is that possible HOT 4
- Float usage HOT 9
- Could not find a version that satisfies the requirement concrete-compiler HOT 14
- Docker M1 Illegal instruction HOT 1
- Allow large models to be compiled, avoiding `RuntimeError: Can't emit artifacts` HOT 1
- np.dot between matrices results in compilation error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concrete-numpy.