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

More efficient Matrix data structure #45

Open
wants to merge 6 commits into
base: brakedown
Choose a base branch
from
Open

More efficient Matrix data structure #45

wants to merge 6 commits into from

Conversation

autquis
Copy link
Collaborator

@autquis autquis commented Nov 14, 2023

So we should avoid cloning and rearranging as much as we can. This PR is trying to solve that!


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@@ -553,7 +553,7 @@ where
H::Output: Into<C::Leaf>,
C::Leaf: Default + Clone + Send,
{
let ext_mat_cols = ext_mat.cols();
let ext_mat_cols = ext_mat.cols().clone();

Choose a reason for hiding this comment

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

So we should avoid cloning and rearranging as much as we can. This PR is trying to solve that!

Huh?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one is inevitable, unfortunately. H::evaluate consumes the vector as far as I understood. Notice that we were cloning it previously too, but it was not explicit here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In fact, if we mange to derive Copy for Vec<F> we can avoid cloning here too, I guess

Choose a reason for hiding this comment

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

@autquis I figured out that you can actually just call .borrow() and it works like a charm. See e20f67e

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mmagician Nice!
Also, let me know if I can still help with this PR!

@autquis
Copy link
Collaborator Author

autquis commented Jan 22, 2024

This might be helpful now!

@mmagician mmagician requested a review from DimitrisPapac March 12, 2024 10:51
@mmagician
Copy link

@DimitrisPapac could you review this PR please? Maybe we can find a way to keep the cake and eat it too.
The problem with this change is that we'd be keeping around the entire matrix twice.
(actually, we're also keeping the extended matrix, which is even bigger, but I don't think we can avoid it due to the commitment_state that's passed around).

@DimitrisPapac
Copy link

DimitrisPapac commented Mar 12, 2024 via email

@DimitrisPapac
Copy link

DimitrisPapac commented Mar 24, 2024

The results below are for 12-20 variables and using 10 samples per case. There seems to be a speedup for commit, open and verify by making the change to two matrices (i.e., one for row-major and one for column-major) but at the cost of storing entries twice. In particular, commit seems to be benefiting the most from this change. open seems to yield very minor differences. verify also seems to be improving by a few milliseconds. I am not sure if an alternative representation like CSR would be much help here since columns would have to be reconstructed before being hashed.

row-mul branch:

commit Brakedown<Fr>/12 time:   [3.1485 ms 3.3624 ms 3.4641 ms]
                        change: [+2.6137% +9.8502% +17.152%] (p = 0.00 < 0.10)
                        Performance has regressed.
commit Brakedown<Fr>/14 time:   [7.1937 ms 7.2126 ms 7.2246 ms]
                        change: [+2.8675% +4.5740% +6.4440%] (p = 0.07 < 0.10)
                        Performance has regressed.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) low mild
commit Brakedown<Fr>/16 time:   [12.319 ms 12.616 ms 12.872 ms]
                        change: [-3.9617% -1.6284% +1.0512%] (p = 0.42 > 0.10)
                        No change in performance detected.
commit Brakedown<Fr>/18 time:   [33.788 ms 33.906 ms 34.116 ms]
                        change: [+3.8341% +4.9034% +5.7881%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) low mild
commit Brakedown<Fr>/20 time:   [94.436 ms 95.083 ms 95.598 ms]
                        change: [-0.2659% +1.8619% +3.7812%] (p = 0.09 < 0.10)
                        Change within noise threshold.

open Brakedown<Fr>/12   time:   [165.54 ms 166.57 ms 167.40 ms]
                        change: [-0.6614% +0.2327% +1.2977%] (p = 0.68 > 0.10)
                        No change in performance detected.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) high mild
open Brakedown<Fr>/14   time:   [293.43 ms 296.74 ms 300.13 ms]
                        change: [-0.1426% +1.0274% +2.2508%] (p = 0.18 > 0.10)
                        No change in performance detected.
open Brakedown<Fr>/16   time:   [472.66 ms 475.77 ms 479.31 ms]
                        change: [+1.9692% +2.7562% +3.6098%] (p = 0.00 < 0.10)
                        Performance has regressed.
open Brakedown<Fr>/18   time:   [769.26 ms 774.57 ms 780.25 ms]
                        change: [+0.2220% +0.9613% +1.7809%] (p = 0.08 < 0.10)
                        Change within noise threshold.
open Brakedown<Fr>/20   time:   [1.4276 s 1.4363 s 1.4462 s]
                        change: [+0.6962% +1.3720% +2.1119%] (p = 0.00 < 0.10)
                        Change within noise threshold.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) high mild

verify Brakedown<Fr>/12 time:   [191.60 ms 192.55 ms 193.51 ms]
                        change: [+0.5137% +1.0989% +1.7208%] (p = 0.01 < 0.10)
                        Change within noise threshold.
verify Brakedown<Fr>/14 time:   [313.15 ms 315.43 ms 317.57 ms]
                        change: [+0.5622% +1.3997% +2.2166%] (p = 0.02 < 0.10)
                        Change within noise threshold.
verify Brakedown<Fr>/16 time:   [383.99 ms 387.56 ms 390.89 ms]
                        change: [+0.2945% +1.2962% +2.2385%] (p = 0.05 < 0.10)
                        Change within noise threshold.
verify Brakedown<Fr>/18 time:   [507.66 ms 512.34 ms 516.86 ms]
                        change: [-0.3138% +0.7377% +1.7373%] (p = 0.20 > 0.10)
                        No change in performance detected.
verify Brakedown<Fr>/20 time:   [782.04 ms 788.16 ms 794.11 ms]
                        change: [-0.5467% +0.2093% +1.0219%] (p = 0.65 > 0.10)
                        No change in performance detected.

brakedown branch:

commit Brakedown<Fr>/12 time:   [3.6407 ms 3.7222 ms 3.8659 ms]
                        change: [+12.872% +21.196% +30.579%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 2 outliers among 10 measurements (20.00%)
  1 (10.00%) high mild
  1 (10.00%) high severe
commit Brakedown<Fr>/14 time:   [8.5522 ms 8.6043 ms 8.6981 ms]
                        change: [+18.773% +21.004% +23.881%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) high mild
commit Brakedown<Fr>/16 time:   [19.895 ms 20.040 ms 20.255 ms]
                        change: [+53.760% +57.455% +60.978%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) high mild
commit Brakedown<Fr>/18 time:   [47.796 ms 48.069 ms 48.320 ms]
                        change: [+40.208% +41.568% +43.098%] (p = 0.00 < 0.10)
                        Performance has regressed.
commit Brakedown<Fr>/20 time:   [113.38 ms 118.35 ms 127.51 ms]
                        change: [+22.288% +29.309% +36.443%] (p = 0.00 < 0.10)
                        Performance has regressed.

open Brakedown<Fr>/12   time:   [168.05 ms 168.65 ms 169.47 ms]
                        change: [-0.1920% +1.0577% +2.1653%] (p = 0.11 > 0.10)
                        No change in performance detected.
Found 2 outliers among 10 measurements (20.00%)
  1 (10.00%) low severe
  1 (10.00%) high mild
open Brakedown<Fr>/14   time:   [290.42 ms 294.19 ms 298.15 ms]
                        change: [-2.5026% -0.8592% +0.8622%] (p = 0.37 > 0.10)
                        No change in performance detected.
open Brakedown<Fr>/16   time:   [463.50 ms 466.77 ms 469.96 ms]
                        change: [-2.8709% -1.8919% -1.0104%] (p = 0.00 < 0.10)
                        Performance has improved.
open Brakedown<Fr>/18   time:   [787.45 ms 792.13 ms 797.02 ms]
                        change: [+1.3114% +2.2664% +3.1955%] (p = 0.00 < 0.10)
                        Performance has regressed.
open Brakedown<Fr>/20   time:   [1.4806 s 1.4922 s 1.5050 s]
                        change: [+2.7567% +3.8969% +5.0199%] (p = 0.00 < 0.10)
                        Performance has regressed.

verify Brakedown<Fr>/12 time:   [189.26 ms 190.77 ms 192.14 ms]
                        change: [-1.8005% -0.9246% -0.0534%] (p = 0.07 < 0.10)
                        Change within noise threshold.
verify Brakedown<Fr>/14 time:   [305.32 ms 307.47 ms 309.49 ms]
                        change: [-3.4744% -2.5255% -1.5611%] (p = 0.00 < 0.10)
                        Performance has improved.
verify Brakedown<Fr>/16 time:   [375.03 ms 379.42 ms 383.02 ms]
                        change: [-3.5215% -2.0994% -0.8101%] (p = 0.01 < 0.10)
                        Change within noise threshold.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) low severe
verify Brakedown<Fr>/18 time:   [507.53 ms 513.37 ms 519.23 ms]
                        change: [-1.2997% +0.2016% +1.6634%] (p = 0.80 > 0.10)
                        No change in performance detected.
verify Brakedown<Fr>/20 time:   [790.04 ms 796.20 ms 802.07 ms]
                        change: [-0.0419% +1.0201% +2.1735%] (p = 0.10 < 0.10)
                        Change within noise threshold.

@mmagician
Copy link

Looks like a good first step in optimizing the PCS.
I believe this can be pushed even further: specifically, when we compute_matrices (here), we only ever use rows from mat and cols from ext_mat, both in the commit method where these are generated, but also later in open, when we get the CommitmentState passed in.
That means we might benefit from only keeping the relevant column- or row-wise representation for mat/ext_mat. @DimitrisPapac Could you confirm this is the case, and if so, try to introduce said optimization?

Btw, verify is not affected by these changes, since the verifier never gets to construct the matrices in full. We can safely skip benchmarking these in the future to save time. (@DimitrisPapac you can pass strings like cargo bench commit to only bench the matching functions)

@mmagician
Copy link

Also @autquis please confirm whether I'm making sense^ if you can

@DimitrisPapac
Copy link

Here are the outputs that I got after benchmarking the row-mul branch after splitting struct Matrix into two separate structs: RowMajorMatrix and ColumnMajorMatrix and after making due changes throughout the codebase and pushing to the poly-commit repo. I am also including the outputs for the brakedown branch. As instructed, I only benchmarked commit and open but not verify. All experiments use 10 samples. Based on the results, commit seems to benefit from this change.

row-mul commit:

commit Brakedown<Fr>/12 time:   [2.9991 ms 3.1887 ms 3.4172 ms]
                        change: [-17.147% -13.177% -9.5740%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 3 outliers among 10 measurements (30.00%)
  2 (20.00%) low severe
  1 (10.00%) high mild
commit Brakedown<Fr>/14 time:   [5.9264 ms 5.9379 ms 5.9547 ms]
                        change: [-32.970% -30.716% -27.937%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 2 outliers among 10 measurements (20.00%)
  2 (20.00%) high severe
commit Brakedown<Fr>/16 time:   [12.753 ms 13.162 ms 13.688 ms]
                        change: [-35.591% -33.285% -30.404%] (p = 0.00 < 0.10)
                        Performance has improved.
commit Brakedown<Fr>/18 time:   [32.452 ms 32.830 ms 33.034 ms]
                        change: [-32.443% -31.922% -31.405%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) low mild
commit Brakedown<Fr>/20 time:   [89.530 ms 89.738 ms 89.929 ms]
                        change: [-29.967% -25.867% -21.822%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 2 outliers among 10 measurements (20.00%)
  1 (10.00%) low mild
  1 (10.00%) high severe

row-mul open:

open Brakedown<Fr>/12   time:   [165.99 ms 166.85 ms 167.32 ms]
                        change: [-1.9980% -1.1723% -0.2629%] (p = 0.03 < 0.10)
                        Change within noise threshold.
open Brakedown<Fr>/14   time:   [294.12 ms 296.44 ms 298.76 ms]
                        change: [-0.7943% +0.7645% +2.3045%] (p = 0.37 > 0.10)
                        No change in performance detected.
open Brakedown<Fr>/16   time:   [463.41 ms 466.44 ms 469.66 ms]
                        change: [-1.0385% -0.0703% +0.8569%] (p = 0.89 > 0.10)
                        No change in performance detected.
open Brakedown<Fr>/18   time:   [782.23 ms 787.62 ms 792.76 ms]
                        change: [-1.4407% -0.5687% +0.3183%] (p = 0.26 > 0.10)
                        No change in performance detected.
open Brakedown<Fr>/20   time:   [1.4540 s 1.4603 s 1.4668 s]a
                        change: [-3.0715% -2.1411% -1.2755%] (p = 0.00 < 0.10)
                        Performance has improved.

brakedown commit:

commit Brakedown<Fr>/12 time:   [3.4152 ms 3.5304 ms 3.6509 ms]
                        change: [-3.4275% -0.5612% +1.7201%] (p = 0.66 > 0.10)
                        No change in performance detected.
commit Brakedown<Fr>/14 time:   [8.4320 ms 8.4950 ms 8.5819 ms]
                        change: [-3.2808% -2.2639% -1.2941%] (p = 0.04 < 0.10)
                        Performance has improved.
commit Brakedown<Fr>/16 time:   [19.862 ms 20.086 ms 20.459 ms]
                        change: [+3.5515% +4.9517% +6.3512%] (p = 0.00 < 0.10)
                        Performance has regressed.
commit Brakedown<Fr>/18 time:   [48.522 ms 49.446 ms 50.247 ms]
                        change: [+6.8161% +8.8914% +10.878%] (p = 0.00 < 0.10)
                        Performance has regressed.
commit Brakedown<Fr>/20 time:   [109.14 ms 110.60 ms 111.89 ms]
                        change: [-7.3949% -6.7829% -6.0433%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) high mild

brakedown open:

open Brakedown<Fr>/12   time:   [165.62 ms 166.54 ms 167.84 ms]
                        change: [-1.0451% -0.3270% +0.3985%] (p = 0.38 > 0.10)
                        No change in performance detected.
open Brakedown<Fr>/14   time:   [290.08 ms 292.72 ms 294.83 ms]
                        change: [-1.8968% -0.9854% -0.1286%] (p = 0.04 < 0.10)
                        Change within noise threshold.
Found 1 outliers among 10 measurements (10.00%)
  1 (10.00%) low severe
open Brakedown<Fr>/16   time:   [463.86 ms 466.71 ms 469.39 ms]
                        change: [-1.2915% -0.6964% -0.0752%] (p = 0.06 < 0.10)
                        Change within noise threshold.
open Brakedown<Fr>/18   time:   [776.43 ms 784.75 ms 792.93 ms]
                        change: [-1.4276% -0.3743% +0.7449%] (p = 0.50 > 0.10)
                        No change in performance detected.
open Brakedown<Fr>/20   time:   [1.4922 s 1.4989 s 1.5061 s]
                        change: [+0.5632% +1.0813% +1.6360%] (p = 0.00 < 0.10)
                        Change within noise threshold.

Copy link

@mmagician mmagician left a comment

Choose a reason for hiding this comment

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

Thanks for the benches!
It seems pretty clear that this is more efficient than brakedown branch.

It also looks better than the previous row-mul, but there the difference is rather small (given num samples). Can you please confirm this with benches against the earlier version of this branch (which only had one Matrix)?
The diff is mostly visible for 20 num vars, we can probably limit the tests to that case, but maybe a little more samples.

Comment on lines +98 to +100
#[cfg(test)]
pub(crate) fn entry(&self, i: usize, j: usize) -> F {
self.rows[i][j]

Choose a reason for hiding this comment

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

this doesn't seem to be used

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it is not used in Hyrax and in Ligero, it is only for testing. We can remove it.

pub(crate) fn new_from_rows(row_list: Vec<Vec<F>>) -> Self {
let m = row_list[0].len();
#[cfg(test)]
pub(crate) fn new_from_rows(row_major: Vec<Vec<F>>) -> Self {

Choose a reason for hiding this comment

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

This is only used in testing now

Choose a reason for hiding this comment

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

can be removed / refactor tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that RowMajorMatrix is used in Hyrax and Ligero too. We need this method for them. So I would say let's keep it.

@mmagician mmagician mentioned this pull request Apr 5, 2024
6 tasks
@DimitrisPapac
Copy link

Hello, all. I ran some more benchmarks, this time comparing performance of the previous commit (hash: e20f67e) and the current commit where we use two different matrices for representation (hash: cf2af29). I increased the number of samples back to 100 and tested for 12, 14, ..., 26 variables. The results can be seen below:

Benches for row-mul commit before the split:

commit Brakedown<Fr>/12 time:   [2.9039 ms 2.9331 ms 2.9662 ms]
                        change: [+1.9360% +3.0011% +4.1764%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 19 outliers among 100 measurements (19.00%)
  5 (5.00%) low mild
  2 (2.00%) high mild
  12 (12.00%) high severe
commit Brakedown<Fr>/14 time:   [6.4383 ms 6.5425 ms 6.6472 ms]
                        change: [+10.308% +12.064% +14.264%] (p = 0.00 < 0.10)
                        Performance has regressed.
commit Brakedown<Fr>/16 time:   [13.133 ms 13.326 ms 13.533 ms]
                        change: [+8.0164% +9.9897% +11.894%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 13 outliers among 100 measurements (13.00%)
  9 (9.00%) high mild
  4 (4.00%) high severe
commit Brakedown<Fr>/18 time:   [35.232 ms 37.033 ms 39.095 ms]
                        change: [+4.9755% +10.082% +16.182%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 20 outliers among 100 measurements (20.00%)
  5 (5.00%) high mild
  15 (15.00%) high severe
commit Brakedown<Fr>/20 time:   [102.61 ms 104.01 ms 105.48 ms]
                        change: [+14.356% +15.980% +17.669%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
commit Brakedown<Fr>/22 time:   [357.59 ms 361.13 ms 364.82 ms]
                        change: [+22.122% +24.132% +26.196%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
commit Brakedown<Fr>/24 time:   [1.3293 s 1.3367 s 1.3440 s]
                        change: [+12.700% +14.745% +16.851%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 13 outliers among 100 measurements (13.00%)
  5 (5.00%) low severe
  4 (4.00%) low mild
  3 (3.00%) high mild
  1 (1.00%) high severe
commit Brakedown<Fr>/26 time:   [5.8552 s 5.9194 s 5.9828 s]
                        change: [+15.617% +16.948% +18.203%] (p = 0.00 < 0.10)
                        Performance has regressed.

Benches for row-mul open before the split:

open Brakedown<Fr>/12   time:   [167.30 ms 167.95 ms 168.66 ms]
                        change: [+1.3521% +1.9245% +2.5151%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) high mild
  1 (1.00%) high severe
open Brakedown<Fr>/14   time:   [292.16 ms 293.83 ms 296.49 ms]
                        change: [+1.1037% +1.8393% +2.8880%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  1 (1.00%) high severe
open Brakedown<Fr>/16   time:   [454.98 ms 456.31 ms 457.70 ms]
                        change: [-0.5712% -0.1427% +0.3201%] (p = 0.53 > 0.10)
                        No change in performance detected.
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild
open Brakedown<Fr>/18   time:   [762.69 ms 764.09 ms 765.51 ms]
                        change: [-1.3052% -1.0474% -0.7667%] (p = 0.00 < 0.10)
                        Change within noise threshold.
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) low mild
  2 (2.00%) high mild
open Brakedown<Fr>/20   time:   [1.4339 s 1.4359 s 1.4380 s]
                        change: [-1.2009% -0.9533% -0.7160%] (p = 0.00 < 0.10)
                        Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
open Brakedown<Fr>/22   time:   [3.0313 s 3.0353 s 3.0393 s]
                        change: [-2.1096% -1.9576% -1.7912%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
open Brakedown<Fr>/24   time:   [6.7704 s 6.7865 s 6.8036 s]
                        change: [-4.6163% -4.3867% -4.1329%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  6 (6.00%) low mild
  1 (1.00%) high severe
open Brakedown<Fr>/26   time:   [15.504 s 15.519 s 15.534 s]
                        change: [-9.6497% -9.5204% -9.3999%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) low mild

Benches for row-mul commit after the split:

commit Brakedown<Fr>/12 time:   [3.3879 ms 3.4143 ms 3.4413 ms]
                        change: [-3.7507% -2.3345% -0.9506%] (p = 0.00 < 0.10)
                        Change within noise threshold.
commit Brakedown<Fr>/14 time:   [5.8168 ms 5.8382 ms 5.8600 ms]
                        change: [-12.988% -11.342% -9.6152%] (p = 0.00 < 0.10)
                        Performance has improved.
commit Brakedown<Fr>/16 time:   [12.002 ms 12.115 ms 12.251 ms]
                        change: [-4.4517% -2.7064% -0.9400%] (p = 0.00 < 0.10)
                        Change within noise threshold.
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) high mild
  9 (9.00%) high severe
commit Brakedown<Fr>/18 time:   [33.525 ms 33.641 ms 33.751 ms]
                        change: [+2.1580% +2.5678% +2.9554%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) low severe
commit Brakedown<Fr>/20 time:   [89.241 ms 89.678 ms 90.115 ms]
                        change: [-0.3164% +0.4234% +1.1952%] (p = 0.28 > 0.10)
                        No change in performance detected.
Found 13 outliers among 100 measurements (13.00%)
  11 (11.00%) low mild
  1 (1.00%) high mild
  1 (1.00%) high severe
commit Brakedown<Fr>/22 time:   [287.09 ms 290.92 ms 294.77 ms]
                        change: [+3.5402% +5.2769% +6.8493%] (p = 0.00 < 0.10)
                        Performance has regressed.
commit Brakedown<Fr>/24 time:   [1.1451 s 1.1650 s 1.1852 s]
                        change: [+0.8084% +2.6246% +4.7030%] (p = 0.01 < 0.10)
                        Change within noise threshold.
commit Brakedown<Fr>/26 time:   [5.0550 s 5.0616 s 5.0681 s]
                        change: [-0.3093% -0.1161% +0.0680%] (p = 0.24 > 0.10)
                        No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

Benches for row-mul open after the split:

open Brakedown<Fr>/12   time:   [164.10 ms 164.78 ms 165.45 ms]
                        change: [-1.8447% -1.1393% -0.4156%] (p = 0.02 < 0.10)
                        Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) low mild
open Brakedown<Fr>/14   time:   [287.37 ms 288.52 ms 289.66 ms]
                        change: [-2.2503% -1.4332% -0.4925%] (p = 0.02 < 0.10)
                        Change within noise threshold.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) low mild
open Brakedown<Fr>/16   time:   [455.43 ms 456.96 ms 458.48 ms]
                        change: [-2.7542% -2.0879% -1.4225%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
open Brakedown<Fr>/18   time:   [770.61 ms 772.18 ms 773.70 ms]
                        change: [-2.6476% -1.6015% -0.5337%] (p = 0.01 < 0.10)
                        Change within noise threshold.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) low mild
open Brakedown<Fr>/20   time:   [1.4469 s 1.4497 s 1.4526 s]
                        change: [-3.7760% -3.2807% -2.8032%] (p = 0.00 < 0.10)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
open Brakedown<Fr>/22   time:   [3.0931 s 3.0959 s 3.0986 s]
                        change: [+4.1286% +4.2684% +4.4131%] (p = 0.00 < 0.10)
                        Performance has regressed.
open Brakedown<Fr>/24   time:   [7.0910 s 7.0979 s 7.1046 s]
                        change: [+6.4681% +6.6200% +6.7733%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
open Brakedown<Fr>/26   time:   [17.136 s 17.152 s 17.169 s]
                        change: [+10.847% +10.996% +11.146%] (p = 0.00 < 0.10)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

@autquis
Copy link
Collaborator Author

autquis commented Apr 7, 2024

What @mmagician said is more efficient than having two representations simultaneously. However, I propose finding better names as we have put it in src/utils.rs, and Hyrax and Ligero will use only RowMajorMatrix. Maybe Matrix and CMatrix?

@DimitrisPapac How come the new technique performs weaker in commit in the last benchmark? By the way, notice that the "changes" written in the benchmark result are compared to the previous run of benches, so you may want to clear the previous result ( I don't remember how ).

@Antonio95
Copy link

Let me throw my tiny two cents in here and say that a way to remove the change information is to remove the previous benchmark output in target/criterion (cf. here). Or, a bit more lazily, simply run the same benchmark twice back to back.

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.

4 participants