310 likes | 765 Views
A Hybrid Linear Equation Solver and its Application in Quadratic Placement Haifeng Qian, Univ of Minnesota Sachin S. Sapatnekar, Univ of Minnesota Quadratic placement Variables Cost function Computation My topic A x = b where | A | ≠ 0 # re-solve A x = b 2
E N D
A Hybrid Linear Equation Solver and its Application in Quadratic Placement Haifeng Qian, Univ of Minnesota Sachin S. Sapatnekar, Univ of Minnesota
Quadratic placement • Variables • Cost function • Computation My topic A x = b where |A| ≠ 0
# re-solve Ax = b2 higher preconditioner quality Preconditioned iterative solver (IC,ILU,AMG...) Direct solver Iterative solver (CG,BiCG,MINRES,GMRES...) density power grid thermal analysis quadratic placement The big picture
Status quo • Preconditioning • Popular choice: Incomplete LU • Placement matrices • Symmetric positive definite • Popular choice: ICCG with • Different ordering • Different dropping rules
Status quo Is this the best we can do? done done • Rules • Pattern • Min value • Size limit
stochastic precondi-tioning adopt an iterative scheme Iterative Solver The Hybrid Solver Stochastic Solver We present … • Limited topic today • Symmetric • Positive diagonal entries • Negative off-diagonal entries • Irreducibly diagonally dominant • These are sufficient, NOT necessary, conditions is sufficient not necessary
Equations Random event(s) Variables Expectation of random variables Approximate solution Average of random samples The third and forgotten category Stochastic solver methodology
$ Home Home Home Random walk overview • Given: • A network of roads • A motel at eachintersection • A set of homes • Random walk • Walk one (randomlychosen) road every day • Stay the night at a motel (pay for it!) • Keep going until reaching home • Win a reward for reaching home! • Problem: find the expected amount of money in the end as a function of the starting node x
4 px,4 x 1 3 px,1 px,3 px,2 2 Random walk overview • For every node
Linear equation set Random walk game M walks from i-th node Take average i-th entry of solution Random walk overview Weakness Error ~ M-0.5 3% error to be faster than direct/iterative solvers
Stochastic Solver New solution: Sequential Monte Carlo Stochastic Solver approx. solve error & residual approx. solve Benefit: ||r||2<<||b||2 ||y||2<<||x||2 same relative error = lower absolute error A. W. Marshall 1956, J. H. Halton 1962
Start Start Trick #1: new homes New home Previously calculated node Benefit: more and more homes shorter and shorter walks one walk = average of multiple walks Qian et al., DAC2003
Trick #2: journey record Keep a record: motel/award list New RHS: Ax = b2 Update motel prices, award values Use the record: pay motels, receive awards New solution Benefit: no more walks only feasible after trick#1 Qian et al., DAC2003
Keep a record: motel/award list Stochastic Solver New RHS: Ax = b2 Update motel prices, award values Stochastic Solver Use the record: pay motels, receive awards New solution New solution: Ring a bell?
Random walks:Initial solution & Keep a record New problem: Update motel prices, award values Use the record: pay motels, receive awards produce New solution: Prototype
A second look Solver using the record kth iteration by linear operations By definition Substitution By definition This is preconditioned Gauss-Jacobi ! Why Gauss-Jacobi Why not CG/BiCG/MINRES/GMRES
Solver using the record What’s on the record? Row i
Recall that is a solution to UL factorization
UL and LU rev( ) :inverse ordering operator
Doolittle LU factorization is unique. Therefore Convert to LU If symmetric
Recall LDL factorization • What we need for symmetric A • What we have • How to find ? • Please refer to the paper
A path exists from i to j through node set {i+1,…N} Incomplete factorization • Non-zero pattern proof • Accuracy control • Please refer to the paper Conclusion: Incomplete LDL factorization to precondition any iterative solver
Compare to existing ILU • Existing ILU • Gaussian elimination • Drop edges by pattern, value, size • Error propagation • A missing edge affects subsequent computation • Exacerbated for larger and denser matrices b2 b2 b1 b1 a b3 b3 b5 b5 b4 b4
Superior because … • Each row of L is independently calculated • No knowledge of other rows • Responsible for its own accuracy • No debt from other steps
Test setup • Quadratic placement instances • Set #1: matrices and rhs’s by an industrial placer • Set #2: matrices by UWaterloo placer on ISPD02 benchmarks, unit rhs’s • LASPACK: ICCG with ILU(0) • MATLAB: ICCG with ILUT • Approx. Min. Degree ordering • Tuned to similar factorization size • Same accuracy: • Complexity metric: # double-precision multiplications • Solving stage only
Physical runtimes on P4-2.8GHz • Reasonable preconditioning overhead • Less than 3X solving time • One-time cost, amortized over multiple solves
Conclusion • Hybrid linear solver • Combining stochastic and iterative techniques • Special case: symmetric diagonally dominant • Proven incomplete LDL factorization • Random-walk preconditioned Conjugate Gradient • Extendable to more general matrices • Promising results on placement matrices • Up to 7X speedup over ICCG • Favor large and dense matrices
Thank you Solver package download http://www.ece.umn.edu/users/qianhf/hybridsolver
Backup: accuracy control • Stopping criterion must be • Function of A • Independent ofb