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

feat(avm): Internal call stack dedicated memory #6503

Merged
merged 4 commits into from
May 22, 2024

Conversation

jeanmon
Copy link
Contributor

@jeanmon jeanmon commented May 17, 2024

Resolves #6245

@jeanmon jeanmon force-pushed the jm/6245-internal-stack-dedicated-mem branch from a466b03 to ffb5cf2 Compare May 17, 2024 14:15
@jeanmon jeanmon changed the title Internal call stack dedicated memory feat(avm): Internal call stack dedicated memory May 17, 2024
@jeanmon jeanmon marked this pull request as ready for review May 17, 2024 14:21
@AztecBot
Copy link
Collaborator

AztecBot commented May 17, 2024

Benchmark results

No base data found for comparison.

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.

Proof generation

Each column represents the number of threads used in proof generation.

Metric 1 threads 4 threads 16 threads 32 threads 64 threads
proof_construction_time_sha256 5,706 1,555 713 751 772

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 772 772 772
l1_rollup_calldata_gas 6,868 6,880 6,880
l1_rollup_execution_gas 587,408 587,420 587,420
l2_block_processing_time_in_ms 1,358 5,104 10,115
l2_block_building_time_in_ms 32,434 128,166 256,122
l2_block_rollup_simulation_time_in_ms 32,253 127,516 254,839
l2_block_public_tx_process_time_in_ms 16,906 70,215 143,803

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 16,074 28,487
node_database_size_in_bytes 21,168,208 37,875,792
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 164 3,668 22,445 19,985 61,999 86,720 2,643 1,048,576
private-kernel-inner 636 5,199 40,323 89,053 61,999 86,720 2,643 2,097,152
private-kernel-reset-small 624 2,424 23,328 117,961 61,999 86,720 2,643 1,048,576
private-kernel-tail 568 2,886 39,823 86,849 79,454 10,688 267 2,097,152
base-parity 6.85 1,038 3,374 128 64.0 2,208 2.00 131,072
root-parity 51.3 61.4 41,322 27,064 64.0 2,720 18.0 2,097,152
base-rollup 810 2,681 43,302 111,158 957 3,136 31.0 2,097,152
root-rollup 98.9 48.6 8,299 11,518 821 3,456 41.0 524,288
public-kernel-app-logic 257 143 719 96,978 85,095 116,448 3,572 4,096
public-kernel-tail 897 625 1,131 388,207 7,755 10,176 251 512
public-kernel-setup 218 159 838 138,309 85,095 116,448 3,572 4,096
public-kernel-teardown 228 195 931 143,320 85,095 116,448 3,572 4,096
merge-rollup 7.13 18.4 1,632 2,760 957 3,136 31.0 65,536
private-kernel-tail-to-public N/A 10,150 72,254 N/A N/A 116,960 3,588 4,194,304

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 16,128 47,881 2,097,152 437
Test:emit_nullifier 16,128 2,429 65,536 437
FPC:fee_entrypoint_public 16,128 8,361 524,288 437
FPC:fee_entrypoint_private 16,128 8,896 524,288 437
Token:unshield 16,128 49,802 2,097,152 437
SchnorrAccount:spend_private_authwit 16,128 2,658 131,072 437
Token:transfer 16,128 34,876 2,097,152 437

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 11.7 19.0 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.679 0.584 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 54.3 83.9 261 508 991 1,962 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.555 0.518 0.474 0.475 0.469 0.468 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 65.6 124 380 741 1,483 2,939 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.570 0.556 0.515 0.510 0.513 0.511 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 69.4
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.609

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 84,741 673,219

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 29,482 4,525 100,235
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 1,373 2,319 1,987 3,142 1,979

@jeanmon jeanmon force-pushed the jm/6245-internal-stack-dedicated-mem branch 4 times, most recently from 6bb86be to eddf18d Compare May 21, 2024 16:01
@jeanmon jeanmon force-pushed the jm/6245-internal-stack-dedicated-mem branch from eddf18d to ec88c9f Compare May 22, 2024 07:07
@IlyasRidhuan IlyasRidhuan merged commit d3c3d4a into master May 22, 2024
73 checks passed
@IlyasRidhuan IlyasRidhuan deleted the jm/6245-internal-stack-dedicated-mem branch May 22, 2024 10:32
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.

AVM circuit: internal call stack dedicated memory space
3 participants