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

optimizing proof generation #46

Open
3 tasks
mrain opened this issue Aug 29, 2024 · 4 comments
Open
3 tasks

optimizing proof generation #46

mrain opened this issue Aug 29, 2024 · 4 comments

Comments

@mrain
Copy link
Contributor

mrain commented Aug 29, 2024

There are two problems:

  • Canonical serialization of this struct uses compressed form. Therefore the overall block_derivation_proofs deserialization takes over 1.7m cycles over 5.8 cycles.

  • this comment observed that most cycles are spent on Montgomery inversion, and they are invoked by Radix2EvaluationDomain::new().

  • use big integer precompiles, or if we upgrade the sp1 prover to 1.3.0 we have even more field operation precompiles.

@mrain mrain changed the title Optimizing the serialization optimizing proof generation Sep 3, 2024
@mrain
Copy link
Contributor Author

mrain commented Sep 6, 2024

Status update:

According to the profiling in branch cl/opt.
Serialization and evaluation domain initialization don't consume that many cycles as compared to namespace verification if the rollup has more than 10k bytes of transactions. Profiling details are attached later.

Two optimizations mentioned before could shave of roughly 3~5m cycles out of 70m cycles in order to prove ~55k bytes of rollup transactions.

For namespace verification, roughly 40%~50% of cycles are spent on FFT, and they could be avoided after EspressoSystems/jellyfish#339 .

Also proving 10k bytes of transactions requires more than 128GB RAM.
Current benchmark results are (64 cores AMD EPYC 9R14, 128GB RAM) :

  • 1.5k bytes of rollup transactions: 13.7m cycles, 175s for plonky3 proof.
  • 6k bytes of rollup transactions: 21.1m cycles, 306s for plonky3 proof.
Ns payload length: 55074
2024-09-06T15:57:26.098552Z  INFO execute: clk = 0 pc = 0x271e84    
2024-09-06T15:57:26.098692Z  INFO execute: ┌╴input    
2024-09-06T15:57:26.098737Z  INFO execute: │ ┌╴payload    
2024-09-06T15:57:26.170734Z  INFO execute: │ └╴881,824 cycles    
2024-09-06T15:57:26.170787Z  INFO execute: │ ┌╴vid_param    
2024-09-06T15:57:26.631980Z  INFO execute: │ └╴4,892,088 cycles    
2024-09-06T15:57:26.632412Z  INFO execute: │ ┌╴block derivation proof input    
2024-09-06T15:57:26.906850Z  INFO execute: │ └╴3,003,412 cycles    
2024-09-06T15:57:26.906904Z  INFO execute: └╴8,783,334 cycles    
2024-09-06T15:57:26.906942Z  INFO execute: ┌╴rollup_commitment    
2024-09-06T15:57:26.937600Z  INFO execute: └╴326,387 cycles    
2024-09-06T15:57:26.937647Z  INFO execute: ┌╴derivation    
2024-09-06T15:57:26.937695Z  INFO execute: │ ┌╴verify_block_derivation_proof    
2024-09-06T15:57:26.937730Z  INFO execute: │ │ ┌╴bmt membership proof    
2024-09-06T15:57:26.943429Z  INFO execute: │ │ └╴64,663 cycles    
2024-09-06T15:57:26.946666Z  INFO execute: │ │ ┌╴construct vid    
2024-09-06T15:57:26.986575Z  INFO execute: │ │ └╴458,828 cycles    
2024-09-06T15:57:26.986633Z  INFO execute: │ │ ┌╴payload_verify    
2024-09-06T15:57:26.989545Z  INFO execute: │ │ │ ┌╴range_byte_to_poly    
2024-09-06T15:57:26.989588Z  INFO execute: │ │ │ └╴422 cycles    
2024-09-06T15:57:26.989642Z  INFO execute: │ │ │ ┌╴rebuild polynomials    
2024-09-06T15:57:26.989680Z  INFO execute: │ │ │ └╴411 cycles    
2024-09-06T15:57:26.989716Z  INFO execute: │ │ │ ┌╴rebuild commits    
2024-09-06T15:57:26.989837Z  INFO execute: │ │ │ │ ┌╴construct polynomial 3    
2024-09-06T15:57:27.020932Z  INFO execute: clk = 10000000 pc = 0x240938    
2024-09-06T15:57:27.055075Z  INFO execute: │ │ │ │ └╴615,191 cycles    
2024-09-06T15:57:27.055190Z  INFO execute: │ │ │ │ ┌╴commit polynomial 3    
2024-09-06T15:57:27.940477Z  INFO execute: │ │ │ │ └╴797,724 cycles    
2024-09-06T15:57:27.940610Z  INFO execute: │ │ │ │ ┌╴check commit 3    
2024-09-06T15:57:27.940747Z  INFO execute: │ │ │ │ └╴1,559 cycles    
2024-09-06T15:57:27.940850Z  INFO execute: │ │ │ │ ┌╴construct polynomial 4    
2024-09-06T15:57:28.007451Z  INFO execute: │ │ │ │ └╴695,728 cycles    
2024-09-06T15:57:28.007560Z  INFO execute: │ │ │ │ ┌╴commit polynomial 4    
2024-09-06T15:57:28.855305Z  INFO execute: │ │ │ │ └╴797,598 cycles    
2024-09-06T15:57:28.855449Z  INFO execute: │ │ │ │ ┌╴check commit 4    
2024-09-06T15:57:28.855585Z  INFO execute: │ │ │ │ └╴1,559 cycles    
2024-09-06T15:57:28.855624Z  INFO execute: │ │ │ └╴2,916,524 cycles    
2024-09-06T15:57:28.855668Z  INFO execute: │ │ └╴2,944,934 cycles    
2024-09-06T15:57:28.855704Z  INFO execute: │ └╴3,508,106 cycles    
2024-09-06T15:57:28.855742Z  INFO execute: │ ┌╴verify_block_derivation_proof    
2024-09-06T15:57:28.855776Z  INFO execute: │ │ ┌╴bmt membership proof    
2024-09-06T15:57:28.861006Z  INFO execute: │ │ └╴64,663 cycles    
2024-09-06T15:57:28.864043Z  INFO execute: │ │ ┌╴construct vid    
2024-09-06T15:57:28.901559Z  INFO execute: │ │ └╴458,828 cycles    
2024-09-06T15:57:28.901609Z  INFO execute: │ │ ┌╴payload_verify    
2024-09-06T15:57:28.914471Z  INFO execute: │ │ │ ┌╴range_byte_to_poly    
2024-09-06T15:57:28.914515Z  INFO execute: │ │ │ └╴422 cycles    
2024-09-06T15:57:28.914552Z  INFO execute: │ │ │ ┌╴rebuild polynomials    
2024-09-06T15:57:28.914591Z  INFO execute: │ │ │ └╴411 cycles    
2024-09-06T15:57:28.914627Z  INFO execute: │ │ │ ┌╴rebuild commits    
2024-09-06T15:57:28.914747Z  INFO execute: │ │ │ │ ┌╴construct polynomial 7    
2024-09-06T15:57:28.967735Z  INFO execute: │ │ │ │ └╴547,661 cycles    
2024-09-06T15:57:28.967843Z  INFO execute: │ │ │ │ ┌╴commit polynomial 7    
2024-09-06T15:57:29.811661Z  INFO execute: │ │ │ │ └╴797,643 cycles    
2024-09-06T15:57:29.811794Z  INFO execute: │ │ │ │ ┌╴check commit 7    
2024-09-06T15:57:29.811930Z  INFO execute: │ │ │ │ └╴1,559 cycles    
2024-09-06T15:57:29.812030Z  INFO execute: │ │ │ │ ┌╴construct polynomial 8    
2024-09-06T15:57:29.886738Z  INFO execute: │ │ │ │ └╴767,037 cycles    
2024-09-06T15:57:29.886845Z  INFO execute: │ │ │ │ ┌╴commit polynomial 8    
2024-09-06T15:57:30.734272Z  INFO execute: │ │ │ │ └╴797,742 cycles    
2024-09-06T15:57:30.734402Z  INFO execute: │ │ │ │ ┌╴check commit 8    
2024-09-06T15:57:30.734540Z  INFO execute: │ │ │ │ └╴1,559 cycles    
2024-09-06T15:57:30.734640Z  INFO execute: │ │ │ │ ┌╴construct polynomial 9    
2024-09-06T15:57:30.807679Z  INFO execute: │ │ │ │ └╴766,747 cycles    
2024-09-06T15:57:30.807788Z  INFO execute: │ │ │ │ ┌╴commit polynomial 9    
2024-09-06T15:57:31.656263Z  INFO execute: │ │ │ │ └╴796,941 cycles    
2024-09-06T15:57:31.656379Z  INFO execute: │ │ │ │ ┌╴check commit 9    
2024-09-06T15:57:31.656513Z  INFO execute: │ │ │ │ └╴1,559 cycles    
2024-09-06T15:57:31.656622Z  INFO execute: │ │ │ │ ┌╴construct polynomial 10    
2024-09-06T15:57:31.730807Z  INFO execute: │ │ │ │ └╴765,161 cycles    
2024-09-06T15:57:31.730926Z  INFO execute: │ │ │ │ ┌╴commit polynomial 10    
2024-09-06T15:57:32.578507Z  INFO execute: │ │ │ │ └╴797,358 cycles    
2024-09-06T15:57:32.578646Z  INFO execute: │ │ │ │ ┌╴check commit 10    
2024-09-06T15:57:32.578786Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:32.578886Z  INFO execute: │ │ │ │ ┌╴construct polynomial 11    
2024-09-06T15:57:32.639647Z  INFO execute: clk = 20000000 pc = 0x23ff80    
2024-09-06T15:57:32.653154Z  INFO execute: │ │ │ │ └╴767,410 cycles    
2024-09-06T15:57:32.653261Z  INFO execute: │ │ │ │ ┌╴commit polynomial 11    
2024-09-06T15:57:33.514489Z  INFO execute: │ │ │ │ └╴796,737 cycles    
2024-09-06T15:57:33.514648Z  INFO execute: │ │ │ │ ┌╴check commit 11    
2024-09-06T15:57:33.514784Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:33.514885Z  INFO execute: │ │ │ │ ┌╴construct polynomial 12    
2024-09-06T15:57:33.588172Z  INFO execute: │ │ │ │ └╴767,245 cycles    
2024-09-06T15:57:33.588283Z  INFO execute: │ │ │ │ ┌╴commit polynomial 12    
2024-09-06T15:57:34.435556Z  INFO execute: │ │ │ │ └╴797,124 cycles    
2024-09-06T15:57:34.435688Z  INFO execute: │ │ │ │ ┌╴check commit 12    
2024-09-06T15:57:34.435827Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:34.435928Z  INFO execute: │ │ │ │ ┌╴construct polynomial 13    
2024-09-06T15:57:34.509240Z  INFO execute: │ │ │ │ └╴766,674 cycles    
2024-09-06T15:57:34.509349Z  INFO execute: │ │ │ │ ┌╴commit polynomial 13    
2024-09-06T15:57:35.354103Z  INFO execute: │ │ │ │ └╴797,754 cycles    
2024-09-06T15:57:35.354242Z  INFO execute: │ │ │ │ ┌╴check commit 13    
2024-09-06T15:57:35.354380Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:35.354481Z  INFO execute: │ │ │ │ ┌╴construct polynomial 14    
2024-09-06T15:57:35.427769Z  INFO execute: │ │ │ │ └╴765,907 cycles    
2024-09-06T15:57:35.427883Z  INFO execute: │ │ │ │ ┌╴commit polynomial 14    
2024-09-06T15:57:36.302066Z  INFO execute: │ │ │ │ └╴797,016 cycles    
2024-09-06T15:57:36.302186Z  INFO execute: │ │ │ │ ┌╴check commit 14    
2024-09-06T15:57:36.302324Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:36.302440Z  INFO execute: │ │ │ │ ┌╴construct polynomial 15    
2024-09-06T15:57:36.384219Z  INFO execute: │ │ │ │ └╴766,177 cycles    
2024-09-06T15:57:36.384333Z  INFO execute: │ │ │ │ ┌╴commit polynomial 15    
2024-09-06T15:57:37.253964Z  INFO execute: │ │ │ │ └╴796,440 cycles    
2024-09-06T15:57:37.254094Z  INFO execute: │ │ │ │ ┌╴check commit 15    
2024-09-06T15:57:37.254228Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:37.254323Z  INFO execute: │ │ │ │ ┌╴construct polynomial 16    
2024-09-06T15:57:37.311613Z  INFO execute: │ │ │ │ └╴766,818 cycles    
2024-09-06T15:57:37.311719Z  INFO execute: │ │ │ │ ┌╴commit polynomial 16    
2024-09-06T15:57:38.149242Z  INFO execute: │ │ │ │ └╴797,349 cycles    
2024-09-06T15:57:38.149371Z  INFO execute: │ │ │ │ ┌╴check commit 16    
2024-09-06T15:57:38.149508Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:38.149600Z  INFO execute: │ │ │ │ ┌╴construct polynomial 17    
2024-09-06T15:57:38.185755Z  INFO execute: │ │ │ │ └╴490,229 cycles    
2024-09-06T15:57:38.185851Z  INFO execute: │ │ │ │ ┌╴commit polynomial 17    
2024-09-06T15:57:38.947698Z  INFO execute: clk = 30000000 pc = 0x26faf0    
2024-09-06T15:57:39.025745Z  INFO execute: │ │ │ │ └╴797,178 cycles    
2024-09-06T15:57:39.025847Z  INFO execute: │ │ │ │ ┌╴check commit 17    
2024-09-06T15:57:39.025980Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:39.026015Z  INFO execute: │ │ │ └╴16,761,231 cycles    
2024-09-06T15:57:39.026057Z  INFO execute: │ │ └╴16,892,084 cycles    
2024-09-06T15:57:39.026092Z  INFO execute: │ └╴17,455,256 cycles    
2024-09-06T15:57:39.026128Z  INFO execute: │ ┌╴verify_block_derivation_proof    
2024-09-06T15:57:39.026161Z  INFO execute: │ │ ┌╴bmt membership proof    
2024-09-06T15:57:39.031085Z  INFO execute: │ │ └╴64,663 cycles    
2024-09-06T15:57:39.033962Z  INFO execute: │ │ ┌╴construct vid    
2024-09-06T15:57:39.067464Z  INFO execute: │ │ └╴458,828 cycles    
2024-09-06T15:57:39.067500Z  INFO execute: │ │ ┌╴payload_verify    
2024-09-06T15:57:39.070417Z  INFO execute: │ │ │ ┌╴range_byte_to_poly    
2024-09-06T15:57:39.070461Z  INFO execute: │ │ │ └╴422 cycles    
2024-09-06T15:57:39.070495Z  INFO execute: │ │ │ ┌╴rebuild polynomials    
2024-09-06T15:57:39.070532Z  INFO execute: │ │ │ └╴411 cycles    
2024-09-06T15:57:39.070566Z  INFO execute: │ │ │ ┌╴rebuild commits    
2024-09-06T15:57:39.070673Z  INFO execute: │ │ │ │ ┌╴construct polynomial 7    
2024-09-06T15:57:39.124961Z  INFO execute: │ │ │ │ └╴734,744 cycles    
2024-09-06T15:57:39.125055Z  INFO execute: │ │ │ │ ┌╴commit polynomial 7    
2024-09-06T15:57:39.965652Z  INFO execute: │ │ │ │ └╴798,514 cycles    
2024-09-06T15:57:39.965774Z  INFO execute: │ │ │ │ ┌╴check commit 7    
2024-09-06T15:57:39.965902Z  INFO execute: │ │ │ │ └╴1,559 cycles    
2024-09-06T15:57:39.965993Z  INFO execute: │ │ │ │ ┌╴construct polynomial 8    
2024-09-06T15:57:40.018877Z  INFO execute: │ │ │ │ └╴714,153 cycles    
2024-09-06T15:57:40.018971Z  INFO execute: │ │ │ │ ┌╴commit polynomial 8    
2024-09-06T15:57:40.865027Z  INFO execute: │ │ │ │ └╴797,247 cycles    
2024-09-06T15:57:40.865134Z  INFO execute: │ │ │ │ ┌╴check commit 8    
2024-09-06T15:57:40.865260Z  INFO execute: │ │ │ │ └╴1,559 cycles    
2024-09-06T15:57:40.865297Z  INFO execute: │ │ │ └╴3,054,941 cycles    
2024-09-06T15:57:40.865336Z  INFO execute: │ │ └╴3,093,944 cycles    
2024-09-06T15:57:40.865371Z  INFO execute: │ └╴3,657,116 cycles    
2024-09-06T15:57:40.865407Z  INFO execute: │ ┌╴verify_block_derivation_proof    
2024-09-06T15:57:40.865440Z  INFO execute: │ │ ┌╴bmt membership proof    
2024-09-06T15:57:40.870347Z  INFO execute: │ │ └╴64,584 cycles    
2024-09-06T15:57:40.873223Z  INFO execute: │ │ ┌╴construct vid    
2024-09-06T15:57:40.906883Z  INFO execute: │ │ └╴458,828 cycles    
2024-09-06T15:57:40.906918Z  INFO execute: │ │ ┌╴payload_verify    
2024-09-06T15:57:40.918980Z  INFO execute: │ │ │ ┌╴range_byte_to_poly    
2024-09-06T15:57:40.919026Z  INFO execute: │ │ │ └╴422 cycles    
2024-09-06T15:57:40.919062Z  INFO execute: │ │ │ ┌╴rebuild polynomials    
2024-09-06T15:57:40.919098Z  INFO execute: │ │ │ └╴411 cycles    
2024-09-06T15:57:40.919132Z  INFO execute: │ │ │ ┌╴rebuild commits    
2024-09-06T15:57:40.919238Z  INFO execute: │ │ │ │ ┌╴construct polynomial 16    
2024-09-06T15:57:40.966432Z  INFO execute: │ │ │ │ └╴635,248 cycles    
2024-09-06T15:57:40.966529Z  INFO execute: │ │ │ │ ┌╴commit polynomial 16    
2024-09-06T15:57:41.813953Z  INFO execute: │ │ │ │ └╴798,213 cycles    
2024-09-06T15:57:41.814059Z  INFO execute: │ │ │ │ ┌╴check commit 16    
2024-09-06T15:57:41.814189Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:41.814283Z  INFO execute: │ │ │ │ ┌╴construct polynomial 17    
2024-09-06T15:57:41.873698Z  INFO execute: │ │ │ │ └╴765,681 cycles    
2024-09-06T15:57:41.873798Z  INFO execute: │ │ │ │ ┌╴commit polynomial 17    
2024-09-06T15:57:42.721586Z  INFO execute: │ │ │ │ └╴796,971 cycles    
2024-09-06T15:57:42.721696Z  INFO execute: │ │ │ │ ┌╴check commit 17    
2024-09-06T15:57:42.721822Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:42.721914Z  INFO execute: │ │ │ │ ┌╴construct polynomial 18    
2024-09-06T15:57:42.778701Z  INFO execute: │ │ │ │ └╴767,320 cycles    
2024-09-06T15:57:42.778800Z  INFO execute: │ │ │ │ ┌╴commit polynomial 18    
2024-09-06T15:57:43.618742Z  INFO execute: │ │ │ │ └╴797,628 cycles    
2024-09-06T15:57:43.618876Z  INFO execute: │ │ │ │ ┌╴check commit 18    
2024-09-06T15:57:43.619005Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:43.619101Z  INFO execute: │ │ │ │ ┌╴construct polynomial 19    
2024-09-06T15:57:43.676050Z  INFO execute: │ │ │ │ └╴767,275 cycles    
2024-09-06T15:57:43.676151Z  INFO execute: │ │ │ │ ┌╴commit polynomial 19    
2024-09-06T15:57:43.888331Z  INFO execute: clk = 40000000 pc = 0x26e62c    
2024-09-06T15:57:44.519094Z  INFO execute: │ │ │ │ └╴797,808 cycles    
2024-09-06T15:57:44.519216Z  INFO execute: │ │ │ │ ┌╴check commit 19    
2024-09-06T15:57:44.519347Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:44.519443Z  INFO execute: │ │ │ │ ┌╴construct polynomial 20    
2024-09-06T15:57:44.576225Z  INFO execute: │ │ │ │ └╴765,867 cycles    
2024-09-06T15:57:44.576320Z  INFO execute: │ │ │ │ ┌╴commit polynomial 20    
2024-09-06T15:57:45.413980Z  INFO execute: │ │ │ │ └╴796,719 cycles    
2024-09-06T15:57:45.414102Z  INFO execute: │ │ │ │ ┌╴check commit 20    
2024-09-06T15:57:45.414229Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:45.414322Z  INFO execute: │ │ │ │ ┌╴construct polynomial 21    
2024-09-06T15:57:45.471065Z  INFO execute: │ │ │ │ └╴766,838 cycles    
2024-09-06T15:57:45.471168Z  INFO execute: │ │ │ │ ┌╴commit polynomial 21    
2024-09-06T15:57:46.310403Z  INFO execute: │ │ │ │ └╴797,948 cycles    
2024-09-06T15:57:46.310523Z  INFO execute: │ │ │ │ ┌╴check commit 21    
2024-09-06T15:57:46.310652Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:46.310748Z  INFO execute: │ │ │ │ ┌╴construct polynomial 22    
2024-09-06T15:57:46.352709Z  INFO execute: │ │ │ │ └╴561,529 cycles    
2024-09-06T15:57:46.352812Z  INFO execute: │ │ │ │ ┌╴commit polynomial 22    
2024-09-06T15:57:47.198003Z  INFO execute: │ │ │ │ └╴797,948 cycles    
2024-09-06T15:57:47.198118Z  INFO execute: │ │ │ │ ┌╴check commit 22    
2024-09-06T15:57:47.198248Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:47.198282Z  INFO execute: │ │ │ └╴10,648,294 cycles    
2024-09-06T15:57:47.198321Z  INFO execute: │ │ └╴10,807,423 cycles    
2024-09-06T15:57:47.198355Z  INFO execute: │ └╴11,370,516 cycles    
2024-09-06T15:57:47.198392Z  INFO execute: │ ┌╴verify_block_derivation_proof    
2024-09-06T15:57:47.198434Z  INFO execute: │ │ ┌╴bmt membership proof    
2024-09-06T15:57:47.203452Z  INFO execute: │ │ └╴64,584 cycles    
2024-09-06T15:57:47.206313Z  INFO execute: │ │ ┌╴construct vid    
2024-09-06T15:57:47.239918Z  INFO execute: │ │ └╴458,828 cycles    
2024-09-06T15:57:47.239957Z  INFO execute: │ │ ┌╴payload_verify    
2024-09-06T15:57:47.259831Z  INFO execute: │ │ │ ┌╴range_byte_to_poly    
2024-09-06T15:57:47.259874Z  INFO execute: │ │ │ └╴422 cycles    
2024-09-06T15:57:47.259911Z  INFO execute: │ │ │ ┌╴rebuild polynomials    
2024-09-06T15:57:47.259950Z  INFO execute: │ │ │ └╴411 cycles    
2024-09-06T15:57:47.259989Z  INFO execute: │ │ │ ┌╴rebuild commits    
2024-09-06T15:57:47.260101Z  INFO execute: │ │ │ │ ┌╴construct polynomial 57    
2024-09-06T15:57:47.311453Z  INFO execute: │ │ │ │ └╴692,704 cycles    
2024-09-06T15:57:47.311550Z  INFO execute: │ │ │ │ ┌╴commit polynomial 57    
2024-09-06T15:57:48.147061Z  INFO execute: │ │ │ │ └╴796,926 cycles    
2024-09-06T15:57:48.147185Z  INFO execute: │ │ │ │ ┌╴check commit 57    
2024-09-06T15:57:48.147315Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:48.147407Z  INFO execute: │ │ │ │ ┌╴construct polynomial 58    
2024-09-06T15:57:48.204179Z  INFO execute: │ │ │ │ └╴766,273 cycles    
2024-09-06T15:57:48.204276Z  INFO execute: │ │ │ │ ┌╴commit polynomial 58    
2024-09-06T15:57:49.046562Z  INFO execute: │ │ │ │ └╴797,988 cycles    
2024-09-06T15:57:49.046702Z  INFO execute: │ │ │ │ ┌╴check commit 58    
2024-09-06T15:57:49.046832Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:49.046926Z  INFO execute: │ │ │ │ ┌╴construct polynomial 59    
2024-09-06T15:57:49.103777Z  INFO execute: │ │ │ │ └╴766,648 cycles    
2024-09-06T15:57:49.103878Z  INFO execute: │ │ │ │ ┌╴commit polynomial 59    
2024-09-06T15:57:49.352813Z  INFO execute: clk = 50000000 pc = 0x271bbc    
2024-09-06T15:57:49.941396Z  INFO execute: │ │ │ │ └╴797,133 cycles    
2024-09-06T15:57:49.941531Z  INFO execute: │ │ │ │ ┌╴check commit 59    
2024-09-06T15:57:49.941662Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:49.941755Z  INFO execute: │ │ │ │ ┌╴construct polynomial 60    
2024-09-06T15:57:49.998354Z  INFO execute: │ │ │ │ └╴765,797 cycles    
2024-09-06T15:57:49.998450Z  INFO execute: │ │ │ │ ┌╴commit polynomial 60    
2024-09-06T15:57:50.837918Z  INFO execute: │ │ │ │ └╴796,687 cycles    
2024-09-06T15:57:50.838036Z  INFO execute: │ │ │ │ ┌╴check commit 60    
2024-09-06T15:57:50.838166Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:50.838259Z  INFO execute: │ │ │ │ ┌╴construct polynomial 61    
2024-09-06T15:57:50.895158Z  INFO execute: │ │ │ │ └╴767,388 cycles    
2024-09-06T15:57:50.895258Z  INFO execute: │ │ │ │ ┌╴commit polynomial 61    
2024-09-06T15:57:51.739091Z  INFO execute: │ │ │ │ └╴797,842 cycles    
2024-09-06T15:57:51.739227Z  INFO execute: │ │ │ │ ┌╴check commit 61    
2024-09-06T15:57:51.739360Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:51.739456Z  INFO execute: │ │ │ │ ┌╴construct polynomial 62    
2024-09-06T15:57:51.796275Z  INFO execute: │ │ │ │ └╴767,251 cycles    
2024-09-06T15:57:51.796376Z  INFO execute: │ │ │ │ ┌╴commit polynomial 62    
2024-09-06T15:57:52.660261Z  INFO execute: │ │ │ │ └╴798,303 cycles    
2024-09-06T15:57:52.660379Z  INFO execute: │ │ │ │ ┌╴check commit 62    
2024-09-06T15:57:52.660519Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:52.660618Z  INFO execute: │ │ │ │ ┌╴construct polynomial 63    
2024-09-06T15:57:52.717219Z  INFO execute: │ │ │ │ └╴765,720 cycles    
2024-09-06T15:57:52.717318Z  INFO execute: │ │ │ │ ┌╴commit polynomial 63    
2024-09-06T15:57:53.554233Z  INFO execute: │ │ │ │ └╴797,619 cycles    
2024-09-06T15:57:53.554351Z  INFO execute: │ │ │ │ ┌╴check commit 63    
2024-09-06T15:57:53.554480Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:53.554574Z  INFO execute: │ │ │ │ ┌╴construct polynomial 64    
2024-09-06T15:57:53.611269Z  INFO execute: │ │ │ │ └╴765,857 cycles    
2024-09-06T15:57:53.611365Z  INFO execute: │ │ │ │ ┌╴commit polynomial 64    
2024-09-06T15:57:54.454035Z  INFO execute: │ │ │ │ └╴797,421 cycles    
2024-09-06T15:57:54.454158Z  INFO execute: │ │ │ │ ┌╴check commit 64    
2024-09-06T15:57:54.454294Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:54.454387Z  INFO execute: │ │ │ │ ┌╴construct polynomial 65    
2024-09-06T15:57:54.511212Z  INFO execute: │ │ │ │ └╴766,325 cycles    
2024-09-06T15:57:54.511310Z  INFO execute: │ │ │ │ ┌╴commit polynomial 65    
2024-09-06T15:57:55.349046Z  INFO execute: │ │ │ │ └╴797,358 cycles    
2024-09-06T15:57:55.349177Z  INFO execute: │ │ │ │ ┌╴check commit 65    
2024-09-06T15:57:55.349308Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:55.349401Z  INFO execute: │ │ │ │ ┌╴construct polynomial 66    
2024-09-06T15:57:55.350992Z  INFO execute: clk = 60000000 pc = 0x243734    
2024-09-06T15:57:55.406165Z  INFO execute: │ │ │ │ └╴766,221 cycles    
2024-09-06T15:57:55.406263Z  INFO execute: │ │ │ │ ┌╴commit polynomial 66    
2024-09-06T15:57:56.244266Z  INFO execute: │ │ │ │ └╴797,763 cycles    
2024-09-06T15:57:56.244389Z  INFO execute: │ │ │ │ ┌╴check commit 66    
2024-09-06T15:57:56.244519Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:56.244625Z  INFO execute: │ │ │ │ ┌╴construct polynomial 67    
2024-09-06T15:57:56.283894Z  INFO execute: │ │ │ │ └╴530,407 cycles    
2024-09-06T15:57:56.283987Z  INFO execute: │ │ │ │ ┌╴commit polynomial 67    
2024-09-06T15:57:57.139729Z  INFO execute: │ │ │ │ └╴797,070 cycles    
2024-09-06T15:57:57.139856Z  INFO execute: │ │ │ │ ┌╴check commit 67    
2024-09-06T15:57:57.139986Z  INFO execute: │ │ │ │ └╴1,582 cycles    
2024-09-06T15:57:57.140024Z  INFO execute: │ │ │ └╴16,947,866 cycles    
2024-09-06T15:57:57.140064Z  INFO execute: │ │ └╴17,212,969 cycles    
2024-09-06T15:57:57.140097Z  INFO execute: │ └╴17,776,062 cycles    
2024-09-06T15:57:57.140131Z  INFO execute: └╴53,769,572 cycles    
2024-09-06T15:57:57.140163Z  INFO execute: ┌╴vid_param_hash    
2024-09-06T15:57:57.665347Z  INFO execute: clk = 70000000 pc = 0x257950    
2024-09-06T15:57:57.711709Z  INFO execute: └╴7,666,957 cycles    
2024-09-06T15:57:57.916160Z  INFO execute: close time.busy=31.8s time.idle=4.83µs

@akonring
Copy link
Contributor

akonring commented Sep 9, 2024

Nice. Have a couple of thoughts below:

  • So it seems that serialization/deserialization and Radix2EvalDomain are only a small overhead for larger blocks. Here it seems that we batch 5 blocks? Does this overhead amortize over the batch or do we pay for each block?
  • In general it would be interesting to know the complexity for 5x10kb blocks versus 1x50kb block. Does the #cycles solely depend on transaction bytes for the given namespace (regardless of other number of blocks batched and the block sizes)?
  • How did you identify the 40-50% FFT-related cost? Do we have the trace output for the run on the 128GB machine?

@mrain
Copy link
Contributor Author

mrain commented Sep 9, 2024

Nice. Have a couple of thoughts below:

  • So it seems that serialization/deserialization and Radix2EvalDomain are only a small overhead for larger blocks. Here it seems that we batch 5 blocks? Does this overhead amortize over the batch or do we pay for each block?

Right now we are paying for each block.

  • In general it would be interesting to know the complexity for 5x10kb blocks versus 1x50kb block. Does the #cycles solely depend on transaction bytes for the given namespace (regardless of other number of blocks batched and the block sizes)?

#cycles depends on the total size of the given namespace across all blocks. It's irrelevant to the block sizes.

  • How did you identify the 40-50% FFT-related cost? Do we have the trace output for the run on the 128GB machine?

128GB RAM is insufficient for proving 50k bytes. In the above profiling result, the entry construct polynomial takes roughtly half of the cycles under payload_verify, which is mostly FFT. The other half was commit polynomial which is an msm.

@mrain
Copy link
Contributor Author

mrain commented Sep 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants