Skip to content

Commit

Permalink
Rewrite barycentric to use more RAM rows, fewer processor rows
Browse files Browse the repository at this point in the history
Rewrite the snippet for barycentric evaluation to use fewer processor
and opstack rows, and more RAM rows. The goal with this rewrite is to
make higher expansion factors more feasible, as the very high row count
for this snippet made expansion factors above 8 meaningless. With this
rewrite, expansion factors above 8 can be considered.

This rewrite is not completely without controversy, as it increases the
RAM table row-count somewhat. For expansion factor 4, RAM table row
count is increases by 4'600 and twice that for expansion factor 16. The
savings to the processor table are 7'000 and 20'000, respectively.

If these changes are not beneficial, this commit can be reverted.

This completes 2nd and 3rd optimizations in #106.
  • Loading branch information
Sword-Smith committed Jun 11, 2024
1 parent 5080fc5 commit cd71bd2
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
{
"name": "tasmlib_verifier_fri_barycentric_evaluation",
"benchmark_result": {
"clock_cycle_count": 10541,
"hash_table_height": 990,
"u32_table_height": 44,
"op_stack_table_height": 8457,
"ram_table_height": 769
"clock_cycle_count": 6879,
"hash_table_height": 282,
"u32_table_height": 50,
"op_stack_table_height": 6351,
"ram_table_height": 3073
},
"case": "CommonCase"
},
{
"name": "tasmlib_verifier_fri_barycentric_evaluation",
"benchmark_result": {
"clock_cycle_count": 20861,
"hash_table_height": 990,
"u32_table_height": 44,
"op_stack_table_height": 16713,
"ram_table_height": 1537
"clock_cycle_count": 13535,
"hash_table_height": 282,
"u32_table_height": 49,
"op_stack_table_height": 12495,
"ram_table_height": 6145
},
"case": "WorstCase"
}
Expand Down
20 changes: 10 additions & 10 deletions tasm-lib/benchmarks/tasmlib_verifier_fri_verify.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
{
"name": "tasmlib_verifier_fri_verify",
"benchmark_result": {
"clock_cycle_count": 59521,
"hash_table_height": 14670,
"u32_table_height": 11431,
"op_stack_table_height": 56001,
"ram_table_height": 12924
"clock_cycle_count": 49813,
"hash_table_height": 14658,
"u32_table_height": 11448,
"op_stack_table_height": 49875,
"ram_table_height": 17532
},
"case": "CommonCase"
},
{
"name": "tasmlib_verifier_fri_verify",
"benchmark_result": {
"clock_cycle_count": 59521,
"hash_table_height": 14670,
"u32_table_height": 11043,
"op_stack_table_height": 56001,
"ram_table_height": 12924
"clock_cycle_count": 49813,
"hash_table_height": 14658,
"u32_table_height": 11060,
"op_stack_table_height": 49875,
"ram_table_height": 17532
},
"case": "WorstCase"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"name": "tasmlib_verifier_stark_verify_inner_padded_height_256_fri_exp_4",
"benchmark_result": {
"clock_cycle_count": 194458,
"hash_table_height": 125257,
"u32_table_height": 14899,
"op_stack_table_height": 178738,
"ram_table_height": 269988
"clock_cycle_count": 184750,
"hash_table_height": 125245,
"u32_table_height": 15011,
"op_stack_table_height": 172612,
"ram_table_height": 274596
},
"case": "CommonCase"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"name": "tasmlib_verifier_stark_verify_inner_padded_height_512_fri_exp_4",
"benchmark_result": {
"clock_cycle_count": 203205,
"hash_table_height": 132949,
"u32_table_height": 18575,
"op_stack_table_height": 184862,
"ram_table_height": 271166
"clock_cycle_count": 193497,
"hash_table_height": 132937,
"u32_table_height": 18254,
"op_stack_table_height": 178736,
"ram_table_height": 275774
},
"case": "CommonCase"
}
Expand Down
Loading

0 comments on commit cd71bd2

Please sign in to comment.