Skip to content

CSR Representation for Sparse Matrices#38

Merged
winston-h-zhang merged 7 commits intodevfrom
csr-mvm-feature
Sep 16, 2023
Merged

CSR Representation for Sparse Matrices#38
winston-h-zhang merged 7 commits intodevfrom
csr-mvm-feature

Conversation

@winston-h-zhang
Copy link
Copy Markdown
Contributor

@winston-h-zhang winston-h-zhang commented Sep 5, 2023

Resolves #37.

This PR implements CSR matrix-vector multiplication under the "csr" feature. (This was for me to debug; if CSR sould become the only representation, then we can simply replace and remove the feature.) We get a slight uptick in performance, around 10%.

Notes:

There are many sparse matrix crates available in rust. However, most of these crates are do not parallelize, or are not compatiable with field elements. For example, sprs does not parallelize its sparse matrix / dense vector multiplication. It's traits also require num_traits::Zero, which is not compatiable with ff::PrimeField.

CSR:

Nova-based VDF with MinRoot delay function
=========================================================
Proving 1 iterations of MinRoot per step
Producing public parameters...
PublicParams::setup, took 898.236583ms 
Number of constraints per step (primary circuit): 9819
Number of constraints per step (secondary circuit): 10347
Number of variables per step (primary circuit): 9813
Number of variables per step (secondary circuit): 10329
Generating a RecursiveSNARK...
RecursiveSNARK::prove_step 0: true, took 3.208µs 
RecursiveSNARK::prove_step 1: true, took 31.0505ms 
RecursiveSNARK::prove_step 2: true, took 37.113ms 
RecursiveSNARK::prove_step 3: true, took 37.011ms 
RecursiveSNARK::prove_step 4: true, took 38.116292ms 
RecursiveSNARK::prove_step 5: true, took 37.588333ms 
RecursiveSNARK::prove_step 6: true, took 37.468125ms 
RecursiveSNARK::prove_step 7: true, took 37.913125ms 
RecursiveSNARK::prove_step 8: true, took 37.48625ms 
RecursiveSNARK::prove_step 9: true, took 38.424084ms 
Verifying a RecursiveSNARK...
RecursiveSNARK::verify: true, took 29.615583ms
Generating a CompressedSNARK using Spartan with IPA-PC...
CompressedSNARK::prove: true, took 721.547ms
CompressedSNARK::len 9407 bytes
Verifying a CompressedSNARK...
CompressedSNARK::verify: true, took 30.767459ms

No CSR:

Nova-based VDF with MinRoot delay function
=========================================================
Proving 1 iterations of MinRoot per step
Producing public parameters...
PublicParams::setup, took 891.275666ms 
Number of constraints per step (primary circuit): 9819
Number of constraints per step (secondary circuit): 10347
Number of variables per step (primary circuit): 9813
Number of variables per step (secondary circuit): 10329
Generating a RecursiveSNARK...
RecursiveSNARK::prove_step 0: true, took 2.875µs 
RecursiveSNARK::prove_step 1: true, took 34.667833ms 
RecursiveSNARK::prove_step 2: true, took 40.504625ms 
RecursiveSNARK::prove_step 3: true, took 40.93575ms 
RecursiveSNARK::prove_step 4: true, took 41.700541ms 
RecursiveSNARK::prove_step 5: true, took 41.201209ms 
RecursiveSNARK::prove_step 6: true, took 41.845625ms 
RecursiveSNARK::prove_step 7: true, took 41.882541ms 
RecursiveSNARK::prove_step 8: true, took 41.978542ms 
RecursiveSNARK::prove_step 9: true, took 42.167542ms 
Verifying a RecursiveSNARK...
RecursiveSNARK::verify: true, took 28.778584ms
Generating a CompressedSNARK using Spartan with IPA-PC...
CompressedSNARK::prove: true, took 729.643958ms
CompressedSNARK::len 9406 bytes
Verifying a CompressedSNARK...
CompressedSNARK::verify: true, took 29.569208ms
=========================================================

Copy link
Copy Markdown
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

I think the core step here would be to not involve a COO -> CSR conversion but convert straight to CSR.

@winston-h-zhang
Copy link
Copy Markdown
Contributor Author

winston-h-zhang commented Sep 5, 2023

Note: there are a few places where I don't do the most optimal calculation; I've neglected them in favor of getting this draft PR out.

However, everything on the "critical path" is as one would theoretically expect. Maybe there are more concrete optimizations to be made.

I also rebased on #34, to save the hassle of public params changing between feature switching due to the difference representations.

@porcuquine
Copy link
Copy Markdown
Contributor

This PR implements CSR matrix-vector multiplication under the "csr" feature. (This was for me to debug; if CSR sould become the only representation, then we can simply replace and remove the feature.) We get a slight uptick in performance, around 10%. Nevermind, it equals out as constraints get larger.

Given the motivation for this change, and that it will change digests, etc., I would love to see a stronger indication that the current implementation will produce the expected performance improvement. I fully accept that we have solid theoretical ground for expecting it, but it would be worth working out enough of the implementation to be sure we won't need more digest-affecting changes in order to realize the gains.

@winston-h-zhang
Copy link
Copy Markdown
Contributor Author

winston-h-zhang commented Sep 5, 2023

Here are some concrete gains in lurk-rs for proving times, bench sha256_ivc_prove, rc=10, 100.
No CSR:

sha256_ivc_prove/2023-09-05:7b1b685d5d39892eae74080ea179f2e1654a6f5e:rc=10:sha256_ivc_1/1                                                                          
                        time:   [9.3756 s 9.4571 s 9.5291 s]

sha256_ivc_prove/2023-09-05:7b1b685d5d39892eae74080ea179f2e1654a6f5e:rc=100:sha256_ivc_1/1                                                                          
                        time:   [6.2255 s 6.3031 s 6.3943 s]

CSR:

sha256_ivc_prove/2023-09-05:7b1b685d5d39892eae74080ea179f2e1654a6f5e:rc=10:sha256_ivc_1/1                                                                          
                        time:   [8.4676 s 8.6431 s 8.7572 s]
                        change: [-10.421% -8.6069% -7.0613%] (p = 0.00 < 0.05)
                        Performance has improved.
sha256_ivc_prove/2023-09-05:7b1b685d5d39892eae74080ea179f2e1654a6f5e:rc=100:sha256_ivc_1/1                                                                          
                        time:   [5.3944 s 5.5193 s 5.6346 s]
                        change: [-14.883% -12.435% -10.207%] (p = 0.00 < 0.05)
                        Performance has improved.

@porcuquine
Copy link
Copy Markdown
Contributor

Here are some concrete gains in lurk-rs, bench sha256_ivc_prove, rc=10, 100. No CSR:

Ah, perfect — thanks. I think that's sufficient to show this is manifestly worthwhile. If we can gain confidence in the concrete representation being stable, I'd suggest we don't need a feature flag to accept this.

Copy link
Copy Markdown
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Agreed with @porcuquine I think this is ripe for a CSR-only implementation, provided this uses CSR from the start.

The conversion is indeed just part of setup, but when we're dealing with foldings that run in <40ms, I expect the additional handful of ms involved in this unnecessary conversion to show a difference.

@porcuquine
Copy link
Copy Markdown
Contributor

The conversion is indeed just part of setup, but when we're dealing with foldings that run in <40ms, I expect the additional handful of ms involved in this unnecessary conversion to show a difference.

It doesn't matter how long one folding takes. If we are folding many times, then the one-time cost of processing circuit shapes should not be a big deal. In other words, at the scale of proofs that will take seconds or minutes to generate, then ms are not that big a deal. However, I agree that we should just materialize whatever we are going to use, as a matter of efficiency in principal.

The reason I mention is that the only case (as I see it), where the one-time cost of creating the shape is significant, is the case where the whole proof is very very small. I'm trying to emphasize that this is not a very important case in terms of how we focus on optimization. So even though I agree it's worth this savings, the much more important point is to ensure that whatever we do here is indeed only being performed once, when creating parameters for a given circuit.

@huitseeker
Copy link
Copy Markdown
Contributor

huitseeker commented Sep 6, 2023

The reason I mention is that the only case (as I see it), where the one-time cost of creating the shape is significant, is the case where the whole proof is very very small. I'm trying to emphasize that this is not a very important case in terms of how we focus on optimization.

I agree, but that is very precisely the case chosen for the initial benchmarks @winston-h-zhang reported, which created (and arguably still creates) some noise in communication.

The work of creating matrices in any format is already performed once, and nothing about this PR changes that. That one-time work is however creating an intermediary representation in this PR that does not need to be there.

@porcuquine
Copy link
Copy Markdown
Contributor

The logical implication of what I'm saying is that if we want to justify the work based on measured performance rather than theory, then we should choose a representative benchmark (like the ones from lurk-rs that I found convincing). What I was observing above is that if we have the expected performance characteristics, then on a suitable benchmark we should observe that this question of conversion at a cost on the order of milliseconds won't be significant. To be clear, I'm not arguing that we shouldn't favor the more efficient method given the total decision. I'm just saying that it is not a first-order performance consideration. If our benchmarks are forcing us to treat it as significant, we should either change them or be sophisticated enough to look past them before letting the tail wag the dog.

@winston-h-zhang winston-h-zhang marked this pull request as ready for review September 6, 2023 21:07
Copy link
Copy Markdown
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

This work seems completely orthogonal to adding a digest to the R1CS shapes. In order to merge this quickly, I would recommend rebasing this PR so that it only contains the commits relevant to the CSR representation. There are two equivalent ways of doing this:

  • git rebase --onto (ref)
  • git rebase --interactive origin/master (and then remove all the irrelevant commits)

@winston-h-zhang
Copy link
Copy Markdown
Contributor Author

Yes, sorry the digest work was just for testing on lurk-rs. Let me rebase

@winston-h-zhang winston-h-zhang force-pushed the csr-mvm-feature branch 4 times, most recently from 85c2350 to 9cefd6f Compare September 7, 2023 21:08
@winston-h-zhang winston-h-zhang force-pushed the csr-mvm-feature branch 2 times, most recently from a41142f to c90d9c4 Compare September 8, 2023 02:12
@huitseeker
Copy link
Copy Markdown
Contributor

!benchmark

Copy link
Copy Markdown
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

This needs a rebase, so back to your queue.
I have a rebased branch, which I built for review, if that helps https://github.com/huitseeker/Nova/tree/csr-mvm-feature-review

Further, the iterator is OK when you really need to iterate over every element in a non-amiguous way1, e.g. when computing a hash. But it shouldn't be a crutch moving us away from using the native CSR shape for all arithmetic operations, which I think is possible here, in snark.rs and everything I've seen so far in ppsnark.rs.

Footnotes

  1. i.e. where interpreting the order of arrival of the data must not require having context about the matrix representation

@winston-h-zhang
Copy link
Copy Markdown
Contributor Author

!benchmark

@samuelburnham
Copy link
Copy Markdown
Contributor

!benchmark

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark for 9d5a73b

Click to view benchmark
Test Base PR %
RecursiveSNARK-StepCircuitSize-0/Prove 86.4±1.17ms 79.5±0.44ms -7.99%
RecursiveSNARK-StepCircuitSize-0/Verify 73.5±0.23ms 73.7±0.27ms +0.27%
RecursiveSNARK-StepCircuitSize-1038757/Prove 2.8±0.03s 2.8±0.03s 0.00%
RecursiveSNARK-StepCircuitSize-1038757/Verify 2.7±0.03s 2.7±0.03s 0.00%
RecursiveSNARK-StepCircuitSize-121253/Prove 445.2±6.18ms 430.8±4.57ms -3.23%
RecursiveSNARK-StepCircuitSize-121253/Verify 376.1±1.00ms 377.3±2.01ms +0.32%
RecursiveSNARK-StepCircuitSize-22949/Prove 152.7±0.74ms 147.5±0.89ms -3.41%
RecursiveSNARK-StepCircuitSize-22949/Verify 138.4±0.87ms 138.5±0.99ms +0.07%
RecursiveSNARK-StepCircuitSize-252325/Prove 823.8±12.28ms 800.9±7.15ms -2.78%
RecursiveSNARK-StepCircuitSize-252325/Verify 711.6±6.23ms 717.8±11.14ms +0.87%
RecursiveSNARK-StepCircuitSize-514469/Prove 1527.7±25.41ms 1507.4±12.85ms -1.33%
RecursiveSNARK-StepCircuitSize-514469/Verify 1443.0±18.28ms 1476.1±14.35ms +2.29%
RecursiveSNARK-StepCircuitSize-55717/Prove 257.4±1.01ms 249.7±0.72ms -2.99%
RecursiveSNARK-StepCircuitSize-55717/Verify 230.8±2.45ms 232.0±2.47ms +0.52%
RecursiveSNARK-StepCircuitSize-6565/Prove 105.6±1.20ms 98.7±0.74ms -6.53%
RecursiveSNARK-StepCircuitSize-6565/Verify 92.2±0.29ms 92.0±0.36ms -0.22%

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark for 9d5a73b

Click to view benchmark
Test Base PR %
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-0/Prove 85.4±1.13ms 77.2±0.97ms -9.60%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-0/Verify 73.2±0.57ms 72.6±0.49ms -0.82%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-1038757/Prove 2.9±0.02s 3.0±0.00s +3.45%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-1038757/Verify 2.5±0.02s 2.6±0.01s +4.00%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-121253/Prove 463.7±9.35ms 448.6±4.15ms -3.26%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-121253/Verify 393.2±8.05ms 388.6±3.63ms -1.17%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-22949/Prove 160.6±1.30ms 149.3±1.58ms -7.04%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-22949/Verify 142.0±1.67ms 138.1±2.56ms -2.75%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-252325/Prove 832.9±9.34ms 805.6±9.64ms -3.28%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-252325/Verify 772.2±9.26ms 782.4±7.63ms +1.32%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-514469/Prove 1419.0±9.14ms 1412.7±6.12ms -0.44%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-514469/Verify 1351.1±9.25ms 1381.7±12.50ms +2.26%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-55717/Prove 267.8±3.29ms 252.2±3.98ms -5.83%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-55717/Verify 219.0±3.65ms 218.9±6.23ms -0.05%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-6565/Prove 105.9±0.91ms 95.8±0.85ms -9.54%
RecursiveSNARKSuperNova-1circuit-StepCircuitSize-6565/Verify 92.0±1.26ms 89.9±2.75ms -2.28%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-0/Prove 92.4±1.96ms 84.1±0.35ms -8.98%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-0/Verify 81.5±0.14ms 80.1±0.81ms -1.72%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-1038757/Prove 3.0±0.01s 3.0±0.02s 0.00%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-1038757/Verify 2.6±0.01s 2.5±0.03s -3.85%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-121253/Prove 474.6±6.95ms 461.0±5.54ms -2.87%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-121253/Verify 406.4±4.98ms 400.6±3.91ms -1.43%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-22949/Prove 172.0±2.45ms 159.5±0.94ms -7.27%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-22949/Verify 150.9±1.63ms 150.0±0.95ms -0.60%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-252325/Prove 842.7±3.83ms 823.9±5.45ms -2.23%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-252325/Verify 793.9±2.48ms 796.8±4.36ms +0.37%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-514469/Prove 1441.6±7.59ms 1427.3±7.77ms -0.99%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-514469/Verify 1371.2±4.12ms 1393.4±5.39ms +1.62%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-55717/Prove 271.8±5.84ms 265.0±2.79ms -2.50%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-55717/Verify 231.1±1.04ms 231.6±3.56ms +0.22%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-6565/Prove 114.0±1.79ms 104.3±0.64ms -8.51%
RecursiveSNARKSuperNova-2circuit-StepCircuitSize-6565/Verify 99.8±0.99ms 99.1±0.71ms -0.70%

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark for 9d5a73b

Click to view benchmark
Test Base PR %
CompressedSNARK-Commitments-StepCircuitSize-0/Prove 15.9±0.10s 15.9±0.03s 0.00%
CompressedSNARK-Commitments-StepCircuitSize-0/Verify 379.3±2.07ms 393.9±4.41ms +3.85%
CompressedSNARK-Commitments-StepCircuitSize-121253/Prove 39.6±0.04s 39.5±0.59s -0.25%
CompressedSNARK-Commitments-StepCircuitSize-121253/Verify 856.1±5.77ms 859.4±5.99ms +0.39%
CompressedSNARK-Commitments-StepCircuitSize-22949/Prove 23.5±0.18s 24.2±0.19s +2.98%
CompressedSNARK-Commitments-StepCircuitSize-22949/Verify 566.7±7.26ms 593.9±5.54ms +4.80%
CompressedSNARK-Commitments-StepCircuitSize-252325/Prove 69.8±0.10s 69.4±0.50s -0.57%
CompressedSNARK-Commitments-StepCircuitSize-252325/Verify 1551.8±6.50ms 1547.2±8.91ms -0.30%
CompressedSNARK-Commitments-StepCircuitSize-55717/Prove 39.3±0.18s 39.2±0.29s -0.25%
CompressedSNARK-Commitments-StepCircuitSize-55717/Verify 855.9±2.69ms 882.1±6.51ms +3.06%
CompressedSNARK-Commitments-StepCircuitSize-6565/Prove 23.5±0.15s 24.1±0.20s +2.55%
CompressedSNARK-Commitments-StepCircuitSize-6565/Verify 565.8±7.45ms 593.0±6.25ms +4.81%
CompressedSNARK-StepCircuitSize-0/Prove 1557.0±3.12ms 1553.6±8.09ms -0.22%
CompressedSNARK-StepCircuitSize-0/Verify 64.2±0.26ms 64.9±0.43ms +1.09%
CompressedSNARK-StepCircuitSize-1038757/Prove 47.9±0.14s 48.4±0.04s +1.04%
CompressedSNARK-StepCircuitSize-1038757/Verify 1501.0±6.74ms 1648.6±17.95ms +9.83%
CompressedSNARK-StepCircuitSize-121253/Prove 6.7±0.04s 6.9±0.03s +2.99%
CompressedSNARK-StepCircuitSize-121253/Verify 242.9±3.38ms 253.1±1.91ms +4.20%
CompressedSNARK-StepCircuitSize-22949/Prove 2.3±0.01s 2.3±0.01s 0.00%
CompressedSNARK-StepCircuitSize-22949/Verify 93.0±0.81ms 93.4±0.76ms +0.43%
CompressedSNARK-StepCircuitSize-252325/Prove 12.5±0.02s 12.6±0.03s +0.80%
CompressedSNARK-StepCircuitSize-252325/Verify 435.8±4.31ms 447.4±5.04ms +2.66%
CompressedSNARK-StepCircuitSize-514469/Prove 24.4±0.05s 23.9±0.02s -2.05%
CompressedSNARK-StepCircuitSize-514469/Verify 744.7±6.93ms 770.8±9.40ms +3.50%
CompressedSNARK-StepCircuitSize-55717/Prove 3.8±0.02s 3.8±0.01s 0.00%
CompressedSNARK-StepCircuitSize-55717/Verify 142.8±1.76ms 145.0±2.20ms +1.54%
CompressedSNARK-StepCircuitSize-6565/Prove 1555.4±9.01ms 1577.6±4.04ms +1.43%
CompressedSNARK-StepCircuitSize-6565/Verify 64.7±0.49ms 65.8±0.76ms +1.70%

@huitseeker
Copy link
Copy Markdown
Contributor

Benchmark for 9d5a73b

Click to view benchmark
Test Base PR %
RecursiveSNARK-StepCircuitSize-0/Prove 86.4±1.17ms 79.5±0.44ms -7.99%
RecursiveSNARK-StepCircuitSize-0/Verify 73.5±0.23ms 73.7±0.27ms +0.27%
RecursiveSNARK-StepCircuitSize-1038757/Prove 2.8±0.03s 2.8±0.03s 0.00%
RecursiveSNARK-StepCircuitSize-1038757/Verify 2.7±0.03s 2.7±0.03s 0.00%
RecursiveSNARK-StepCircuitSize-121253/Prove 445.2±6.18ms 430.8±4.57ms -3.23%
RecursiveSNARK-StepCircuitSize-121253/Verify 376.1±1.00ms 377.3±2.01ms +0.32%
RecursiveSNARK-StepCircuitSize-22949/Prove 152.7±0.74ms 147.5±0.89ms -3.41%
RecursiveSNARK-StepCircuitSize-22949/Verify 138.4±0.87ms 138.5±0.99ms +0.07%
RecursiveSNARK-StepCircuitSize-252325/Prove 823.8±12.28ms 800.9±7.15ms -2.78%
RecursiveSNARK-StepCircuitSize-252325/Verify 711.6±6.23ms 717.8±11.14ms +0.87%
RecursiveSNARK-StepCircuitSize-514469/Prove 1527.7±25.41ms 1507.4±12.85ms -1.33%
RecursiveSNARK-StepCircuitSize-514469/Verify 1443.0±18.28ms 1476.1±14.35ms +2.29%
RecursiveSNARK-StepCircuitSize-55717/Prove 257.4±1.01ms 249.7±0.72ms -2.99%
RecursiveSNARK-StepCircuitSize-55717/Verify 230.8±2.45ms 232.0±2.47ms +0.52%
RecursiveSNARK-StepCircuitSize-6565/Prove 105.6±1.20ms 98.7±0.74ms -6.53%
RecursiveSNARK-StepCircuitSize-6565/Verify 92.2±0.29ms 92.0±0.36ms -0.22%

Hmm, my benchmarks show a very consistent improvement in the Recursive benches:
https://gist.github.com/huitseeker/8dfdfbfad59543f5e7c9a3b204fb510f

Copy link
Copy Markdown
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

I think this is close to done. The only blocking items are:

  • the initialization of the inner vector in fn new,
  • adjusting test_matrix_vector_multiplication and test_matrix_iter in any of the ways I suggested, or equivalent.
    I've left a range of suggestions for those tests, but I'll be happy with a minimal fix.

@winston-h-zhang winston-h-zhang force-pushed the csr-mvm-feature branch 2 times, most recently from b8627bf to 5252452 Compare September 14, 2023 20:26
huitseeker
huitseeker previously approved these changes Sep 14, 2023
Copy link
Copy Markdown
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Tip top! thank you so much!

@winston-h-zhang winston-h-zhang added this pull request to the merge queue Sep 16, 2023
Merged via the queue into dev with commit 650dd7a Sep 16, 2023
@winston-h-zhang winston-h-zhang deleted the csr-mvm-feature branch September 16, 2023 08:12
github-actions bot pushed a commit that referenced this pull request Oct 16, 2023
* CSR Representation for Sparse Matrices (#38)

* add csr feature

* remove feature

remove conversions

* cleanup

* avoid iter() and go row-by-row

* cleanup and apply suggestions

* add R1CSShape padding test

* add more suggestions

* refactor: Refactor sparse namespace and SparseMatrix visibility

- Modifies the visibility of `sparse` module from public to private
- Makes `SparseMatrix` class within `sparse` module public
- Updates `SparseMatrix` import across several files to accommodate visibility changes

* fix: define matrix inputs in idiomatic Nova style

* chore: Refactor dependencies for r1cs module

- Shifted `proptest` and `rand` dependencies to dev-dependencies in `Cargo.toml`
- Introduced testing flag for `util` module under `r1cs`

---------

Co-authored-by: Hanting Zhang <[email protected]>
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.

Replace COO SpMVM by a CSR

4 participants