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

fix: prove bench txs in parallel #6473

Closed
wants to merge 1 commit into from

Conversation

alexghr
Copy link
Contributor

@alexghr alexghr commented May 16, 2024

Builds on top of #6409 and runs all 4 benchmark txs in parallel

Copy link
Contributor Author

alexghr commented May 16, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @alexghr and the rest of your teammates on Graphite Graphite

@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • tx_pxe_processing_time_ms (0): 38,802 (+38%)
  • tx_pxe_processing_time_ms (2): 113,731 (+24%)
  • tx_sequencer_processing_time_ms (0): 969 (+19%)
  • app_circuit_proving_time_in_ms (SchnorrAccount:entrypoint): 71,888 (+54%)
  • app_circuit_proving_time_in_ms (FPC:fee_entrypoint_public): 13,739 (+65%)
  • app_circuit_proving_time_in_ms (Test:emit_nullifier): 5,956 (+111%)
  • app_circuit_proving_time_in_ms (Token:transfer): 59,996 (+36%)
  • app_circuit_proving_time_in_ms (FPC:fee_entrypoint_private): 15,923 (+44%)
  • protocol_circuit_witness_generation_time_in_ms (private-kernel-init): 3,230 (+24%)
  • protocol_circuit_witness_generation_time_in_ms (private-kernel-inner): 4,772 (+27%)
  • protocol_circuit_witness_generation_time_in_ms (private-kernel-reset): 5,337 (+28%)
  • protocol_circuit_witness_generation_time_in_ms (public-kernel-app-logic): 244 (-36%)
  • protocol_circuit_proving_time_in_ms (private-kernel-init): 27,799 (+23%)
  • protocol_circuit_proving_time_in_ms (private-kernel-inner): 50,912 (+34%)
  • protocol_circuit_proving_time_in_ms (private-kernel-reset): 56,248 (+23%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail-to-public): 52,581 (+24%)
  • protocol_circuit_proving_time_in_ms (private-kernel-tail): 51,055 (+28%)
  • protocol_circuit_proving_time_in_ms (merge-rollup): 2,162 (+40%)
Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 740 740 740
l1_rollup_calldata_gas 6,680 6,680 6,692
l1_rollup_execution_gas 586,865 586,865 586,877
l2_block_processing_time_in_ms 1,614 (+1%) 6,059 (+1%) 12,066 (+1%)
l2_block_building_time_in_ms 27,246 107,691 (+1%) 213,939
l2_block_rollup_simulation_time_in_ms 27,063 107,042 (+1%) 212,558
l2_block_public_tx_process_time_in_ms 11,136 (-1%) 44,241 (+1%) 87,918

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 18,234 33,688 (-1%)
node_database_size_in_bytes 22,880,336 39,551,056 (-1%)
pxe_database_size_in_bytes 29,868 59,425

Circuits stats

Stats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.

Circuit protocol_circuit_simulation_time_in_ms protocol_circuit_witness_generation_time_in_ms protocol_circuit_proving_time_in_ms protocol_circuit_input_size_in_bytes protocol_circuit_output_size_in_bytes protocol_circuit_proof_size_in_bytes protocol_circuit_num_public_inputs protocol_circuit_size_in_gates
private-kernel-init 143 ⚠️ 3,230 (+24%) ⚠️ 27,799 (+23%) 19,396 46,118 62,400 1,883 1,048,576
private-kernel-inner 418 (-1%) ⚠️ 4,772 (+27%) ⚠️ 50,912 (+34%) 72,583 46,118 62,400 1,883 2,097,152
private-kernel-reset 680 ⚠️ 5,337 (+28%) ⚠️ 56,248 (+23%) 219,992 46,118 62,400 1,883 2,097,152
private-kernel-tail 444 (-1%) 3,480 (-11%) ⚠️ 51,055 (+28%) 70,968 64,320 10,656 266 2,097,152
base-parity 8.45 (+4%) 107 (+1%) 2,798 (+2%) 128 64.0 2,208 2.00 131,072
root-parity 51.4 (+1%) 173 (+18%) 40,202 27,064 64.0 2,720 18.0 2,097,152
base-rollup 729 (+1%) 4,708 (-10%) 43,315 111,126 925 3,104 30.0 2,097,152
root-rollup 72.6 172 (+1%) 8,353 (+1%) 11,454 789 3,424 40.0 524,288
public-kernel-app-logic 156 (+1%) ⚠️ 244 (-36%) 709 (+1%) 78,387 68,775 90,432 2,759 4,096
public-kernel-tail 538 628 (-2%) 850 184,419 7,723 10,144 250 512
public-kernel-setup 139 (+9%) 364 (+11%) 843 (-8%) 110,522 68,775 90,432 2,759 4,096
public-kernel-teardown 142 (+10%) 366 (+6%) 891 (+5%) 114,417 68,775 90,432 2,759 4,096
merge-rollup 6.82 (+3%) 129 (-29%) ⚠️ 2,162 (+40%) 2,696 925 3,104 30.0 65,536
private-kernel-tail-to-public N/A 11,027 (+13%) ⚠️ 52,581 (+24%) N/A N/A 90,944 2,775 2,097,152

Stats on running time collected for app circuits

Function app_circuit_proof_size_in_bytes app_circuit_proving_time_in_ms app_circuit_size_in_gates app_circuit_num_public_inputs
SchnorrAccount:entrypoint 13,600 ⚠️ 71,888 (+54%) 2,097,152 358
FPC:fee_entrypoint_public 13,600 ⚠️ 13,739 (+65%) 524,288 358
Test:emit_nullifier 13,600 ⚠️ 5,956 (+111%) 65,536 358
Token:transfer 13,600 ⚠️ 59,996 (+36%) 2,097,152 358
FPC:fee_entrypoint_private 13,600 ⚠️ 15,923 (+44%) 524,288 358
Token:unshield 13,600 35,246 (+4%) 2,097,152 358
SchnorrAccount:spend_private_authwit 13,600 2,601 (+4%) 131,072 358

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 16 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 13.1 21.4 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.7 31.8 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.769 (-1%) 0.659 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 61.7 97.8 (+1%) 317 609 1,195 2,363 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.633 0.603 0.577 0.570 0.567 0.565 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 73.5 (+1%) 143 456 893 1,774 3,543 (+1%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 106 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.642 0.645 0.620 0.616 0.615 0.617 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 80.7
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 108
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.710

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 68,448 1,052,029

Transaction size based on fee payment method

| Metric | |
| - | |

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms ⚠️ 38,802 (+38%) 3,081 ⚠️ 113,731 (+24%)
Metric 0 public data writes 1 public data writes 2 public data writes 4 public data writes 8 public data writes
tx_sequencer_processing_time_ms ⚠️ 969 (+19%) 1,117 1,270 (+1%) 2,257 (+13%) 1,354

@alexghr alexghr force-pushed the 05-16-fix_prove_bench_txs_in_parallel branch from 00f8c23 to e81db20 Compare May 17, 2024 08:31
Copy link
Contributor

Changes to circuit sizes

Generated at commit: 82cc3cf06a05781a0600c5ff5d518854eac96944, compared to commit: 1fa59637a0829208d382d1dded36df33f4d61582

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup +132,792 ❌ +152.17% +329,851 ❌ +99.61%
public_kernel_teardown +132,792 ❌ +151.80% +329,851 ❌ +99.52%
public_kernel_app_logic +133,092 ❌ +116.18% +363,656 ❌ +85.42%
public_kernel_tail +378,895 ❌ +58.26% +1,650,753 ❌ +80.18%
private_kernel_reset +84,515 ❌ +51.11% +744,823 ❌ +42.77%
private_kernel_init_simulated 0 ➖ 0.00% +720 ❌ +38.24%
private_kernel_inner_simulated 0 ➖ 0.00% +720 ❌ +38.24%
private_kernel_reset_simulated 0 ➖ 0.00% +720 ❌ +38.24%
private_kernel_tail_to_public_simulated 0 ➖ 0.00% +720 ❌ +25.95%
public_kernel_app_logic_simulated 0 ➖ 0.00% +720 ❌ +25.95%
public_kernel_setup_simulated 0 ➖ 0.00% +720 ❌ +25.95%
public_kernel_teardown_simulated 0 ➖ 0.00% +720 ❌ +25.95%
private_kernel_init +62,040 ❌ +37.97% +147,387 ❌ +21.68%
private_kernel_inner +67,920 ❌ +35.45% +289,939 ❌ +20.70%
private_kernel_tail +2,880 ❌ +1.50% +117,367 ❌ +9.85%
private_kernel_tail_to_public +3,600 ❌ +0.59% +118,809 ❌ +5.94%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup 220,059 (+132,792) +152.17% 661,008 (+329,851) +99.61%
public_kernel_teardown 220,273 (+132,792) +151.80% 661,309 (+329,851) +99.52%
public_kernel_app_logic 247,647 (+133,092) +116.18% 789,364 (+363,656) +85.42%
public_kernel_tail 1,029,192 (+378,895) +58.26% 3,709,601 (+1,650,753) +80.18%
private_kernel_reset 249,885 (+84,515) +51.11% 2,486,261 (+744,823) +42.77%
private_kernel_init_simulated 1 (0) 0.00% 2,603 (+720) +38.24%
private_kernel_inner_simulated 1 (0) 0.00% 2,603 (+720) +38.24%
private_kernel_reset_simulated 1 (0) 0.00% 2,603 (+720) +38.24%
private_kernel_tail_to_public_simulated 1 (0) 0.00% 3,495 (+720) +25.95%
public_kernel_app_logic_simulated 1 (0) 0.00% 3,495 (+720) +25.95%
public_kernel_setup_simulated 1 (0) 0.00% 3,495 (+720) +25.95%
public_kernel_teardown_simulated 1 (0) 0.00% 3,495 (+720) +25.95%
private_kernel_init 225,424 (+62,040) +37.97% 827,164 (+147,387) +21.68%
private_kernel_inner 259,525 (+67,920) +35.45% 1,690,457 (+289,939) +20.70%
private_kernel_tail 194,412 (+2,880) +1.50% 1,309,261 (+117,367) +9.85%
private_kernel_tail_to_public 611,589 (+3,600) +0.59% 2,119,608 (+118,809) +5.94%

@alexghr alexghr closed this May 30, 2024
@alexghr alexghr deleted the 05-16-fix_prove_bench_txs_in_parallel branch May 30, 2024 08:43
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

Successfully merging this pull request may close these issues.

2 participants