LLNL / libROM

Model reduction library with an emphasis on large scale parallelism and linear subspace methods
https://www.librom.net
Other
201 stars 36 forks source link

Feature/randomized svd #52

Closed kevinhkhuynh closed 3 years ago

kevinhkhuynh commented 3 years ago

Implementation of randomized SVD using scalapack and qrcp.

chldkdtn commented 3 years ago

@kevinhkhuynh This is great! I hope that you will include some tests for randomized SVD.

kevinhkhuynh commented 3 years ago

@kevinhkhuynh This is great! I hope that you will include some tests for randomized SVD.

Yes. Some tests will be included in this PR.

kevinhkhuynh commented 3 years ago

@chldkdtn @dylan-copeland @siuwuncheung This took longer than I thought, but it's ready for review now. Uses pdeqpf to obtain Q in elementary householder format, than uses pdormqr to compute the action of Q. Originally, I computed the action in libROM, but it was way too slow.

Test results were computed using the Matlab script given by Youngsoo. libROM matches with these 2 small tests for the left basis, right basis, and singular values.

dylan-copeland commented 3 years ago

Thanks @kevinhkhuynh, this is a great new addition to libROM. There is significant new memory management, so it would be a good idea to run some small tests (serial and parallel) with valgrind to verify there are no memory leaks.

chldkdtn commented 3 years ago

@kevinhkhuynh Can you double check if travis actually uses gtest and all our gtest suites are tested in travis?

kevinhkhuynh commented 3 years ago

The ability to run serial tests with multiple processes have been added and the results are identical to the serial tests.

@kevinhkhuynh Can you double check if travis actually uses gtest and all our gtest suites are tested in travis?

Yes. If you look here at one of the Travis tests run and scroll to the bottom (https://travis-ci.com/github/LLNL/libROM/jobs/468930047), you can see the gtest tests running and passing.

chldkdtn commented 3 years ago

@kevinhkhuynh How did you check if parallel randomized SVD is correct? Did you compare the solution with serial randomized SVD run?

kevinhkhuynh commented 3 years ago

How did you check if parallel randomized SVD is correct? Did you compare the solution with serial randomized SVD run?

Yes, the parallel tests run the serial tests with multiple processes and checks that the solution is the same with the serial randomized SVD run. There is an additional check to make sure that the basis is the correct size on each processor (each processor's basis should be smaller than the original, and since this passes we know it isn't running in serial).

kevinhkhuynh commented 3 years ago

How did you check if parallel randomized SVD is correct? Did you compare the solution with serial randomized SVD run?

Yes, the parallel tests run the serial tests with multiple processes and checks that the solution is the same with the serial randomized SVD run. There is an additional check to make sure that the basis is the correct size on each processor (each processor's basis should be smaller than the original, and since this passes we know it isn't running in serial).

But I still need to run more tests before I change the label to RFR.

chldkdtn commented 3 years ago

How did you check if parallel randomized SVD is correct? Did you compare the solution with serial randomized SVD run?

Yes, the parallel tests run the serial tests with multiple processes and checks that the solution is the same with the serial randomized SVD run. There is an additional check to make sure that the basis is the correct size on each processor (each processor's basis should be smaller than the original, and since this passes we know it isn't running in serial).

For both parallel and serial run, I think you need to use the same random matrix in order to get identical (or close to identical) results. Do you use the same random matrix?

kevinhkhuynh commented 3 years ago

How did you check if parallel randomized SVD is correct? Did you compare the solution with serial randomized SVD run?

Yes, the parallel tests run the serial tests with multiple processes and checks that the solution is the same with the serial randomized SVD run. There is an additional check to make sure that the basis is the correct size on each processor (each processor's basis should be smaller than the original, and since this passes we know it isn't running in serial).

For both parallel and serial run, I think you need to use the same random matrix in order to get identical (or close to identical) results. Do you use the same random matrix?

Yes, randomizedSVD has a parameter that sets a random seed, and the random seed is defaulted to 1 unless the user changes it.