AD performance #16466
-
I have been using AD for tensor mechanics applications for quite some time, and I observe that in some cases AD is slightly slower but acceptable, but in some cases AD is ~5x slower. We've had this discussion many times at many different places. I think it is time to sit down and look at the performance seriously. I hope this can be a good starting point for some AD performance improvements in tensor mechanics. I put together three really simple test cases using the tensor mechanics module only. ModelThis is a 2D square domain with RZ coordinates. The bottom edge is fixed in z, and the left edge is fixed in r. The top edge is being pulled upward (on the displaced mesh). There is a nonhomogeneous eigenstrain applied on the domain. Each of the test case uses a different constitutive law. A total small strain linear elastic model, an incremental small strain power law creep model, and an incremental finite strain power law creep model. PerformanceAll tests ran in serial.
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 16 replies
-
@bwspenc @dschwen @lindsayad @tophmatthews I guess you will be interested in seeing this... |
Beta Was this translation helpful? Give feedback.
-
With AD we need to refocus our attention to the cost of full tensor operations. I'd like to see high symmetry tensor classes and either
Gary, you mentioned that your group is already working on point 1. It would be great if we could convince them to share their approach. Otherwise we need to waste resources to do something similar. |
Beta Was this translation helpful? Give feedback.
-
I wrote a somewhat optimized ADComputeIsotropicLinearElasticStress stress calculator. But the performance improvement isn't great. Running the small strain elastic case with AD (global sparse) still takes 6.075 seconds. |
Beta Was this translation helpful? Give feedback.
-
The other price is likely the inner newton loop. It feels like there can be a smarter way to avoid doing the inner newton loop twice, or maybe at all for the jacobian? |
Beta Was this translation helpful? Give feedback.
-
You guys should do some profiling with gperftools or instruments
… On Dec 16, 2020, at 6:23 PM, Lynn Munday ***@***.***> wrote:
Based on what Gary did, I put in a nonAD version of the Laromance model and for some simple load cases for creep modeling and found the nonADLaromance model to be 9x faster. These are simulating a 10x10x10 element block of material with Neumann and Dirichlet bcs. I start the simulation at a constant stress for 1e6s and then ramp the stress up to twice its value over 35e3s; the total time being simulated is 37 days. I will be running these for 20 years of simulation time. The loading is pretty simple so both AD and nonAD using Newton take 84 linear iterations, 12 nonlinear iterations, 28 simulation steps. The AD version takes 856s of wall time and nonAD takes 95s. The PR is here:
#16521
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
On that same branch, I added a SymmetricIsotropicRankFourTensor class, which, as its name suggests, is optimized for symmetric isotropic rank four tensor. For the incremental finite strain creep case, the speed up is like 40 seconds -> 35 seconds. @dschwen I spent yesterday the entire day trying to compile gperftools on my ubuntu but I ran into some issues. Could you help me sort it out? Alternatively you could just run some profiling on your machine. The input files I am comparing here is AD_small_strain_power_law_creep.i and AD_small_strain_power_law_creep_optimized.i. |
Beta Was this translation helpful? Give feedback.
-
I had to do `conda deactivate; conda deactivate` before building the go
pprof. It will run fine in the activated environment later
…On Fri, Dec 18, 2020 at 9:22 AM Lynn Munday ***@***.***> wrote:
I can't get it to stop crossing out lines
But I had some trouble with pprof but I couldn't get the go version of
pprof to work with my mpi
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16466 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRMPXT4KRNA4Y5VDBO2DTSVN6U7ANCNFSM4UWJYFSQ>
.
|
Beta Was this translation helpful? Give feedback.
@bwspenc @dschwen @lindsayad @tophmatthews I guess you will be interested in seeing this...