diff --git a/Cargo.lock b/Cargo.lock index 5ca8fea3..4092195f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -540,6 +540,15 @@ version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "ark-ff" version = "0.3.0" @@ -798,6 +807,12 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.9.0" @@ -971,6 +986,20 @@ name = "bytemuck" version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.99", +] [[package]] name = "byteorder" @@ -1316,6 +1345,52 @@ dependencies = [ "typenum", ] +[[package]] +name = "cust" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6cc71911e179f12483b9734120b45bd00bf64fab085cc4818428523eedd469" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "cust_core", + "cust_derive", + "cust_raw", + "find_cuda_helper", +] + +[[package]] +name = "cust_core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039f79662cb8f890cbf335e818cd522d6e3a53fe63f61d1aaaf859cd3d975f06" +dependencies = [ + "cust_derive", + "glam", + "mint", + "vek", +] + +[[package]] +name = "cust_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3bc95fe629aed92b2423de6ccff9e40174b21d19cb6ee6281a4d04ac72f66" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cust_raw" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf40d6ade12cb9828bbc844b9875c7b93d25e67a3c9bf61c7aa3ae09e402bf8" +dependencies = [ + "find_cuda_helper", +] + [[package]] name = "darling" version = "0.20.10" @@ -1460,6 +1535,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs" version = "5.0.1" @@ -1700,6 +1784,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "find_cuda_helper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f9e65c593dd01ac77daad909ea4ad17f0d6d1776193fc8ea766356177abdad" +dependencies = [ + "glob", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1860,6 +1953,15 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "glam" +version = "0.20.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43e957e744be03f5801a55472f593d43fabdebf25a4585db250f04d86b1675f" +dependencies = [ + "num-traits", +] + [[package]] name = "glob" version = "0.3.2" @@ -2139,6 +2241,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "iana-time-zone" version = "0.1.61" @@ -2496,7 +2607,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags", + "bitflags 2.9.0", "libc", ] @@ -2512,6 +2623,16 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "lockfree-object-pool" version = "0.1.6" @@ -2539,6 +2660,16 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matrixmultiply" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +dependencies = [ + "autocfg", + "rawpointer", +] + [[package]] name = "maybe-rayon" version = "0.1.1" @@ -2647,6 +2778,12 @@ dependencies = [ "adler2", ] +[[package]] +name = "mint" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53debba6bda7a793e5f99b8dacf19e626084f525f7829104ba9898f367d85ff" + [[package]] name = "modular-bitfield" version = "0.11.2" @@ -2688,6 +2825,20 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", + "rayon", +] + [[package]] name = "nibble_vec" version = "0.1.0" @@ -2806,6 +2957,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -3714,7 +3866,7 @@ dependencies = [ [[package]] name = "openvm-stark-backend" version = "1.0.0-rc.0" -source = "git+https://github.com/openvm-org/stark-backend.git?rev=bc364134b8315c27bfd29c6e77ac79fe77090137#bc364134b8315c27bfd29c6e77ac79fe77090137" +source = "git+ssh://git@github.com/scroll-tech/openvm-stark-gpu.git?branch=main#d587d1ce572fe291279c356dc836964ae8fc3843" dependencies = [ "async-trait", "cfg-if", @@ -3726,6 +3878,9 @@ dependencies = [ "p3-challenger", "p3-commit", "p3-field", + "p3-gpu-backend", + "p3-gpu-base", + "p3-gpu-module", "p3-matrix", "p3-maybe-rayon", "p3-uni-stark", @@ -3740,7 +3895,7 @@ dependencies = [ [[package]] name = "openvm-stark-sdk" version = "1.0.0-rc.0" -source = "git+https://github.com/openvm-org/stark-backend.git?rev=bc364134b8315c27bfd29c6e77ac79fe77090137#bc364134b8315c27bfd29c6e77ac79fe77090137" +source = "git+ssh://git@github.com/scroll-tech/openvm-stark-gpu.git?branch=main#d587d1ce572fe291279c356dc836964ae8fc3843" dependencies = [ "derivative", "derive_more 0.99.19", @@ -3756,6 +3911,7 @@ dependencies = [ "p3-dft", "p3-fri", "p3-goldilocks", + "p3-gpu-backend", "p3-keccak", "p3-merkle-tree", "p3-poseidon", @@ -3825,7 +3981,7 @@ dependencies = [ [[package]] name = "p3-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "p3-field", "p3-matrix", @@ -3834,7 +3990,7 @@ dependencies = [ [[package]] name = "p3-baby-bear" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "p3-field", "p3-mds", @@ -3848,7 +4004,7 @@ dependencies = [ [[package]] name = "p3-blake3" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "blake3", "p3-symmetric", @@ -3858,7 +4014,7 @@ dependencies = [ [[package]] name = "p3-bn254-fr" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "ff 0.13.0", "halo2curves", @@ -3873,7 +4029,7 @@ dependencies = [ [[package]] name = "p3-challenger" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "p3-field", "p3-maybe-rayon", @@ -3885,12 +4041,14 @@ dependencies = [ [[package]] name = "p3-commit" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ + "anyhow", "itertools 0.13.0", "p3-challenger", "p3-dft", "p3-field", + "p3-gpu-base", "p3-matrix", "p3-util", "serde", @@ -3899,7 +4057,7 @@ dependencies = [ [[package]] name = "p3-dft" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "p3-field", @@ -3912,7 +4070,7 @@ dependencies = [ [[package]] name = "p3-field" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "num-bigint 0.4.6", @@ -3929,26 +4087,31 @@ dependencies = [ [[package]] name = "p3-fri" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ + "anyhow", "itertools 0.13.0", "p3-challenger", "p3-commit", "p3-dft", "p3-field", + "p3-gpu-backend", + "p3-gpu-base", "p3-interpolation", "p3-matrix", "p3-maybe-rayon", + "p3-merkle-tree", "p3-util", "rand", "serde", "tracing", + "zkhash", ] [[package]] name = "p3-goldilocks" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "num-bigint 0.4.6", "p3-dft", @@ -3962,10 +4125,95 @@ dependencies = [ "serde", ] +[[package]] +name = "p3-gpu-backend" +version = "0.1.0" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" +dependencies = [ + "anyhow", + "bytemuck", + "cc", + "cust", + "cust_raw", + "ff 0.13.0", + "itertools 0.13.0", + "lazy_static", + "ndarray", + "once_cell", + "p3-baby-bear", + "p3-commit", + "p3-dft", + "p3-field", + "p3-gpu-base", + "p3-gpu-build", + "p3-interpolation", + "p3-matrix", + "p3-maybe-rayon", + "p3-poseidon2", + "p3-util", + "parking_lot", + "paste", + "rand", + "rand_core", + "rayon", + "serde", + "sppark", + "tracing", + "transpose", +] + +[[package]] +name = "p3-gpu-base" +version = "0.1.0" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" +dependencies = [ + "anyhow", + "bytemuck", + "cust", + "cust_raw", + "hex", + "lazy_static", + "p3-field", + "p3-matrix", + "parking_lot", + "tracing", +] + +[[package]] +name = "p3-gpu-build" +version = "0.1.0" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" +dependencies = [ + "cc", + "directories", + "hex", + "p3-gpu-field", + "sha2", + "tempfile", +] + +[[package]] +name = "p3-gpu-field" +version = "0.1.0" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" + +[[package]] +name = "p3-gpu-module" +version = "0.1.0" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" +dependencies = [ + "itertools 0.13.0", + "p3-field", + "p3-gpu-base", + "p3-matrix", + "p3-util", + "tracing", +] + [[package]] name = "p3-interpolation" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "p3-field", "p3-matrix", @@ -3976,7 +4224,7 @@ dependencies = [ [[package]] name = "p3-keccak" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "p3-field", @@ -3988,21 +4236,23 @@ dependencies = [ [[package]] name = "p3-keccak-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "p3-air", "p3-field", + "p3-gpu-backend", "p3-matrix", "p3-maybe-rayon", "p3-util", "rand", "tracing", + "zkhash", ] [[package]] name = "p3-matrix" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "p3-field", @@ -4017,7 +4267,7 @@ dependencies = [ [[package]] name = "p3-maybe-rayon" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "rayon", ] @@ -4025,7 +4275,7 @@ dependencies = [ [[package]] name = "p3-mds" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "p3-dft", @@ -4039,11 +4289,13 @@ dependencies = [ [[package]] name = "p3-merkle-tree" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ + "anyhow", "itertools 0.13.0", "p3-commit", "p3-field", + "p3-gpu-base", "p3-matrix", "p3-maybe-rayon", "p3-symmetric", @@ -4056,7 +4308,7 @@ dependencies = [ [[package]] name = "p3-monty-31" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "num-bigint 0.4.6", @@ -4077,7 +4329,7 @@ dependencies = [ [[package]] name = "p3-poseidon" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "p3-field", "p3-mds", @@ -4088,7 +4340,7 @@ dependencies = [ [[package]] name = "p3-poseidon2" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "gcd", "p3-field", @@ -4100,7 +4352,7 @@ dependencies = [ [[package]] name = "p3-poseidon2-air" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "p3-air", "p3-field", @@ -4116,7 +4368,7 @@ dependencies = [ [[package]] name = "p3-symmetric" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "p3-field", @@ -4126,7 +4378,7 @@ dependencies = [ [[package]] name = "p3-uni-stark" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "itertools 0.13.0", "p3-air", @@ -4144,7 +4396,7 @@ dependencies = [ [[package]] name = "p3-util" version = "0.1.0" -source = "git+https://github.com/Plonky3/Plonky3.git?rev=b0591e9#b0591e9b82d58d10f86359875b5d5fa96433b4cf" +source = "git+ssh://git@github.com/scroll-tech/plonky3-gpu.git?branch=openvm-v2#342685a5353519a56d26abea43ac40415f4189b3" dependencies = [ "serde", ] @@ -4196,6 +4448,29 @@ dependencies = [ "syn 2.0.99", ] +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + [[package]] name = "pasta_curves" version = "0.4.1" @@ -4391,7 +4666,7 @@ checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", "bit-vec", - "bitflags", + "bitflags 2.9.0", "lazy_static", "num-traits", "rand", @@ -4533,9 +4808,15 @@ version = "11.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6df7ab838ed27997ba19a4664507e6f82b41fe6e20be42929332156e5e85146" dependencies = [ - "bitflags", + "bitflags 2.9.0", ] +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + [[package]] name = "rayon" version = "1.10.0" @@ -4556,6 +4837,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] + [[package]] name = "redox_users" version = "0.4.6" @@ -5405,7 +5695,7 @@ dependencies = [ "alloy-eip7702 0.4.2", "alloy-primitives", "auto_impl", - "bitflags", + "bitflags 2.9.0", "bitvec", "c-kzg", "cfg-if", @@ -5424,7 +5714,7 @@ dependencies = [ "alloy-eip7702 0.5.1", "alloy-primitives", "auto_impl", - "bitflags", + "bitflags 2.9.0", "bitvec", "c-kzg", "cfg-if", @@ -5444,7 +5734,7 @@ dependencies = [ "alloy-eip7702 0.5.1", "alloy-primitives", "auto_impl", - "bitflags", + "bitflags 2.9.0", "bitvec", "c-kzg", "cfg-if", @@ -5619,7 +5909,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags", + "bitflags 2.9.0", "errno", "libc", "linux-raw-sys", @@ -5743,6 +6033,12 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "scroll-alloy-consensus" version = "1.1.5" @@ -5899,6 +6195,7 @@ dependencies = [ "openvm-native-recursion", "openvm-native-transpiler", "openvm-sdk", + "openvm-stark-sdk", "openvm-transpiler", "sbv", "scroll-zkvm-circuit-input-types", @@ -6279,6 +6576,15 @@ dependencies = [ "der", ] +[[package]] +name = "sppark" +version = "0.1.8" +source = "git+https://github.com/scroll-tech/sppark.git?branch=sp1-v3.0#07fe0de43a745a395dd718c735cdfe0cfc457b0a" +dependencies = [ + "cc", + "which", +] + [[package]] name = "stability" version = "0.2.1" @@ -6929,6 +7235,18 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "vek" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8085882662f9bc47fc8b0cdafa5e19df8f592f650c02b9083da8d45ac9eebd17" +dependencies = [ + "approx", + "num-integer", + "num-traits", + "rustc_version 0.4.1", +] + [[package]] name = "version_check" version = "0.9.5" @@ -7041,6 +7359,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -7285,7 +7615,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags", + "bitflags 2.9.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c599eef3..7338ad16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ openvm-rv32im-transpiler = { git = "https://github.com/openvm-org/openvm.git", r openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", rev = "f1b4844", default-features = false } openvm-sdk = { git = "https://github.com/openvm-org/openvm.git", rev = "f1b4844", default-features = false, features = ["parallel", "bench-metrics"] } -openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", rev = "bc364134b8315c27bfd29c6e77ac79fe77090137", default-features = false } +openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", rev = "bc364134b8315c27bfd29c6e77ac79fe77090137" } bitcode = { version = "0.6.3", default-features = false, features = ["serde", "derive"] } derivative = "2.2.0" @@ -76,6 +76,37 @@ alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" } tiny-keccak = { git = "https://github.com/scroll-tech/tiny-keccak", branch = "scroll-patch-v2.0.2-openvm-v1.0.0-rc.1" } +[patch."https://github.com/openvm-org/stark-backend.git"] +openvm-stark-backend = { git = "ssh://git@github.com/scroll-tech/openvm-stark-gpu.git", branch = "main", features = ["gpu"] } +openvm-stark-sdk = { git = "ssh://git@github.com/scroll-tech/openvm-stark-gpu.git", branch = "main", features = ["gpu"] } + +[patch."https://github.com/Plonky3/Plonky3.git"] +p3-air = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-field = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-commit = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-matrix = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-baby-bear = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", features = [ + "nightly-features", +], branch = "openvm-v2" } +p3-util = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-challenger = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-dft = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-fri = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-goldilocks = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-keccak = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-keccak-air = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-blake3 = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-mds = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-merkle-tree = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-monty-31 = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-poseidon = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-poseidon2 = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-poseidon2-air = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-symmetric = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-uni-stark = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } +p3-maybe-rayon = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } # the "parallel" feature is NOT on by default to allow single-threaded benchmarking +p3-bn254-fr = { git = "ssh://git@github.com/scroll-tech/plonky3-gpu.git", branch = "openvm-v2" } + [profile.release] codegen-units = 1 panic = "abort" diff --git a/crates/integration/Cargo.toml b/crates/integration/Cargo.toml index f9bc32de..b2a75bac 100644 --- a/crates/integration/Cargo.toml +++ b/crates/integration/Cargo.toml @@ -19,6 +19,7 @@ openvm-native-compiler = { workspace = true, default-features = false } openvm-native-recursion = { workspace = true, default-features = false } openvm-native-transpiler = { workspace = true, default-features = false } openvm-transpiler = { workspace = true, default-features = false } +openvm-stark-sdk.workspace = true alloy-primitives.workspace = true tiny-keccak.workspace = true @@ -41,3 +42,4 @@ glob = "0.3" default = ["scroll"] limit-logs = [] scroll = ["sbv/scroll"] +bench-metrics = ["scroll-zkvm-prover/bench-metrics", "openvm-sdk/bench-metrics", "openvm-circuit/bench-metrics"] diff --git a/crates/integration/tests/batch_circuit.rs b/crates/integration/tests/batch_circuit.rs index dd150564..8af8115c 100644 --- a/crates/integration/tests/batch_circuit.rs +++ b/crates/integration/tests/batch_circuit.rs @@ -1,3 +1,4 @@ +use openvm_stark_sdk::bench::run_with_metric_collection; use scroll_zkvm_integration::{ ProverTester, prove_verify_multi, prove_verify_single, testers::{ @@ -46,9 +47,11 @@ fn setup_prove_verify_single() -> eyre::Result<()> { BatchProverTester::setup()?; let task = load_recent_chunk_proofs()?; - prove_verify_single::(Some(task))?; + run_with_metric_collection("OUTPUT_PATH", || -> eyre::Result<()> { + prove_verify_single::(Some(task))?; - Ok(()) + Ok(()) + }) } #[test] diff --git a/crates/integration/tests/bundle_circuit.rs b/crates/integration/tests/bundle_circuit.rs index 869091f5..624067f2 100644 --- a/crates/integration/tests/bundle_circuit.rs +++ b/crates/integration/tests/bundle_circuit.rs @@ -1,3 +1,4 @@ +use openvm_stark_sdk::bench::run_with_metric_collection; use scroll_zkvm_integration::{ ProverTester, prove_verify_multi, prove_verify_single_evm, testers::{ @@ -25,9 +26,11 @@ fn setup_prove_verify() -> eyre::Result<()> { BundleProverTester::setup()?; let task = load_recent_batch_proofs()?; - prove_verify_single_evm::(Some(task))?; + run_with_metric_collection("OUTPUT_PATH", || -> eyre::Result<()> { + prove_verify_single_evm::(Some(task))?; - Ok(()) + Ok(()) + }) } #[test] diff --git a/crates/integration/tests/chunk_circuit.rs b/crates/integration/tests/chunk_circuit.rs index 467f8183..79ec28e2 100644 --- a/crates/integration/tests/chunk_circuit.rs +++ b/crates/integration/tests/chunk_circuit.rs @@ -1,3 +1,4 @@ +use openvm_stark_sdk::bench::run_with_metric_collection; use scroll_zkvm_integration::{ ProverTester, prove_verify_multi, prove_verify_single, testers::chunk::{ChunkProverTester, MultiChunkProverTester}, @@ -20,9 +21,11 @@ fn test_execute() -> eyre::Result<()> { fn setup_prove_verify_single() -> eyre::Result<()> { ChunkProverTester::setup()?; - prove_verify_single::(None)?; + run_with_metric_collection("OUTPUT_PATH", || -> eyre::Result<()> { + prove_verify_single::(None)?; - Ok(()) + Ok(()) + }) } #[test] diff --git a/crates/prover/Cargo.toml b/crates/prover/Cargo.toml index 56693f43..209d8653 100644 --- a/crates/prover/Cargo.toml +++ b/crates/prover/Cargo.toml @@ -41,3 +41,4 @@ eyre = "0.6" [features] default = ["scroll"] scroll = ["sbv/scroll"] +bench-metrics = ["openvm-sdk/bench-metrics", "openvm-circuit/bench-metrics"] diff --git a/crates/prover/src/prover/chunk.rs b/crates/prover/src/prover/chunk.rs index 37a6c786..9d457c33 100644 --- a/crates/prover/src/prover/chunk.rs +++ b/crates/prover/src/prover/chunk.rs @@ -50,6 +50,7 @@ impl ProverType for ChunkProverType { path_app_config: P, ) -> Result, Error> { let mut config = read_app_config(path_app_config)?; + assert_eq!(config.app_fri_params.fri_params.log_blowup, 1); config.app_vm_config.system.config = config .app_vm_config .system