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: Move timers for ClientIVC breakdown #5145

Merged

Conversation

codygunton
Copy link
Contributor

@codygunton codygunton commented Mar 12, 2024

#4841 improved the witness construction in the client IVC benchmarks to make use of straightforward parallelism. This PR updates the manual % breakdown script to reflect the new structure. It also fixes benchmark.sh so that it can be used inside of benchmark_client_ivc.sh in the case where the benchmarking instance is unavailable.

Result:

--------------------------------------------------------------------------------
Benchmark                      Time             CPU   Iterations UserCounters...
--------------------------------------------------------------------------------
ClientIVCBench/Full/6      29212 ms        24574 ms            1 Decider::construct_proof=1 Decider::construct_proof(t)=755.662M ECCVMComposer::create_prover=1 ECCVMComposer::create_prover(t)=3.41214G ECCVMProver::construct_proof=1 ECCVMProver::construct_proof(t)=1.77115G Goblin::merge=11 Goblin::merge(t)=128.511M GoblinTranslatorCircuitBuilder::constructor=1 GoblinTranslatorCircuitBuilder::constructor(t)=56.2447M GoblinTranslatorComposer::create_prover=1 GoblinTranslatorComposer::create_prover(t)=121.099M GoblinTranslatorProver::construct_proof=1 GoblinTranslatorProver::construct_proof(t)=920.195M ProtogalaxyProver::fold_instances=10 ProtogalaxyProver::fold_instances(t)=15.8816G ProverInstance(Circuit&)=11 ProverInstance(Circuit&)(t)=1.94818G batch_mul_with_endomorphism=30 batch_mul_with_endomorphism(t)=564.471M commit=425 commit(t)=3.96399G compute_combiner=10 compute_combiner(t)=7.19205G compute_perturbator=9 compute_perturbator(t)=1.3842G construct_circuits=6 construct_circuits(t)=4.19883G
Benchmarking lock deleted.
client_ivc_bench.json                                                         100% 2904    89.0KB/s   00:00    
function                                        ms     % sum
construct_circuits(t)                         4199    14.41%
ProverInstance(Circuit&)(t)                   1948     6.69%
ProtogalaxyProver::fold_instances(t)         15882    54.51%
Decider::construct_proof(t)                    756     2.59%
ECCVMComposer::create_prover(t)               3412    11.71%
GoblinTranslatorComposer::create_prover(t)     121     0.42%
ECCVMProver::construct_proof(t)               1771     6.08%
GoblinTranslatorProver::construct_proof(t)     920     3.16%
Goblin::merge(t)                               129     0.44%

Total time accounted for: 29137ms/29212ms = 99.74%

@codygunton codygunton self-assigned this Mar 12, 2024
@codygunton codygunton changed the title Move timers and improve benchmark.sh fix: Move timers for ClientIVC breakdown Mar 12, 2024
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 12, 2024

Benchmark results

Metrics with a significant change:

  • note_successful_decrypting_time_in_ms (32): 583 (+22%)
  • note_trial_decrypting_time_in_ms (8): 93.8 (+248%)
  • note_trial_decrypting_time_in_ms (64): 68.9 (+96%)
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.

Values are compared against data from master at commit 7f216eb0 and shown if the difference exceeds 1%.

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 5,668 18,820 36,356
l1_rollup_calldata_gas 66,040 238,684 468,824
l1_rollup_execution_gas 666,520 953,393 1,335,980
l2_block_processing_time_in_ms 1,321 4,793 (+1%) 8,982 (-5%)
note_successful_decrypting_time_in_ms 193 (-14%) ⚠️ 583 (+22%) 939 (-7%)
note_trial_decrypting_time_in_ms ⚠️ 93.8 (+248%) 100 (+3%) ⚠️ 68.9 (+96%)
l2_block_building_time_in_ms 12,338 48,890 (+1%) 97,361
l2_block_rollup_simulation_time_in_ms 7,339 29,239 (+1%) 58,054
l2_block_public_tx_process_time_in_ms 4,967 19,586 (+1%) 39,196 (+1%)

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 14,226 26,250 (-6%)
note_history_successful_decrypting_time_in_ms 1,293 (+1%) 2,435 (-1%)
note_history_trial_decrypting_time_in_ms 92.6 (-19%) 154 (-19%)
node_database_size_in_bytes 18,677,840 35,573,840 (+1%)
pxe_database_size_in_bytes 29,859 59,414

Circuits stats

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

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 272 44,338 27,700
private-kernel-ordering 206 52,324 14,326
base-rollup 666 (+1%) 177,083 925
root-rollup 68.1 4,176 789
private-kernel-inner 359 73,197 27,700
public-kernel-app-logic 179 34,582 27,671
public-kernel-tail 91.5 34,206 27,671
merge-rollup 8.22 (-1%) 2,696 925

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 9.99 (+1%) 16.0 (-1%) 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.8 31.6 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.583 0.494 (-1%) 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 46.8 (+2%) 72.6 (-1%) 231 (+1%) 445 862 (-1%) 1,726 (-1%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 96.0 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.481 (+2%) 0.448 (-1%) 0.421 0.417 (-1%) 0.411 (-1%) 0.414 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 53.7 107 (+1%) 337 (+1%) 658 1,305 2,603 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 104 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.478 0.482 0.458 (+1%) 0.453 0.453 0.454 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 60.8
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 109
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.533

Miscellaneous

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

Metric 0 registered classes
tx_size_in_bytes 19,191

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 2,788 (-2%) 1,432
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 8.94 (+17%) 611

@codygunton codygunton force-pushed the cg/fix/client-ivc-breakdown-parallel-witness-construction branch from f9d5189 to 03140fd Compare March 12, 2024 03:12
Copy link
Contributor

@Rumata888 Rumata888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codygunton codygunton merged commit 5457edb into master Mar 12, 2024
97 checks passed
@codygunton codygunton deleted the cg/fix/client-ivc-breakdown-parallel-witness-construction branch March 12, 2024 14:36
TomAFrench added a commit that referenced this pull request Mar 12, 2024
* master:
  feat: Nullifier non membership (#5152)
  refactor: share code between provers (#4655)
  fix: Increase the json limit for RPC requests (#5161)
  fix: Move timers for ClientIVC breakdown (#5145)
  chore(master): Release 0.27.0 (#5100)
critesjosh pushed a commit that referenced this pull request Mar 12, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.27.1</summary>

##
[0.27.1](aztec-package-v0.27.0...aztec-package-v0.27.1)
(2024-03-12)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.27.1</summary>

##
[0.27.1](barretenberg.js-v0.27.0...barretenberg.js-v0.27.1)
(2024-03-12)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-cli: 0.27.1</summary>

##
[0.27.1](aztec-cli-v0.27.0...aztec-cli-v0.27.1)
(2024-03-12)


### Miscellaneous

* **aztec-cli:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-packages: 0.27.1</summary>

##
[0.27.1](aztec-packages-v0.27.0...aztec-packages-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](#5146))
([c8e1cb8](c8e1cb8))
* Nullifier non membership
([#5152](#5152))
([426bd6d](426bd6d))


### Bug Fixes

* Increase the json limit for RPC requests
([#5161](#5161))
([419958c](419958c))
* Move timers for ClientIVC breakdown
([#5145](#5145))
([5457edb](5457edb))


### Miscellaneous

* **boxes:** Adding clone contract option
([#4980](#4980))
([a427aa5](a427aa5))
* Share code between provers
([#4655](#4655))
([ef10d65](ef10d65))
</details>

<details><summary>barretenberg: 0.27.1</summary>

##
[0.27.1](barretenberg-v0.27.0...barretenberg-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](#5146))
([c8e1cb8](c8e1cb8))


### Bug Fixes

* Move timers for ClientIVC breakdown
([#5145](#5145))
([5457edb](5457edb))


### Miscellaneous

* Share code between provers
([#4655](#4655))
([ef10d65](ef10d65))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request Mar 13, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.27.1</summary>

##
[0.27.1](AztecProtocol/aztec-packages@aztec-package-v0.27.0...aztec-package-v0.27.1)
(2024-03-12)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.27.1</summary>

##
[0.27.1](AztecProtocol/aztec-packages@barretenberg.js-v0.27.0...barretenberg.js-v0.27.1)
(2024-03-12)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-cli: 0.27.1</summary>

##
[0.27.1](AztecProtocol/aztec-packages@aztec-cli-v0.27.0...aztec-cli-v0.27.1)
(2024-03-12)


### Miscellaneous

* **aztec-cli:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-packages: 0.27.1</summary>

##
[0.27.1](AztecProtocol/aztec-packages@aztec-packages-v0.27.0...aztec-packages-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](AztecProtocol/aztec-packages#5146))
([c8e1cb8](AztecProtocol/aztec-packages@c8e1cb8))
* Nullifier non membership
([#5152](AztecProtocol/aztec-packages#5152))
([426bd6d](AztecProtocol/aztec-packages@426bd6d))


### Bug Fixes

* Increase the json limit for RPC requests
([#5161](AztecProtocol/aztec-packages#5161))
([419958c](AztecProtocol/aztec-packages@419958c))
* Move timers for ClientIVC breakdown
([#5145](AztecProtocol/aztec-packages#5145))
([5457edb](AztecProtocol/aztec-packages@5457edb))


### Miscellaneous

* **boxes:** Adding clone contract option
([#4980](AztecProtocol/aztec-packages#4980))
([a427aa5](AztecProtocol/aztec-packages@a427aa5))
* Share code between provers
([#4655](AztecProtocol/aztec-packages#4655))
([ef10d65](AztecProtocol/aztec-packages@ef10d65))
</details>

<details><summary>barretenberg: 0.27.1</summary>

##
[0.27.1](AztecProtocol/aztec-packages@barretenberg-v0.27.0...barretenberg-v0.27.1)
(2024-03-12)


### Features

* Further ClientIVC breakdown
([#5146](AztecProtocol/aztec-packages#5146))
([c8e1cb8](AztecProtocol/aztec-packages@c8e1cb8))


### Bug Fixes

* Move timers for ClientIVC breakdown
([#5145](AztecProtocol/aztec-packages#5145))
([5457edb](AztecProtocol/aztec-packages@5457edb))


### Miscellaneous

* Share code between provers
([#4655](AztecProtocol/aztec-packages#4655))
([ef10d65](AztecProtocol/aztec-packages@ef10d65))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

None yet

3 participants