Challenges and Opportunities in Challenges and Opportunities in Using Automatic Differentiation Using Automatic Differentiation with Object-Oriented Toolkits for with Object-Oriented Toolkits for Scientific Computing Scientific Computing Paul Hovland (Argonne National Laboratory) Steven Lee (Lawrence Livermore National Laboratory) Lois McInnes (ANL) Boyana Norris (ANL) Barry Smith (ANL) The Computational Differentiation Project at Argonne National Laboratory
43
Embed
Challenges and Opportunities in Using Automatic Differentiation with Object- Oriented Toolkits for Scientific Computing Paul Hovland (Argonne National.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Challenges and Opportunities in Using Challenges and Opportunities in Using Automatic Differentiation with Object-Automatic Differentiation with Object-Oriented Toolkits for Scientific ComputingOriented Toolkits for Scientific Computing
Paul Hovland (Argonne National Laboratory) Steven Lee (Lawrence Livermore National Laboratory)Lois McInnes (ANL)Boyana Norris (ANL)Barry Smith (ANL)
The Computational Differentiation Project at Argonne National Laboratory
AcknowledgmentsAcknowledgments
Jason Abate Satish Balay Steve Benson Peter Brown Omar Ghattas Lisa Grignon William Gropp Alan Hindmarsh David Keyes Jorge Moré Linda Petzold Widodo Samyono
OutlineOutline
Intro to AD Survey of Toolkits
SensPVODE PETSc TAO
Using AD with Toolkits Toolkit Level Parallel Function Level Subdomain Level Element/Vertex Function Level
Bound-constrained optimization Trust region Newton method Gradient projection/conjugate gradient method
Linearly-constrained optimization Interior-point method with iterative solvers
TAO AlgorithmsTAO Algorithms
ApplicationInitialization
Function & GradientEvaluation
HessianEvaluation
Post-Processing
Application Driver
Toolkit for Advanced
Optimization(TAO)PC KSP
Linear SolversMatrices
Vectors
Optimization Tools
TAO codeUser code PETSc code
PETSc and TAOPETSc and TAO
Using AD with ToolkitsUsing AD with Toolkits
Apply AD to toolkit to produce derivative-enhanced toolkit
Use AD to provide Jacobian/Hessian/gradient for use by toolkit. Apply AD at Parallel Function Level Subdomain Function Level Element/Vertex Function Level
Differentiated Version of ToolkitDifferentiated Version of Toolkit
Makes possible sensitivity analysis, black-box optimization of models constructed using toolkit
Can take advantage of high-level structure of algorithms, providing better performance: see Andreas’ and Linda’s talks
Ongoing work with PETSc and PVODE
Levels of Function EvaluationLevels of Function Evaluationint FormFunction(SNES snes,Vec X,Vec F,void *ptr){ Parallel Function Level /* Variable declarations omitted */ mx = user->mx; my = user->my; lambda = user->param; Subdomain Function Level hx = one/(double)(mx-1); hy = one/(double)(my-1); sc = hx*hy*lambda; hxdhy = hx/hy; hydhx = hy/hx;
Toolkit Level – Differentiated PETSc Linear Solver Parallel Nonlinear Function Level – SensPVODE Local Subdomain Function Level
PETSc TAO
Element Function Level – PETSc
Differentiated Linear Differentiated Linear Equation SolverEquation Solver
Increased AccuracyIncreased Accuracy
Increased AccuracyIncreased Accuracy
SensPVODE: ProblemSensPVODE: Problem
Diurnl kinetics advection-diffusion equation 100x100 structured grid 16 processors of a Linux cluster with 550 MHz
processors and Myrinet interconnect
SensPVODE: TimeSensPVODE: Time
SensPVODE: Number of TimestepsSensPVODE: Number of Timesteps
SensPVODE: Time/TimestepSensPVODE: Time/Timestep
PETSc ApplicationsPETSc Applications
Toy problems Solid fuel ignition: finite difference discretization; Fortran & C
variants; differentiated using ADIFOR, ADIC Driven cavity: finite difference discretization; C
implementation; differentiated using ADIC Euler code
Based on legacy F77 code from D. Whitfield (MSU) Finite volume discretization Up to 1,121,320 unknowns Mapped C-H grid Fully implicit steady-state Tools: SNES, DA, ADIFOR
C-H Structured GridC-H Structured Grid
Algorithmic PerformanceAlgorithmic Performance
Real PerformanceReal Performance
Hybrid MethodHybrid Method
Hybrid Method (cont.)Hybrid Method (cont.)
TAO: Preliminary ResultsTAO: Preliminary Results
For More InformationFor More Information
PETSc: http://www.mcs.anl.gov/petsc/ TAO: http://www.mcs.anl.gov/tao/ Automatic Differentiation at Argonne
10 challenges for PDE 10 challenges for PDE optimization algorithmsoptimization algorithms
1.1. Problem sizeProblem size2.2. Efficiency vs. intrusivenessEfficiency vs. intrusiveness3.3. ““Physics-based” globalizationsPhysics-based” globalizations4.4. Inexact PDE solversInexact PDE solvers5.5. Approximate JacobiansApproximate Jacobians6.6. Implicitly-defined PDE residualsImplicitly-defined PDE residuals7.7. Non-smooth solutionsNon-smooth solutions8.8. Pointwise inequality constraintsPointwise inequality constraints9.9. Scalability of adjoint methods to large numbers Scalability of adjoint methods to large numbers
of inequalities of inequalities 10.10. Time-dependent PDE optimization Time-dependent PDE optimization
7. Non-smoothness7. Non-smoothness
PDE residual may not depend smoothly on state PDE residual may not depend smoothly on state variables (maybe not even continuously)variables (maybe not even continuously) Solution-adaptivitySolution-adaptivity Discontinuity-capturing, front-trackingDiscontinuity-capturing, front-tracking Subgrid-scale modelsSubgrid-scale models Material property evaluationMaterial property evaluation Contact problemsContact problems Elasto(visco)plasticityElasto(visco)plasticity
PDE residual may not depend smoothly or PDE residual may not depend smoothly or continuously on decision variablescontinuously on decision variables Solid modeler- and mesh generator-inducedSolid modeler- and mesh generator-induced