This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement self-adjustable caching (#27)
# What ❔ This PR implements caching logic with self-adjustable caching configurations for setup/trace/arguments polynomials. ## Why ❔ Adjustable ratios between caching and re-computation of various polynomial groups allow for variable tradeoff between memory usage and performance. This PR implements a cost model and a logic for determining the optimal caching strategy for the amount of memory that is available. The result is that when the amount of available GPU memory is ~21 GB or more, full performance can be extracted and on the other end of the spectrum the prover can run with less than 6 GB of GPU RAM although with significantly lower performance that the full performance. Here are results of a benchmarks done on a L4 GPU for the MainVM base layer circuit to show the tradeoff of performance vs memory usage. Keep in mind that the values for memory usage are numbers of memory reserved for various data structures used by the prover, there are additional memory requirements coming from the OS, GPU driver or other processes, these can differ significantly based on a particular GPU model and the OS. For example for a L4 running under linux, the observed additional allocated memory amounted to ~0,75 GB. | VRAM used (GB)|First run (s)|Subsequent runs (s)| |-:|-:|-:| |20.0|1.976|1.304| |19.5|1.999|1.339| |19.0|2.038|1.380| |18.5|2.133|1.467| |14.5|2.012|1.534| |13.5|2.060|1.570| |13.0|2.099|1.614| |12.5|2.116|1.653| |12.0|2.151|1.667| |11.5|2.185|1.701| |11.0|2.221|1.747| |10.5|2.278|1.800| |10.0|2.310|1.827| |9.5|2.363|1.883| |9.0|2.442|1.964| |8.5|2.492|2.017| |8.0|2.580|2.104| |7.5|2.721|2.243| |7.0|2.990|2.485| |6.5|3.022|2.523| |6.0|3.400|2.892| |5.5|3.480|2.980| ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `cargo fmt` and linted with `cargo check`.
- Loading branch information
Showing
32 changed files
with
2,795 additions
and
2,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.