TritonVM / tasm-lib

A collection of functions written in Triton VM assembly (tasm)
Apache License 2.0
11 stars 2 forks source link

Upgrade to tvm 0.42 alpha-4 #102

Closed Sword-Smith closed 3 months ago

Sword-Smith commented 3 months ago

Upgrade to TVM0.42-alpha4 and use its new instruction sponge_absorb_mem to save 31 % of the op-stack table rows in the reference run of the STARK verifier for inner padded height $2^{20}$, expansion factor 4. This makes the processor table (clock_cycle_count below) the new bottle neck[^0].

The one failing test is due to an upstream problem in Triton VM which is fixed in this Triton VM PR.

Before

  {
    "name": "tasmlib_verifier_stark_verify_inner_padded_height_1048576_fri_exp_4",
    "benchmark_result": {
      "clock_cycle_count": 726770,
      "hash_table_height": 315127,
      "u32_table_height": 125614,
      "op_stack_table_height": 774360,
      "ram_table_height": 523168
    },
  }

After

  {
    "name": "tasmlib_verifier_stark_verify_inner_padded_height_1048576_fri_exp_4",
    "benchmark_result": {
      "clock_cycle_count": 668441,
      "hash_table_height": 315091,
      "u32_table_height": 125217,
      "op_stack_table_height": 533444,
      "ram_table_height": 525858
    },
  }

[^0]: Adding the next instruction in our wishlist recurse_or_return should allow us to reduce clock cycle count by another 20 % which would bring it very close to the RAM table height.