-
Notifications
You must be signed in to change notification settings - Fork 2
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
Wrong proof generated by latest iciclegnark #7
Comments
@hussein-aitlahcen Thanks for opening the issue. I will investigate. |
@hussein-aitlahcen Im sorry I didn't ask you, what circuit are you using? |
It's a circuit that is not open source yet... Perhaps I can discuss with the team to add you in the repo if you want to replay the issue. |
@ImmanuelSegol I also added some logs after msm compuation of i.e. // prove.go
if _, err := bs1.MultiExp(pk.G1.B, wireValuesB, ecc.MultiExpConfig{NbTasks: n / 2}); err != nil {
chBs1Done <- err
close(chBs1Done)
return
}
fmt.Println("bs1: ", bs1)
...
// prove_gpu.go
bs1, _, _ = iciclegnark.MsmOnDevice(wireValuesBDevice.P, pk.G1Device.B, wireValuesBDevice.Size, true)
fmt.Println("bs1: ", bs1)
...
I'm compiling latest icicle using nix and gcc 11 + cuda>=12 with: cuda = pkgs-unstable.cudaPackages_12.cudatoolkit.overrideAttrs (old: old // { meta = null; });
cudart = pkgs-unstable.cudaPackages_12.cuda_cudart.overrideAttrs (old: old // { meta = null; });
pkgs.gcc11Stdenv.mkDerivation {
pname = "icicle";
version = "0.0.1";
src = pkgs.fetchFromGitHub {
owner = "ingonyama-zk";
repo = "icicle";
rev = "04e5ff5d1af4";
hash = "sha256-flqfyD/r614gJPN+w/I+PksJ5gnbltLMXdMq7Vh7ziY=";
};
buildPhase = ''
${cuda}/bin/nvcc -DG2_DEFINED -Xcompiler -fPIC -std=c++17 -shared -L${cudart}/lib \
icicle/curves/bn254/lde.cu \
icicle/curves/bn254/msm.cu \
icicle/curves/bn254/projective.cu \
icicle/curves/bn254/ve_mod_mult.cu \
-o libbn254.so
'';
installPhase = ''
mkdir -p $out/lib
mv libbn254.so $out/lib
'';
enableParallelBuilding = true;
doCheck = true;
}; EDIT: Looks like we ignore the commit return code also iciclegnark/curves/bn254/gnark.go Line 43 in 7c37237
|
@hussein-aitlahcen Is there any way you can perhaps send me or the scalars and points that are inputed into the prover or the circuits so I can run them locally? Because if you try to run some other circuit such as here https://github.com/ingonyama-zk/gnark/tree/clean-full-gpu/examples then it will pass. So im suspecting this is related to some sort of anomaly. |
Discussed with the team we can add you to the repo, do you have matrix handle? |
@hussein-aitlahcen Thanks for finding the KRS not waiting on AR and BS1 bug! 💪🏻 🚀. Just so you know, the setup phase moves all of the points and some additional data thats needed to the GPU immediately. I see that the GPU you are using has 6141MiB of mem; depending on the circuit size its possible that there isn't enough memory so when one of the functions tries to use an invalid pointer the GPU errors and can't recover. You should be able to see if this is the case by running |
Hi,
I tried using the latest gnark fork you guys have along the latest icicle and the result, when switching from CPU to GPU proving via the
gpu
tag when building our binary is:groth16.Verify on bn254 is failing for the GPU (gpu tag) generated proof:
pairing doesn't match
groth16.Verify on bn254 is succeeding for the non GPU generated proof:
{"level":"debug","curve":"bn254","backend":"groth16","took":0.826976,"time":"2023-09-23T13:18:30+02:00","message":"verifier done"}
For the same exact circuit, with the same exact inputs.
Maybe I shouldn't be using latest commits?
GPU:
The text was updated successfully, but these errors were encountered: