Algorithm Search⌘K

Definitionadvanced

Log-sum-exp wirelength

Also called LSE wirelength model.

The smooth bound gamma times the log of the sum of exp(x_i/gamma), and its counterpart for the minimum, that approximates the half-perimeter wire length.

The log-sum-exp (LSE) wirelength is a smooth function of the pin positions of a net that approximates its half-perimeter wirelength (HPWL) from above. It replaces the maximum of the pin coordinates by γln⁡∑iexi/γ\gamma \ln \sum_i e^{x_i / \gamma} and the minimum by −γln⁡∑ie−xi/γ-\gamma \ln \sum_i e^{-x_i / \gamma}, where γ>0\gamma > 0 is a smoothing length. For a net of pp pins it is never below the HPWL and at most 4γln⁡p4 \gamma \ln p above it. It is convex, has a gradient everywhere, and its gradient is Lipschitz with a constant of order 1/γ1 / \gamma, so gradient methods can minimize it. Nonlinear analytical placers such as NTUplace3 use it as their wirelength term; they start with a large γ\gamma and make it smaller as the cells spread.

Definition

Let a net ee have p≥1p \ge 1 pins at (x1,y1),…,(xp,yp)(x_1, y_1), \ldots, (x_p, y_p), and let γ>0\gamma > 0. Write

smaxγ(x)=γln⁡∑i=1pexi/γ,sminγ(x)=−γln⁡∑i=1pe−xi/γ.\mathrm{smax}_\gamma(x) = \gamma \ln \sum_{i=1}^{p} e^{x_i / \gamma}, \qquad \mathrm{smin}_\gamma(x) = -\gamma \ln \sum_{i=1}^{p} e^{-x_i / \gamma}.

The LSE wirelength of ee is

LSEγ(e)=(smaxγ(x)−sminγ(x))+(smaxγ(y)−sminγ(y)),\mathrm{LSE}_\gamma(e) = \bigl( \mathrm{smax}_\gamma(x) - \mathrm{smin}_\gamma(x) \bigr) + \bigl( \mathrm{smax}_\gamma(y) - \mathrm{smin}_\gamma(y) \bigr),

and the total for a netlist is ∑ewe LSEγ(e)\sum_e w_e \, \mathrm{LSE}_\gamma(e), with the pins at the cell centers unless pin offsets are given. Pads give fixed terms. The xx part and the yy part are independent; below, only the xx part is shown.

Bounds. Let M=max⁡ixiM = \max_i x_i and m=min⁡ixim = \min_i x_i. The sum ∑iexi/γ\sum_i e^{x_i / \gamma} has one term eM/γe^{M / \gamma} and pp terms of at most eM/γe^{M / \gamma}, so

M≤smaxγ(x)≤M+γln⁡p,m−γln⁡p≤sminγ(x)≤m.M \le \mathrm{smax}_\gamma(x) \le M + \gamma \ln p, \qquad m - \gamma \ln p \le \mathrm{smin}_\gamma(x) \le m.

So M−m≤smaxγ(x)−sminγ(x)≤M−m+2γln⁡pM - m \le \mathrm{smax}_\gamma(x) - \mathrm{smin}_\gamma(x) \le M - m + 2 \gamma \ln p, and with the yy part, HPWL(e)≤LSEγ(e)≤HPWL(e)+4γln⁡p\mathrm{HPWL}(e) \le \mathrm{LSE}_\gamma(e) \le \mathrm{HPWL}(e) + 4 \gamma \ln p. The upper bound holds with equality when all xix_i are equal and all yiy_i are equal. As γ→0\gamma \to 0, LSEγ(e)→HPWL(e)\mathrm{LSE}_\gamma(e) \to \mathrm{HPWL}(e).

Gradient. With ai=exi/γ/∑jexj/γa_i = e^{x_i / \gamma} / \sum_j e^{x_j / \gamma} and bi=e−xi/γ/∑je−xj/γb_i = e^{-x_i / \gamma} / \sum_j e^{-x_j / \gamma},

∂∂xi(smaxγ−sminγ)=ai−bi.\frac{\partial}{\partial x_i} \bigl( \mathrm{smax}_\gamma - \mathrm{smin}_\gamma \bigr) = a_i - b_i.

The weights aa are the softmax of x/γx / \gamma, and bb the softmax of −x/γ-x / \gamma. Each sums to 1, so the gradient sums to 0 over the pins: moving all pins of a net by the same amount does not change the value. Each partial derivative lies in (−1,1)(-1, 1), so the function is 1-Lipschitz in each coordinate. For a cell, add we(ai−bi)w_e (a_i - b_i) over the pins ii of the cell.

Convexity and smoothness. The Hessian of smaxγ\mathrm{smax}_\gamma is 1γ(diag(a)−aa⊤)\frac{1}{\gamma} \bigl( \mathrm{diag}(a) - a a^\top \bigr). For a vector vv, v⊤(diag(a)−aa⊤)v=∑iaivi2−(∑iaivi)2≥0v^\top (\mathrm{diag}(a) - a a^\top) v = \sum_i a_i v_i^2 - (\sum_i a_i v_i)^2 \ge 0, the variance of vv under the weights aa, so smaxγ\mathrm{smax}_\gamma is convex. In row ii the diagonal entry is ai(1−ai)a_i (1 - a_i) and the other entries have absolute values summing to ai(1−ai)a_i (1 - a_i), so by Gershgorin's theorem every eigenvalue is at most max⁡i2ai(1−ai)≤12\max_i 2 a_i (1 - a_i) \le \frac12. The same holds for −sminγ-\mathrm{smin}_\gamma with bb. So the xx part of LSEγ(e)\mathrm{LSE}_\gamma(e) is convex, and its gradient is Lipschitz with constant at most 1/γ1 / \gamma in the Euclidean norm.

Computation. For a small γ\gamma, exi/γe^{x_i / \gamma} overflows. Compute smaxγ(x)=M+γln⁡∑ie(xi−M)/γ\mathrm{smax}_\gamma(x) = M + \gamma \ln \sum_i e^{(x_i - M) / \gamma}, where every exponent is at most 0, and likewise for sminγ\mathrm{smin}_\gamma with mm; this is the log-sum-exp trick. One net costs O(p)O(p) time for the value and the gradient together, and a netlist costs O(P)O(P) for PP pins.

Examples and non-examples

  • Three pins, several γ\gamma. Pins at x=0,1,4x = 0, 1, 4, so M−m=4M - m = 4. The xx part of LSE, its excess over 4, the bound 2γln⁡32 \gamma \ln 3, and the gradient (ai−bi)(a_i - b_i), rounded to 4 places:
γ\gamma xx part of LSE excess bound 2γln⁡32 \gamma \ln 3 gradient at x=0,1,4x = 0, 1, 4
2 5.7226 1.7226 4.3944 −0.4745,−0.1840,0.6584-0.4745, -0.1840, 0.6584
1 4.3924 0.3924 2.1972 −0.7043,−0.2188,0.9230-0.7043, -0.2188, 0.9230
0.5 4.0650 0.0650 1.0986 −0.8802,−0.1167,0.9969-0.8802, -0.1167, 0.9969
0.25 4.0045 0.0045 0.5493 −0.9820,−0.0180,1.0000-0.9820, -0.0180, 1.0000

As γ\gamma falls, the value tends to 4 and the gradient tends to the subgradient (−1,0,1)(-1, 0, 1) of M−mM - m, which pulls only the outer pins. With a large γ\gamma the middle pin also feels a pull.

  • All pins at one point. Three pins at x=2x = 2 with γ=1\gamma = 1: the HPWL is 0, but the xx part of LSE is 2ln⁡3≈2.19722 \ln 3 \approx 2.1972, the full bound. LSE never reaches 0 for p≥2p \ge 2, so it does not measure the length of a net whose pins coincide.
  • Two pins. Pins at x=0x = 0 and x=4x = 4 with γ=1\gamma = 1: the value is 4+2ln⁡(1+e−4)≈4.03634 + 2 \ln(1 + e^{-4}) \approx 4.0363. The excess shrinks fast as the pins move apart, since only the far terms are small.
  • Not the length of a route. LSE is a smooth stand-in for HPWL, and HPWL is a lower bound on the routed length; LSE is not an upper bound on the routed length.
  • Half-perimeter wirelength. The limit of LSE as γ→0\gamma \to 0; convex and piecewise linear, but not differentiable where two pins tie for the extreme.
  • Weighted average (WA) model. Replace the maximum by ∑ixiexi/γ/∑iexi/γ\sum_i x_i e^{x_i / \gamma} / \sum_i e^{x_i / \gamma} and the minimum by ∑ixie−xi/γ/∑ie−xi/γ\sum_i x_i e^{-x_i / \gamma} / \sum_i e^{-x_i / \gamma} (Hsu, Chang and Balabanov 2011). Each is a weighted mean of the xix_i, so the WA value is at most M−mM - m; the first mean puts more weight on large xix_i than the plain mean and the second less, so the value is at least 0. With x=0,1,4x = 0, 1, 4 and γ=1\gamma = 1 it is 3.4733, against 4.3924 for LSE. ePlace and later placers use WA. WA is not convex in general.
  • Lp-norm model. Replace the maximum by (∑ixiq)1/q(\sum_i x_i^q)^{1/q} for a large qq and positive coordinates. It is another smooth bound used in some placers.
  • Quadratic net models. The clique net model and the star model use squared distances. They are smooth and lead to linear systems, as in quadratic placement, but they are not close to HPWL for nets of many pins.
  • Softmax and the log-sum-exp trick. The gradient of smaxγ\mathrm{smax}_\gamma is the softmax of x/γx / \gamma, and its stable evaluation is the log-sum-exp trick.
  • Smoothing of a nonsmooth convex function. smaxγ\mathrm{smax}_\gamma is the standard smooth approximation of the maximum, with the trade-off of error γln⁡p\gamma \ln p against smoothness 1/γ1 / \gamma that governs how fast gradient methods converge.

References

  1. William C. Naylor, Ross Donelly and Lu Sha, Non-linear optimization system and method for wire length and delay optimization for an automatic electric circuit placer, United States Patent 6,301,693, 2001, the smooth log-sum-exp form of the bounding box length of a net (general locator)
  2. Tung-Chieh Chen, Zhe-Wei Jiang, Tien-Chang Hsu, Hsin-Chen Chen and Yao-Wen Chang, NTUplace3, an analytical placer for large-scale mixed-size designs with preplaced blocks and density constraints, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 27(7), 1228 to 1240, 2008, the log-sum-exp wirelength model and its smoothing parameter in the objective of the analytical placer
  3. Stephen Boyd and Lieven Vandenberghe, Convex Optimization, Cambridge University Press, 2004, Chapter 3, the log-sum-exp function as an example of a convex function, with its Hessian
  4. Jingwei Lu, Pengwen Chen, Chin-Chih Chang, Lu Sha, Dennis Jen-Hsin Huang, Chin-Chi Teng and Chung-Kuan Cheng, ePlace, electrostatics-based placement using fast Fourier transform and Nesterov's method, ACM Transactions on Design Automation of Electronic Systems 20(2), article 17, 2015, the weighted average wirelength model used in place of log-sum-exp

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/VR19M7/text.yaml