DiffChip: Thermally Aware Chip Placement with Automatic Differentiation Thanks: This project was funded by the MIT-IBM Watson AI Lab. Giuseppe Romano, Aakrati Jain, Nima Dehmamy, Cheng Chi, Xin Zhang Abstract Chiplets are modular integrated circuits that can be combined to form a larger system, offering flexibility and performance enhancements. However, their dense packing often leads to significant thermal management challenges, requiring careful floorplanning to ensure efficient heat distribution. To address thermal considerations, layout optimization algorithms concurrently minimize the total wirelength and the maximum temperature. However, these efforts employ gradient-free approaches, such as simulated annealing, which suffer from poor scaling and slow convergence. In this paper, we propose DiffChip , a chiplet placement algorithm based on automatic differentiation (AD). The proposed framework relies on a differentiable thermal solver that computes the sensitivity of the temperature map with respect to the positions of the chiplets. Regularization strategies for peak temperature, heat sources, and material properties enable end-to-end differentiability, allowing for gradient-based optimization. We apply DiffChip to optimize a layout where the total wirelength is minimized while keeping the maximum temperature below a desired threshold. By leveraging AD and physics-aware optimization, our approach accelerates the design process of microelectronic systems, exceeding traditional trial-and-error and gradient-free methods. I Introduction The exponential increase in device density, as predicted by Moore’s Law [ 1 ] , has been a key driver of technological advancement. However, this increase necessitates finer lithography techniques, leading to higher manufacturing costs. To address these limitations, chiplets have emerged as a promising solution. They enable efficient scaling by integrating heterogeneous components of varying complexities into a single package, enhancing flexibility while reducing manufacturing costs and complexity [ 2 , 3 ] . Despite these advantages, chiplets present several challenges such as interconnect complexity [ 4 ] and thermal dissipation [ 5 , 6 ] . As these issues are greatly influenced by the chiplet locations, floorplanning optimization is a crucial design step. Chiplet placement may take into account several factors, such as maximum wirelength and data delay [ 7 , 8 ] , as well as thermal effects [ 9 , 10 ] . Typically, thermally-aware chiplet floorplanning uses gradient-free optimization, where the physics of the problem is treated as a black box. A popular heat conduction solver employed in this class of methods is HotSpot [ 11 ] . Although these approaches provide insights into the response of the temperature profile to design choices, they become expensive for non-regular realistic layouts [ 12 ] . To mitigate this issue, machine-learning techniques have been proposed. For instance, Ref. [ 13 ] uses Graph Neural Networks (GNN) as a surrogate for the thermal solver to predict temperature profiles faster than HotSpot. However, the training cost undermines computational efficiency [ 14 ] . This paper introduces DiffChip , a framework for chiplet layout optimization based on automatic differentiation (AD), written in JAX [ 15 ] . AD enables faster development iterations by taking gradients of programs without manual sensitivity analysis. It is fundamental in machine learning for calculating gradients with respect to neural network weights, often using reverse-mode AD, or backpropagation. Beyond machine learning, AD is increasingly used in physics-based inverse design [ 16 , 17 ] , where the cost function often depends on the solution of a partial differential equation (PDE). In such a case, the optimization is said PDE-constrained . Our work falls under this category. The main challenge is to differentiate through the chiplet positions. In fact, from a modeling standpoint, chiplets are rectanguloid to which we assign a given thermal conductivity and volumetric power density. Thus, there is a spatial discontinuity of these quantities, which breaks the differentiability of the pipeline as the chiplets move along the plane during optimization. We address this issue by adopting smoothing strategies. Our contributions are summarized below: • The development of a smoothing model for the thermal conductivity and heat source associated to chiplets. • The regularization of the maximum temperature (which is not differentiable) into a differentiable form enables the calculation of its sensitivity with respect to the chiplet locations. • The development of a novel differentiable non-overlap chiplet constraint. As explained in the Sec. IV , this constraint is based on smoothed indicator functions. • The implementation of a regularization for the total wirelength. • The development of a code that integrates these abovementioned regularized quantities with a differentiable 3D thermal solver. • An example of layout optimization, where the HPWL is minimized under maximum temperature and non-overlap constraints. • The validation of the optimized layout with a commercial software. This paper is organized as follows. In Sec. II , the problem statement is outlined, followed by the description of regularization strategies ( III ) pertaining to the thermal conductivity, heat source, the HPWL and the maximum temperature. In Sec. IV the non-overlap constraint is detailed. Section V shows the application of DiffChip on two optimization scenarios, followed by conclusions (Sec. VI ). II Problem statement We consider a standard package architecture [ 18 ] , in which chiplets are bonded to the interposer via microbumps, and macrobumps connect the interposer to the package (Fig. 1 ). The package is secured with soldered bumps. To efficiently dissipate heat, a copper lid and heat sink are included. Heat dissipation is managed using a convective boundary condition applied to the top surface of the heat sink. Thermal interface materials are included between the chiplets and the lid, as well as between the lid and the heat sink. For complex geometries, such as the bumps and interposer, a homogenized anisotropic thermal conductivity is used. The sizes of each layer, along with their thermal conductivity tensors, are reported in Table I . The goal is to minimize the total wirelength while maintaining the maximum temperature below a specified threshold, T_{th} , and ensuring chiplets do not overlap. To this end, we consider N_{c} = 8 chiplets (shown in Fig. 1 a), including four high-bandwidth memory (H) blocks and four compute (C) blocks. The connections among chiplets are described by the adjacency matrix \mathbf{A} , which is 1 only when chiplet i is connected with chiplet j and zero otherwise (Fig. 2 a). Note that connections are intended as unidirectional; thus A_{ij}=1 does not imply that A_{ji}=1 . In our example, as illustrated in Fig. 1 a, there are 10 connections. Chiplets are assigned a dissipated power, H_{i} , and dimensions L_{i}^{x},L_{i}^{y} , where i=0,...,N_{c}-1 (Fig. 2 b); the thickness of each die is fixed (0.25 mm). The positions of the chiplets are denoted by \mathbf{p}\in\mathcal{R}^{N_{c}\times 2} , comprising 2N_{c} degrees of freedom. The total wirelength is estimated by the Half Perimeter Wirelength (HPWL) [ 19 ] , formulated as [ 19 ] HPWL \displaystyle=\sum_{i,j=0}^{N_{c}-1}A_{i,j}\left[\max(x_{i},x_{j})-\min(x_{i},x_{j})\right. \displaystyle\quad\left.+\max(y_{i},y_{j})-\min(y_{i},y_{j})\right], (1) while the temperature map is evaluted by the standarnd heat conduction equation \displaystyle-\nabla\cdot\kappa\nabla T \displaystyle=H \displaystyle\mathbf{r}\in\Omega \displaystyle-\kappa\nabla T \displaystyle=h\left(T-T_{\mathrm{amb}}\right) \displaystyle\mathbf{r}\in\Gamma_{1} \displaystyle-\kappa\nabla T \displaystyle=0 \displaystyle\mathbf{r}\in\Gamma_{2}. (2) In Eq. II , the convective heat transfer coefficient is h=3\times 10^{3} Wm -2 K -1 , the ambient temperature T_{\mathrm{amb}}=20^{\circ} C, \Omega is the simulation domain, \Gamma_{1} is the top side of the sink and \Gamma_{2} is the remaining of the boundary, which is treated as adiabatic. Equation II is discretized using the finite-volume method, resulting in the following linear system \mathbf{A}\mathbf{T}=\mathbf{b}, (3) where \mathbf{A}\in\mathcal{R}^{N\times N} , \mathbf{T}\in\mathcal{R}^{N} , \mathbf{b}\in\mathcal{R}^{N} , and N=N_{x}N_{y}N_{z} is the number of control volumes. In this work, the grid is N_{x}=100,N_{y}=100 and N_{z}=222 , amounting to 2.22 million degrees of freedom. The higher resolution along the z -axis accounts for the small thickness of layers compared to their in-plane dimensions. The control volume has the dimension 0.8\times 0.8\times 0.025 mm 3 . Fig. 1: (a). Top view on the chiplet configurations. The connections among chiplets are shown in red. The lid and heat sink are omitted. (b) Vertical cut where the z-dimension is magnified 10x for clarity. (c) Close-up of the chiplet portion of the simulation domain. Layer Thermal Conductivity Size ( \kappa_{xx} , \kappa_{yy} , \kappa_{zz} ) ( L_{x} , L_{y} , L_{z} ) [Wm -1 K -1 ] [mm] Heat Sink (385,385,385) (80,80,1) TMI 2 (1.6,1.6,1.6) (66,66,0.15) Lid (385,385,385) (66,66,2.0) TMI 1 (1.6,1.6,1.6) ( L_{x} , L_{y} ,0.15) Chiplet (150,150,150) ( L_{x} , L_{y} ,0.25) Micro bumps (0.9,0.9,2.5) ( L_{x} , L_{y} ,0.05) Interposer (128,128,148) (50,50,0.1) Macro bumps (0.9,0.9,2.5) (50,50,0.05) Substrate (0.33,0.33,0.33) (66,66,1.5) Solded bumps (1.2,1.2,2.8) (66,66,0.3) Air (0.024,0.024,0.024) —- TABLE I: Size and thermal conductivity tensors of each layer, and for air. The thickness of the lid is 1 mm along all three directions. Chiplet Position Size Power ( x , y ) ( L_{x} , L_{y} ) H [mm] [mm] [W] H 1 (-7,16) (10,10) 20 H 2 (7,16) (10,10) 20 H 3 (-7,-16) (10,10) 20 H 4 (7,-16) (10,10) 20 C 1 (-7,5) (10,8) 30 C 2 (7,5) (10,8) 30 C 3 (-7,-5) (10,8) 30 C 4 (7,-5) (10,8) 30 TABLE II: Chiplet layout and properties. III Regularization Equation II needs to be regularized because the maximum and minimum functions are not differentiable. To this end, we use the logsumexp softmax/min functions [ 19 ] \displaystyle\max(\mathbf{x}) \displaystyle= \displaystyle\gamma\log\left[\sum_{i}e^{x_{i}\gamma}\right] (4) \displaystyle\min(\mathbf{x}) \displaystyle= \displaystyle-\gamma\log\left[\sum_{i}e^{-x_{i}\gamma}\right], (5) with \gamma=10^{-3} . Using these expressions, the HPWL becomes \displaystyle\textrm{HPWL}=\gamma\sum_{i,j=0}^{N_{c}-1}A_{i,j}\log\left[2+2\cosh\left(\frac{x_{j}-x_{i}}{\gamma}\right)\right]+ \displaystyle+A_{i,j}\log\left[2+2\cosh\left(\frac{y_{j}-y_{i}}{\gamma}\right)\right]. (6) To regularize the maximum temperature from Eq. 3 , we use the p-norm approximation, which is commonly used in thermal inverse problems [ 20 ] , \max\mathbf{T}\approx\left(\frac{1}{N}\sum_{i=0}^{N-1}T_{i}^{p}\right)^{1/p}=\text{p-norm}(\mathbf{T}), (7) with p = 90. Another term that needs regularization is the heat source H in Eq. II . In fact, assuming spatially uniform power dissipation, each chiplet is assigned a 3D box function, which is not differentiable. Fig. 2: (a) Sketch depicting two connected chiplets and their parameters. (b) Example pf spatial power density distribution associated with a set of chiplets. (c) The initial chiplets configuration for the optimization problem from Eq. 13 . (d) The optimized chiplets positions. Fig. 3: (a) Temperature map for the initial configuration (Case 1), comprising four high-bandwidth and four compute units. The peak temperature is 85.98°C. (b) Temperature distribution for the case where the maximum temperature is minimized without HPWL constraint (Case 2), with a peak of 75.44°C. (c) The configuration that minimizes the HPWL while keeping the temperaturte below 82°C (Case 3). The peak temperature is 80.81°C. The key idea is to smooth out this box function along the xy plane, while keeping the discontinuity along z , where differentiability is not needed. The first step is to express the heat source as \displaystyle H(x,y,z)=\mathcal{H}^{z}(2|z-z_{c}|/L^{z})\times \displaystyle\sum_{i}H_{i}\mathcal{H}^{\parallel}(2|x-x_{i}|/L_{x}^{i},2|y-y_{i}|/L_{y}^{i}), (8) where \mathcal{H}^{\parallel} and \mathcal{H}^{z} , are the in-plane 2D and out-of-plane 2D Heaviside functions. The term z_{c} is the midpoint in the z direction of the chiplets. Next, we regularize the in-plane Heaviside functions with \displaystyle\Theta_{i}(x,y)=\frac{1}{4}\left[\tanh\left({\alpha|x_{i}-x|-\alpha L^{x}_{i}/2}\right)+1\right]\times \displaystyle\times\left[\tanh\left(\alpha{|y_{i}-y|-\alpha L^{y}_{i}/2}\right)+1\right], (9) where \alpha=1 is a smoothing parameter. An example of power dissipation map is shown in Fig. 1 -b. A similar regularization approach is applied to the space-dependent thermal conductivity. Specifically, each movable block is composed of a microbump layer, a die and a thermal material interface. Their corresponding thermal conductivity distributions need to be differentiable along the xy -plane. Let’s refer to the thickness, the midpoint in their z direction, and thermal conductivity of each of these three layers as t_{l} , z_{l} and \kappa_{l} , respectively, with l=0,1,2 . Then, the space-dependent thermal conductivity is \displaystyle\kappa(x,y,z)=\kappa_{B}(x,y,z)+\sum_{i=0}^{N_{c}-1}\Theta_{i}(x,y)\times \displaystyle\times\sum_{l=0}^{2}(\kappa_{l}-\kappa_{\mathrm{air}})\mathcal{H}^{z}(2|z-z_{l}|/t_{l}), (10) where \kappa_{B} is the thermal conductivity of the fixed part of the simulation domain; as this term also includes the air enclosed by the lid, in Eq. III , we subtract \kappa_{\mathrm{air}} from \kappa_{l} . IV non-overlap constraint During optimization, chiplets may overlap; to avoid such a scenario, we introduce an inequality constraint based on the following rationale: Suppose we have a 2D function that is 1 only at the chiplet locations and zero elsewhere, the maximum of such a function becomes larger than one when overlap occurs. To make such a constraint differentiable, we combine two concepts discussed in the last section. First, we build the smooth 2D function f(x,y)=\sum_{i=0}^{N_{c}-1}\Theta_{i}(x,y), (11) and then compute the maximum value as \textrm{p-norm}(f) . The non-inequality constraint is g_{0}(\mathbf{p})=\left[\frac{1}{N}\sum_{k=0}^{N-1}f_{k}^{p}\right]^{1/p}-1\leq 0. (12) with p=90 . Note that we used the discretized version of f , given by f_{k}=f(x_{k},y_{k}) . To validate this approach, we solve the following optimization problem \min_{\mathbf{p}}g_{0}(\mathbf{p}). (13) Throughout this work, as an optimizer, we choose the Method of Moving Asymptotes (MMA) [ 21 ] . The starting guess, shown in Fig. 2 -c, is a set of partially overlapped chips. As illustrated in Fig. 2 -d after roughly 20 iterations, the chiplets do indeed spread zeroing the overlap. V Results We first consider the configuration shown in Fig. 1 a, where the regularized (from Eq. II ) and the real HPWL are 92 and 103.1 mm, respectively (Tab. IV ). We refer to this scenario as “Case 1.” The temperature map, shown in Fig. 3 a, is higher in the central area, where the high-power blocks (compute units) are located. The peak value is 85.98°C, while the regularized one, computed by Eq. 7 , is 81.20°C. For comparison, we also compute the temperature map with ANSYS , which predicts a temperature peak of 86.85°C, falling within 1% error. Next, to test the optimization algorithm, we minimize the peak temperature while avoiding chiplet overlap (Case 2). The first guess is given by the configuration in Fig. 1 a. The optimization algorithm is \displaystyle\min_{\mathbf{p}}\text{p-norm}(\mathbf{T}) (14) \displaystyle\textrm{s.t.}\,\,\,\mathbf{T}=\mathbf{A}^{-1}\mathbf{b} (15) \displaystyle\textrm{s.t.}\,\,\,g_{0}(\mathbf{p})\leq 0. (16) As illustrated in Fig. 4 a, the real maximum temperature decreases by approximately 10°C over 30 iterations, reaching a peak temperature of 75.44°C. In the final arrangement depicted in Fig. 3 b, the chiplets are positioned near the border, with compute units spaced farther apart. This layout is expected, as components with higher power tend to be more susceptible to thermal crosstalk. We note that the final layout maintains the symmetry of the initial guess since the convective boundary condition applied at the top surface is applied uniformly. The regularized temperature, also shown in Fig. 4 a, remains consistently lower by about 5°C, closely mirroring the trend of the actual temperature. This observation corroborates the effectiveness of using the p-norm as a representation of the maximum temperature. For this configuration, ANSYS predicts a peak temperature of 76.33°C, which, again, is within 1% error. Fig. 4: (a) The evolution of the p-norm and real maximum temperature for Case 2, where there is no constraint on the HPWL. The two quantities follow the same trend and are consistently about 5°C apart, corroborating the use of the pnorm as a proxy for the maximum temperature (b) The evolution of the non-overlap constraint g_{0} from Eq. 12 . It follows closely its real counterpart. Solver Case 1 Case 2 Case 3 [C°] [C°] [C°] DiffChip (p-norm) 81.20 70.77 76.28 DiffChip (real) 85.98 75.44 80.81 ANSYS 86.85 76.33 81.67 TABLE III: Peak Temperatures for different cases. HPWL Case 1 Case 2 Case 3 [mm] [mm] [mm] Softmax 92 203.5 120.8 Real 103.1 209.2 128.6 TABLE IV: The half-permimeter wirelength (HPWL) for different cases. Chiplet Case 1 Case 2 Case 3 ( x , y ) ( x , y ) ( x , y ) [mm] [mm] [mm] H 1 (-7,16) (-8.93,20.) (-10.21,20.) H 2 (7,16) (8.93,20.) (10.21,20) H 3 (-7,-16) (-8.93,-20) (-10.21,-20) H 4 (7,-16) (8.93,-20) (10.21,-20) C 1 (-7,5) (-19.9, 15.83) (-9.07, 6.85) C 2 (7,5) (19.9, 15.83) (9.07, 6.85) C 3 (-7,-5) (-19.9 ,-15.83) (-9.07,-6.85) C 4 (7,-5) (19.9 ,-15.83) (9.07,-6.85) TABLE V: Chiplet layout for different cases. Fig. 5: (a) The evolution of the HPWL (both the real and the regularized one). It increases as the optimization progresses in order to accomodate the constraint on the maximum temperature. (b) Trajectory of the maximum temperature. At convergence, the regularized temperature falls below T_{th} =75°C (c) The evolution of the nonoverlap constraint. After an initial phase, where it is violated, both the real and the regularized constraint approche zero. i.e. the constraint it satisfied. The evolution of the nonoverlap constraint, as depicted in Fig. 4 b, is oscillatory. This indicates that the optimizer can rapidly reposition chiplets to reduce overlap without substantially affecting the cost function. However, this is not the case when minimizing the HPWL, as will be discussed later. Since in this case there is no constraint on the HPWL, its final value is as large as 209.2 mm, with the regularized counterpart being 203.5 mm. Finally, as illustrated in Fig. 4 b, the regularized nonoverlap constraint closely matches its nondifferentiable counterparts, achieved by substituting the p-norm with the maximum value in Eq. 12 . As the last example (Case 3), we consider the case where HPWL is minimized while constraining the p-norm temperature below a threshold, and ensuring no overlap. Supposed we want to maintain the peak temperature below 82 °C. From Case 2, we noted that there is a gap of about 5°C between the real and regularized peak temperature. Thus, we set T_{th} = 77°C. The corresponding algorithm reads \displaystyle\min_{\mathbf{p}}\textrm{HPWL} (17) \displaystyle\textrm{s.t.}\,\,\,\mathbf{T}=\mathbf{A}^{-1}\mathbf{b} \displaystyle\textrm{s.t.}\,\,\,\textrm{p-norm}(\mathbf{T})-T_{th}\leq 0 \displaystyle\textrm{s.t.}\,\,\,g_{0}(\mathbf{p})\leq 0. Remarkably, this optimization converges in fewer than 15 iterations. The final configuration, depicted in Fig. 3 c, maintains the symmetry of the first guess, analogously to Case 2. The optimization finds a balance between two contrasting needs: Minimizing the maximum temperature requires chiplets to be spaced apart, while minimizing the HPWL necessitates closer packing of the dies. This trend is illustrated in Fig. 5 a and b, where the HPWL increases and the maximum regularized temperature decreases until it falls below T_{th} , stabilizing around 76.28°C