Skip to content
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

Update ICICLE integration to use v3 ICICLE #1318

Merged
merged 41 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
daab148
Updated ICICLE setup and prove to use v2, need to test correctness vs…
jeremyfelder Apr 24, 2024
aa20664
Update mod to use released v2.0.2 of icicle
jeremyfelder Apr 25, 2024
d9713f8
MSMs and non-coset ntts working. Coset ntt fails in computeH
jeremyfelder Apr 25, 2024
ec3c980
Fix coset ntt and have correctness
jeremyfelder Apr 26, 2024
9710f58
bump icicle to v2.0.3
jeremyfelder Apr 26, 2024
5b8506f
Use double size domain instead of FrMultiplicativeGen, Add timings
jeremyfelder Apr 28, 2024
89c49e4
Fix invalid proofs for > 2^15
jeremyfelder Apr 28, 2024
a6ea30d
Fix ordering issue for computeH
jeremyfelder Apr 30, 2024
a7780a8
Convert from mont at setup
jeremyfelder Apr 30, 2024
7ce42e5
WIP, needs testing
jeremyfelder Nov 11, 2024
7ab36fe
Working version with v3
jeremyfelder Nov 11, 2024
85859df
Verified proofs with device warmup
jeremyfelder Nov 18, 2024
36f2be2
Fix domain transfer to run on device
jeremyfelder Nov 18, 2024
ef96e72
Updated master branch with v3
jeremyfelder Nov 18, 2024
e97b8a4
Merge branch 'master' into master-v3-merge
jeremyfelder Nov 18, 2024
78901ae
Update readme instructions for ICICLE usage
jeremyfelder Nov 18, 2024
4eeba0a
Remove logs and unnecessary function
jeremyfelder Nov 18, 2024
506361e
formatting in bn254/prove.go
jeremyfelder Nov 18, 2024
429d02d
Add backend loading and warmup to NewProvingKey to allow loading a pr…
jeremyfelder Nov 19, 2024
1abf497
Merge branch 'icicle-v3-upgrade' into master-v3-merge
jeremyfelder Nov 19, 2024
e1fc63a
chore: gofmt
ivokub Nov 26, 2024
b9264f9
feat: warmup in once
ivokub Nov 26, 2024
228a805
chore: avoid side effects leak
ivokub Nov 26, 2024
836d20b
chore: make WarmUpDevice private
ivokub Nov 26, 2024
59155c8
fix: fail early when initializing backend
ivokub Nov 26, 2024
9b81879
feat: log loaded backend
ivokub Nov 26, 2024
0efaa83
test: complete marshal test with proofs
ivokub Nov 26, 2024
1f56516
fix: run test only with icicle tag set
ivokub Nov 26, 2024
71fd985
feat: single profile mode check
ivokub Nov 26, 2024
b8ae31e
refactor: avoid passing logger instance
ivokub Nov 26, 2024
6c25fb5
feat: handle errors
ivokub Nov 26, 2024
8207af9
fix: avoid leaking channels
ivokub Nov 26, 2024
1134314
Replace pederson commit and proveknowledge with icicle msm
jeremyfelder Nov 28, 2024
1232677
refactor: panic instead of err
ivokub Dec 3, 2024
3e7eb2d
chore: debug stats only when requested
ivokub Dec 3, 2024
9c6cee9
chore: remove commented gomod replace
ivokub Dec 3, 2024
50eeb15
docs: CUDA kernel license mention
ivokub Dec 3, 2024
9827690
fix: copy commitment bases synchronosly
ivokub Dec 11, 2024
b691463
feat: warm up device also for dummysetup
ivokub Dec 11, 2024
ef718bd
feat: copy commitment proving keys once at init
ivokub Dec 11, 2024
1edf843
feat: copy committed values only once
ivokub Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ func main() {

### GPU Support

#### Icicle Library
#### ICICLE Library

The following schemes and curves support experimental use of Ingonyama's Icicle GPU library for low level zk-SNARK primitives such as MSM, NTT, and polynomial operations:
The following schemes and curves support experimental use of Ingonyama's ICICLE GPU library for low level zk-SNARK primitives such as MSM, NTT, and polynomial operations:

- [x] [Groth16](https://eprint.iacr.org/2016/260)

Expand All @@ -183,7 +183,7 @@ You can then toggle on or off icicle acceleration by providing the `WithIcicleAc
proof, err := groth16.Prove(ccs, pk, secretWitness)
```

For more information about prerequisites see the [Icicle repo](https://github.com/ingonyama-zk/icicle).
For more information about prerequisites see the [ICICLE repo](https://github.com/ingonyama-zk/icicle). **NB! ICICLE CUDA kernels are covered by a special license for now. Follow the instructions to download and set up the kernels.**

## Citing

Expand Down
29 changes: 29 additions & 0 deletions backend/groth16/bn254/icicle/device.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package icicle

import (
"fmt"
"sync"

"github.com/consensys/gnark/logger"
icicle_runtime "github.com/ingonyama-zk/icicle/v3/wrappers/golang/runtime"
)

var onceWarmUpDevice sync.Once

func warmUpDevice() {
onceWarmUpDevice.Do(func() {
log := logger.Logger()
err := icicle_runtime.LoadBackendFromEnvOrDefault()
if err != icicle_runtime.Success {
panic(fmt.Sprintf("ICICLE backend loading error: %s", err.AsString()))
}
device := icicle_runtime.CreateDevice("CUDA", 0)
log.Debug().Int32("id", device.Id).Str("type", device.GetDeviceType()).Msg("ICICLE device created")
icicle_runtime.RunOnDevice(&device, func(args ...any) {
err := icicle_runtime.WarmUpDevice()
if err != icicle_runtime.Success {
panic(fmt.Sprintf("ICICLE device warmup error: %s", err.AsString()))
}
})
})
}
2 changes: 1 addition & 1 deletion backend/groth16/bn254/icicle/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Package icicle_bn254 implements ICICLE acceleration for BN254 Groth16 backend.
package icicle_bn254
package icicle
Loading