-
Notifications
You must be signed in to change notification settings - Fork 23
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
Poisson test case with new API (AmgX_CSR) #33
Comments
In this API we have the "updateA" call which replaces the matrix coefficients and then performs a lighter weight resetup (rather than the full setup). I am working internally to make this resetup even faster so in the future this should represent a substantial improvement in performance in the future. It is of course possible to construct an API that would allow uploading coefficients without performing the resetup at all, and I have worked on some applications where this can be useful. It tends to be cases where you are willing to sacrifice some accuracy for the sake of avoiding the setup costs for some number of solve steps. Do you have a particular use case where this is applicable? |
Oh yes, I read it but forgot this... I will check on my largest test case how lighter is the resetup, thanks.
Great.
PETSc provides such a feature (https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetReusePreconditioner.html), and a particular use case may be Newton's method (should test in my code) where keeping the setup of the first iteration could provide benefits despite the loss of some accuracy, as the Jacobian slightly changes. Thanks for answering about the new CSR API. |
I ran poisson test case on v100 card with on a bigger test case with no gain on re-setup unhappily. ./poisson -caseName log -mode AmgX_CSR -cfgFileName ./AmgX_SolverOptions_Classical.info -Nx 100 -Ny 100 -Nz 100Case Name: AmgX_CSR_100x100x100
|
Hello @mattmartineau , thanks for your new API,
I am playing with it and running the poisson test case where it is possible to update the coefficients of the matrix and not rebuilding it. But I am surprised that with AMG preconditioner, the setup is done again. Did i miss something ?
Thanks,
Case Name: log
Nx: 10
Ny: 10
Nz: 10
Mode: AmgX_CSR
Config File: ./AmgX_SolverOptions_Classical.info
Number of Solves: 10
Output PETSc Log File ? false
========================================================================
AMGX version 2.1.0.131-opensource
Built on Mar 14 2021, 16:01:18
Compiled with CUDA Runtime 10.2, using CUDA driver 11.0
Cannot read file as JSON object, trying as AMGX config
Cannot read file as JSON object, trying as AMGX config
Converting config string to current config version
Parsing configuration string: exception_handling=1 ;
Using Normal MPI (Hostbuffer) communicator...
AMG Grid:
Number of Levels: 4
LVL ROWS NNZ SPRSTY Mem (GB)
--------------------------------------------------------------
0(D) 1000 6400 0.0064 0.000101
1(D) 500 7760 0.031 0.000193
2(D) 85 4245 0.588 9.82e-05
3(D) 10 100 1 2.55e-06
--------------------------------------------------------------
Grid Complexity: 1.595
Operator Complexity: 2.89141
Total Memory Usage: 0.000395462 GB
--------------------------------------------------------------
iter Mem Usage (GB) residual rate
--------------------------------------------------------------
Ini 0.762817 1.418968e+03
0 0.762817 4.049953e+02 0.2854
1 0.7628 2.272882e+01 0.0561
2 0.7628 2.135450e+00 0.0940
3 0.7628 1.660107e-01 0.0777
4 0.7628 1.927763e-02 0.1161
5 0.7628 2.591171e-03 0.1344
6 0.7628 2.747955e-04 0.1061
7 0.7628 2.890709e-05 0.1052
--------------------------------------------------------------
Total Iterations: 8
Avg Convergence Rate: 0.1093
Final Residual: 2.890709e-05
Total Reduction in Residual: 2.037191e-08
Maximum Memory Usage: 0.763 GB
--------------------------------------------------------------
Total Time: 0.0165809
setup: 0.0125757 s
solve: 0.00400515 s
solve(per iteration): 0.000500644 s
AMG Grid:
Number of Levels: 4
LVL ROWS NNZ SPRSTY Mem (GB)
--------------------------------------------------------------
0(D) 1000 6400 0.0064 0.000101
1(D) 500 7760 0.031 0.000193
2(D) 85 4245 0.588 9.82e-05
3(D) 10 100 1 2.55e-06
--------------------------------------------------------------
Grid Complexity: 1.595
Operator Complexity: 2.89141
Total Memory Usage: 0.000395462 GB
--------------------------------------------------------------
iter Mem Usage (GB) residual rate
--------------------------------------------------------------
Ini 0.762817 2.890709e-05
0 0.762817 4.493219e-06 0.1554
1 0.7628 5.017173e-07 0.1117
2 0.7628 5.233455e-08 0.1043
3 0.7628 5.699205e-09 0.1089
4 0.7628 6.339535e-10 0.1112
5 0.7628 7.636473e-11 0.1205
6 0.7628 8.610483e-12 0.1128
7 0.7628 8.893718e-13 0.1033
--------------------------------------------------------------
Total Iterations: 8
Avg Convergence Rate: 0.1151
Final Residual: 8.893718e-13
Total Reduction in Residual: 3.076656e-08
Maximum Memory Usage: 0.763 GB
--------------------------------------------------------------
Total Time: 0.0161896
setup: 0.0123392 s
solve: 0.00385043 s
solve(per iteration): 0.000481304 s
2-Norm: 0.986988
Max-Norm: 0.0577365
Iterations 9
========================================================================
End of log
========================================================================
The text was updated successfully, but these errors were encountered: