Comments (16)
Hello,
Would you be able to give us more info about your issue ? More precisely, would it be possible to :
- indicate to us which model you are working with
- set
verbose=True
when compiling your model (depending what you are doing:compile
,compile_torch_model
, etc.) and share us the printed details
Many thanks !
from concrete-ml.
In Concrete v1, homomorphic encryption wasn't simulated, computation graph was walked and evaluated (and some errors are added before TLUs to kinda simulate p_error). Here are the relevant pieces of code:
- https://github.com/zama-ai/concrete/blob/cb19989fe15970ef6d993e75c3a512f07c0a5408/frontends/concrete-python/concrete/fhe/compilation/circuit.py#L59-L72
- https://github.com/zama-ai/concrete/blob/cb19989fe15970ef6d993e75c3a512f07c0a5408/frontends/concrete-python/concrete/fhe/representation/graph.py#L53-L66
- https://github.com/zama-ai/concrete/blob/cb19989fe15970ef6d993e75c3a512f07c0a5408/frontends/concrete-python/concrete/fhe/representation/graph.py#L68-L188
With Concrete v2, homomorphic encryption is simulated! We've introduced a new backend to do that and new simulation is using the same compiler architecture, so it's much more accurate. Here is the relevant piece of code:
Hope it helps!
from concrete-ml.
After updating the new version of concrete ml, this issue occurred. In previous versions, there was no such warning.
CifarInFhe.ipynb
from concrete-ml.
Thanks for reporting ! We are indeed getting the same warning and are thus currently investigating on what could be the issue 🙂
from concrete-ml.
Hello,
Thanks for reporting the warning!
We have fixed the issue on our end, but in the meantime, you can also make a fix on your side to continue.
def fhe_compatibility(model: Callable, data: DataLoader) -> Callable:
qmodel = compile_brevitas_qat_model(
model.to("cpu"),
# Training
torch_inputset=data,
show_mlir=False,
output_onnx_file="test.onnx",
)
return qmodel
Thanks !
from concrete-ml.
Hello, thank you for replying to me.
But I still have a problem.
Do you mean that the configuration and p_error parameters are not required?
Can you explain these two parameters to me?
from concrete-ml.
Hi, you can find an explanation of p_error
in this documentation page. Here the solution proposed is to remove the custom p_error
value that this example was setting.
You mention that you still have a problem, can you please elaborate ?
from concrete-ml.
Thanks,How fhe_simulation_inference function simulate Homomorphic encryption?Where can I see the details of simulation?
from concrete-ml.
To complement @umut-sahin's answer, Concrete-ML's currently works with Concrete v1 but we are planning on integrating v2 in our next release !
from concrete-ml.
So this code does not simulate Homomorphic encryption?It uses Concrete v1 ?cifar_brevitas_finetuning
from concrete-ml.
Yes it does provide some kind of FHE simulation using Concrete v1's technique (graph evaluation + noise simulation), fhe_simulation_inference
does not execute the inference in FHE ! The technique is just not as accurate as its second version (documentation: https://docs.zama.ai/concrete/tutorials/simulation), which will come with Concrete ML's next release. Still, you should currently be able to simulate FHE execution with a very good accuracy.
from concrete-ml.
Hello @maxwellgodv , if you are satisfied with the above answer, please feel free to close this issue 🙂
from concrete-ml.
So is it to compile the quantitative model into an circuit, and then input the data into the circuit for prediction ?And, where can I find documents about circuit.
I don't have much knowledge about circuit.Thanks.
from concrete-ml.
There is no dedicated page for circuit, but there are pages for everything you can do with a circuit in https://docs.zama.ai/concrete!
Also, you can read the source code, every method is documented https://github.com/zama-ai/concrete/blob/main/frontends/concrete-python/concrete/fhe/compilation/circuit.py 🙂
And of course you can always ask directly to us, see https://www.zama.ai/community 😉
from concrete-ml.
Hello again @maxwellgodv, is it okay for you if we close this issue as the current discussion does not concern the initial problem anymore ? If you have more questions, we'll gladly answer you on our community forum as well as on the Concrete ML channel that you can find in FHE.org's discord server 🙂
Thanks again for the report !
from concrete-ml.
OK,thanks
from concrete-ml.
Related Issues (20)
- Feature Request: Add support for embedding layers HOT 4
- [Question] How exactly the HybridFHE functions HOT 1
- [Question] FHE inference over a single image time HOT 2
- installation error HOT 7
- [Question] Discord link in explanation HOT 2
- High accuracy variance during the training with SGDClassifier HOT 1
- Feature Request : Implement LogSoftmax, Softmax, ReduceMax HOT 3
- Performance Issues HOT 1
- Two consecutive Unsqueeze operations in QAT model throws error at compilation time HOT 2
- LLVM symbolizer error with LogisticRegression example HOT 15
- [Question] What HE algorithm is used? HOT 6
- [Question] AssertionError: Values must be float if value_is_float is set to True, got int64: [1] HOT 3
- AssertionError: Values must be float if value_is_float is set to True, got int64: [[[[102 14 188 ... 85 205 46] HOT 3
- RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! HOT 7
- Python 3.12 HOT 2
- Adding encrypted training for other ML models and DL models HOT 5
- quantized_module.forward() occured an error in "execute" mode HOT 8
- Feature request: Support Unfold torch operator HOT 10
- LLVM symbolizer error when running FHE in 'execute' mode HOT 7
- [Question] How does ReLU work in the new NN example HOT 6
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-ml.