Unsupervised Learning for Combinatorial Optimization with Principled Objective Relaxation
Abstract
Using machine learning to solve combinatorial optimization (CO) problems is challenging, especially when the data is unlabeled.
This work proposes an unsupervised learning framework for CO problems.
Our framework follows a standard relaxation-plus-rounding approach and adopts neural networks to parameterize the relaxed solutions so that simple back-propagation can train the model end-toend.
Our key contribution is the observation that if the relaxed objective satisfies entry-wise concavity, a low optimization loss guarantees the quality of the final integral solutions.
This observation significantly broadens the applicability of the previous framework inspired by Erd ˝ os’ probabilistic method [1].
In particular, this observation can guide the design of objective models in applications where the objectives are not given explicitly while requiring being modeled in prior.
We evaluate our framework by solving a synthetic graph optimization problem, and two real-world applications including resource allocation in circuit design and approximate computing.
Our framework 1 largely outperforms the baselines based on naïve relaxation, reinforcement learning, and Gumbel-softmax tricks.
Introduction
Combinatorial optimization (CO) with the goal of finding the optimal solution from a discrete space is a fundamental problem in many scientific and engineering applications [2–4].
Most CO problems are
NP-complete.
Traditional methods efficient in practice often either depend on heuristics or produce approximation solutions.
Designing these approaches requires considerable insights into the problem.
Recently machine learning has paved a new way to develop CO algorithms, which asks to use neural networks (NNs) to extract heuristics from the data [5–7].
Several learning for CO (LCO) approaches have therefore been developed, providing solvers for the problems including SAT [8–10], mixed integer linear programming [11–13], vertex covering [14,15] and routing problems [16–23].
Another promising way to use machine learning techniques is to learn proxies of the CO objectives whose evaluation could be expensive and time-consuming [24–27].
For example, to optimize hardware/system design, evaluating the objectives such as computation latency, power efficiency [28], and resource consumption [29–31] requires running complex simulators.
Also, in molecule design, evaluating the objective properties such as protein fluorescence or DNA binding affinity needs either costly simulations or living experiments [32–34].
In these cases, proxies of the objectives can be learned first to reduce the evaluation cost [31], and then optimize these proxies to solve the design problems.
Later, we name the CO problem with proxy objectives as Proxy-based CO (PCO) problems.
[Figure]
Example: Our Principle:
[Figure]
The landscapes of the relaxed
[Figure]
Moreover, we claim that learning for PCO is often of greater significance than learning for traditional
CO problems because commercial CO solvers such as Gurobi cannot applied in PCO due to the missing closed-form objectives and the lack of heuristics for such proxy objectives.
Generic solvers such as simulated annealing [35] may be applied while they are extremely slow.
In this work we propose an unsupervised LCO framework.
Our findings are applied to general
CO problems while exhibiting extraordinary promise for PCO problems.
Unsupervised LCO has recently attracted great attentions [1,9,20,36,37] due to its several great advantages.
Traditional supervised learning often gets criticized for the dependence on huge amounts of labeled data [38].
Reinforcement learning (RL) on the other hand suffers from notoriously unstable training [39].
In contrast, unsupervised LCO is superior in its faster training, good generalization, and strong capability of dealing with large-scale problems [1].
Moreover, unsupervised learning has never been systematically investigated for PCO problems.
Previous works for PCO problems, e.g., hardware design [30, 31], were all based on RL.
A systematic unsupervised learning framework for PCO problems is still under development.
Our framework follows a relaxation-plus-rounding approach.
We optimize a carefully-designed continuous relaxation of the cost model (penalized with constraints if any) and obtain a soft solution.
Then, we decode the soft assignment to have the final discrete solution.
This follows a common approach to design an approximation algorithm [40,41].
However, the soft assignment here is given by a NN model optimized based on the historical (unlabeled) data via gradient descent.
Note that learning from historical data is expected to facilitate the model understanding the data distribution, which helps with extracting heuristics, avoiding local minima and achieving fast inference.
An illustration of our principle with a toy-example is shown in Fig.
We also provide the pipeline to empirically evaluate our relaxation-plus-rounding principle in Fig.
Our method shares a similar spirit with [1] while making the following significant contributions.
We abandon the probabilistic guarantee in [1], because it is hard to use for general CO objectives, especially those based on proxies.
Instead, we design a deterministic objective relaxation principle that gives performance guarantee.
We prove that if the objective relaxation is entry-wise concave w.r.t.
the binary optimization variables, a low-cost soft solution plus deterministic sequential decoding guarantees generating a valid and low-cost integral solution.
This principle significantly broadens the applicability of this unsupervised learning framework.
In particular, it guides the design of model architectures to learn the objectives in PCO problems.
We also justify the wide applicability of the entry-wise concave principle in both theory and practice.
We evaluate our framework over three PCO applications including feature-based edge covering & node matching problems, and two real-world applications, including imprecise functional unit assignment in approximate computing (AxC) [42–46] and resource allocation in circuit design [24,30].
In all three applications, our framework achieves a significant performance boost compared to previous
RL-based approaches and relaxed gradient approaches based on the Gumbel-softmax trick [47–49].
The datasets for these applications are also provided in our github repository.
1.1 Further Discussion on Related Works
Most previous LCO approaches are based on RL [13,14,16–18,22,50–52] or supervised learning [11, 12, 38], as these two frameworks do not hold any special requirements on the formulation of CO problems.
However, they often suffer from the issues of training instability and subpar generalization.
Previous works on unsupervised learning for CO have studied satisfaction problems [9, 36, 53].
Applying these approaches to general CO problems requires problem reductions.
Others have considered max-cut [37] and TSP problems [20], while these works depend on carefully selected problem-specific objectives.
The work most relevant to ours is [1] and we give detailed comparison in Sec. 3.
Note that all previous works on unsupervised learning for CO do not apply to PCO as they need an explicit objective to manipulate.
For PCO problems, previous studies focus on how to learn more generalizable proxies of the objectives, such as via Bayesian learning [54,55] and adverserial training [56,57].
Once proxies are learned, direct objective relaxation plus gradient descent [56], or
RL [30,31], or general MIP solvers with reformulations of the objectives [58,59] have been often adopted.
Studying generalization of proxies is out of the scope of this work while we conjecture that our suggested entry-wise concave proxies seem smoother than those without constraints (See Fig. 1) and thus have the potential to achieve better generalization.
Preliminaries and Problem Formulation
In this section, we define several useful concepts and notations.
Combinatorial Optimization (CO).
Let C ∈ C denote a data-based configuration such as a graph with weighted edges.
Let Ω be a finite set of all feasible combinatorial objects and each object has a binary vector embedding X
=
( X i ) 1 ≤ i ≤ n ∈ { 0 , 1 } n .
For example, in the node matching problem, each entry of X corresponds to an edge to denote whether this edge is selected or not.
Note that such binary embeddings are applicable even when the choice is not naturally binary:
Choosing at most one element from a tuple (1 , 2 , 3) can be represented as a 3-dim binary vector ( X 1 , X 2 , X 3 ) with the constraint X 1 + X 2 + X 3 ≤ 1 .
W.l.o.g, we assume an algebraic form of the feasible set Ω ≜ { X ∈ { 0 , 1 } n : g ( X ; C ) < 1 } where g ( X ; C ) ≥ 0 for all X ∈ { 0 , 1 } n 2 .
For notational simplicity, we only consider one inequality constraint while our later discussion in Sec.
and our case studies in Sec.
5 may contain multiple inequalities.
Given a configuration C and a constraint Ω , a combinatorial optimization (CO) is to minimize a cost f ( · ; C ) by solving
[Equation]
Proxy-based CO (PCO).
In the many applications, the cost or the constraint may not be cheaply evaluated.
Some proxies of the cost f or the constraint g often need to be learned from the historical data.
With some abuse of notations, we interchangably use f ( g , resp.) to denote the objective (the constraint, resp.) and its proxy.
Learning for CO/PCO (LCO).
A LCO problem is to learn an algorithm A θ ( · ) :
C → { 0 , 1 } n , say a neural network (NN) parameterized by θ to solve CO or PCO problems.
Given a configuration
C ∈ C , we expect A θ to (a) generate a valid solution ˆ X =
A θ ( C ) ∈ Ω and (b) minimize f ( ˆ X ; C ) .
There are different approaches to learn A θ .
Our focus is unsupervised learning approaches where given a configuration C , no ground-truth solution X ∗ is used during the training.
θ can only be optimized just based on the knowledge of the cost and the constraint, or their proxies.
Note that in this work, for PCO problems, the proxies are assumed to be trained based on ground-truth values of f ( X ; C ) given different ( X, C ) pairs, which is supervised.
Unsupervised learning in this work refers to the way to learn A θ ( C ) .
Erd˝os’ Probabilistic Method (EPM).
The EPM has recently been brought for LCO [1].
Specifically, The EPM formulates A θ ( C ) as a randomized algorithm that essentially gives a probabilistic distribution over the solution space { 0 , 1 } n , which solves the optimization problem: min θ
E [ l ( X ; C )] , where l ( X ; C ) ≜ f ( X ; C ) + β 1 g ( X ; C ) ≥ 1 , X ∼ A θ ( C ) and β > 0 .
Karalias & Loukas proved that with β > max X ∈ Ω f ( X ; C ) and a small expected loss E [ l ( X, C )] < β , sampling a sufficiently large number of ˆ X ∼ A θ ( C ) guarantees the existance of a feasible ˆ X ∈ Ω that achieves the cost f
( ˆ X ; C ) ≤ E [ l ( X, C )]
Although this guarantee makes EPM intriguing, applying EPM in practice is non-trivial.
We will explain the challenge in Sec. 3.1, which inspires our solutions and further guides the objective design for general CO and PCO problems.
The Relaxation Principle for Unsupervised LCO
In this section, we start with the practical issues of EPM.
Then, we introduce our solutions by proposing a relaxation principle of the objectives, which gives performance guarantee for general practical unsupervised LCO.
3.1 Motivation: The Practical Issues of EPM
Applying EPM in practice has two fundamental difficulties.
First, optimizing θ in Eq.(2) is generally hard as the gradient dXdθ (note here each entry of X is binary) may not exist so the chain rule cannot be used.
We discuss the potential solutions to this problem in Sec. 3.4.
Second, EPM needs to sample a large number of X ∼ A θ ( C ) for evaluation to achieve the performance guarantee in [1].
This is not acceptable where the evaluation per sample is time-consuming and expensive.
So, in practice, Karalias & Loukas consider a deterministic method.
They view A θ ( C ) ∈ [0 , 1] n as the parameters of Bernouli distributions to generate the entries of X so E
[ X ]
=
A θ ( C ) .
First, they optimize min θ l
( A θ ( C ) , C ) instead of min
θ E
[ l ( X, C )] , and then, sequentially round the probability
A θ ( C ) to discrete X ∈ { 0 , 1 } n by comparing conditional expectations, e.g., E [ l ( X, C ) | X 1 = 0] v.s. E [ l ( X, C ) |
X 1 = 1] to decide X 1 .
However, such conditional expectations cannot be efficiently computed unless one uses Monte-Carlo sampling or l has special structures as used in the two case studies in [1], i.e., max-clique and graph-partition problems.
However, what special structures are needed has not been defined, which blocks the applicability of this framework to general CO problems, especially for the PCO problems where the objectives l are learned as models.
3.2 Our Approach: Relaxation plus Rounding, and Performance Guarantee
Our solution does not use the probabilistic modeling but directly adopts a relaxation-plus-rounding approach.
We optimize a relaxation of the objective l r and obtain a soft solution ¯ X ∈ [0 , 1] n .
Then, we deterministically round the entries in ¯ X to a solution X in the discrete space { 0 , 1 } n .
Note that throughout the paper, we use ¯ X to denote a soft solution and X to denote a discrete solution.
The question is whether the obtained solution may still achieve the guarantee as EPM does.
Our key observation is that such success essentially depends on how to relax the objective l .
Therefore, our first contribution beyond [1] is to propose the principle (Def. 2) to relax general costs and constraints.
With this principle, the unsupervised LCO framework can deterministically yield valid and low-cost solutions (Thm. 1) as the EPM guarantees, and is applied to any objective l .
First, we introduce the pipeline.
Consider a relaxation of a deterministic upper bound of Eq.(2):
[Equation]
+
[Equation]
( ¯ X ; C ) , where ¯ X =
A θ ( C ) ∈ [0 , 1] n , β > 0 .
Here f r ( · ; C ) : [0 , 1] n → R is the relaxation of f ( · ; C ) , which satisfies f r ( X ; C )
=
f
( X ; C ) for
X ∈ { 0 , 1 } n .
The relation between the constraint g and its relaxation g r is similar, i.e., g r ( X ; C )
=
g ( X ; C ) for X ∈ { 0 , 1 } n .
Here, we also use the fact that g r ( X ; C ) provides a natural upper bound 1 g ( X ; C ) ≥ 1 ≤ g r ( X ; C ) for X ∈ { 0 , 1 } n given the normalization of g ( X ; C ) adopted in Sec. 2.
Now, suppose the parameter θ gets optimized so that l r ( θ ; C ) is small.
Further, we adopt the sequential rounding in Def. 1 to adjust the continuous solution ¯ X
=
A θ ( C ) to discrete solution X .
Definition 1 (Rounding) .
Given a continuous vector ¯ X ∈ [0 , 1] n and an arbitrary order of the entries, w.o.l.g., i = 1 , 2 , ..., n , round ¯ X i into 0 or 1 and fix all the other variables un-changed.
Set
X i = arg
min j =0 , 1 f r ( X 1 , ...,
X i − 1 , j, ¯ X i +1 , ..., ¯ X n ; C )
+ βg r
( X 1 , ..., X i − 1 , j, ¯ X
i +1 , ..., ¯ X n ; C ) , replace ¯
X
i with X i and repeat the above procedure until all the variables become discrete.
Note that our rounding procedure does not need to evaluate any conditional expectations
E [ l ( X ; C ) | X 1 ] which EPM in [1] requires.
Instead, we ask both relaxations f r and g r to satisfy the principle in Def. 2.
With this principle, the pipeline allows achieving a valid and low-cost solution X , as proved in Theorem 1.
We leave the proof in Appendix A.1.
Definition 2 (The Entry-wise Concave Principle) .
For any C ∈ C , h r ( · ; C ) : [0 , 1] n → R is entry-wise concave if for any γ ∈ [0 , 1] and any ¯ X, ¯ X ′ ∈ [0 , 1] n that are only different in one entry,
[Equation]
Note that entry-wise concavity is much weaker than concavity.
For example, the function
[Equation]
is entry-wise concave but not concave.
Theorem 1 (Performance Guarantee) .
Let β > max X ∈ Ω f
( X ; C ) and min X ∈ Ω f
( X ; C ) ≥ 0 in
Eq.
Suppose the relaxed cost f r and constraint g r are entry-wise concave, and the learned parameter θ achieves l r ( θ ; C ) < β .
Then, rounding (Def. 1) the relaxed solution ¯ X =
A θ ( C ) generates a valid discrete solution X ∈ Ω such that f ( X ; C ) <
l r ( θ ; C ) .
When there are multiple constraints g ( j ) ( X ; C ) < 1 for j = 1 , 2 , ... , we may use relaxation β (cid:80) j g ( j ) r ( X ; C ) as the penalty term in Eq.(3), where g ( j ) r is a relaxation of g ( j ) .
It can be shown that if (cid:80) j g ( j ) r satisfies the condition of entry-wise concavity, the guarantee of Thm. 1 still applies.
3.3 The Wide Applicability of Entry-wise Concave Relaxations
We have introduced the entry-wise concave principle to relax the objective to associate our framework with performance guarantee.
The question is how widely applicable this principle could be.
Actually, every function with binary inputs can be relaxed as an entry-wise affine (also called multilinear) function with the exactly same values at the discrete inputs, as shown in Theorem 2.
Note that entry-wise affinity is a special case of entry-wise concavity.
In Sec. 5, we will provide the design of
NN architecture (for PCO) and math derivation (for CO) that guarantee formulating an entry-wise concave function.
Note that the objectives for max-clique and graph-partition problems used in [1] are essentially entry-wise affine.
Theorem 2 (Wide Applicability) .
For any binary-input function h ( · ) : { 0 , 1 } n → R , there exists a relaxation h r ( · ) :
[0 , 1] n → R such that (a) h r ( X )
=
h ( X ) for X ∈ { 0 , 1 } n and (b) h r is entry-wise affine, i.e., for any γ ∈ [0 , 1] and any ¯ X, ¯ X ′ ∈ [0 , 1] n that are only different in one entry,
[Equation]
Proof sketch.
Set h r ( ¯ X )
= (cid:80) X ∈{ 0 , 1 } n h ( X ) (cid:81) nj =1 ¯ X X
j j (1 − ¯ X j ) (1 − X j ) , which satisfies (a) and (b).
Note that we suppose that ¯ X
j = 1 for any ¯ X j ∈ [0 , 1] .
The detailed proof is in Appendix A.2.
Although Theorem 2 shows the existence of entry-wise affine relaxations, the constructed representation in the proof depends on higher-order moments of the input entries, which make it hard to be implemented by a model, say a NN architecture.
However, we claim that using entry-wise concave functions is able to implicitly generate higher-order moments via representations based on low-order moments.
For example, when n = 2 , we could use the composition of − Relu ( · ) and affine operators (only 1st-order moments) to achieve universal representation (See Prop. 1 and the proof in
Appendix A.3).
For general n , we leave as a future study.
Proposition 1.
For any binary-input function h ( X 1 , X 2 ) , there exists parameters { w ij } such that an entry-wise concave function h r ( ¯ X 1 , ¯ X 2 ) =
w 00 − (cid:80)
i =1 Relu ( w i 1 ¯ X 1 + w i 2 ¯ X 2 + w i 0 ) satisfies h r ( X 1 , X 2 )
=
h ( X 1 , X 2 ) for any X 1 , X 2 ∈ { 0 , 1 } .
3.4 Discussion: Methods to Directly Optimize the Randomized Objective in EPM Eq. (2)
The naïve way to optimize the randomized objective in Eq.(2) without worrying about the specific form of the objective l is based on the policy gradient in RL via the logarithmic trick, i.e., estimating the gradient dldθ via ( f ( X ; C )+ β 1 g
( X ; C ) ≥ 1 ) log P ( X ) by sampling X ∼ A θ ( C ) .
However, the policy gradient suffers from notoriously large variance [39] and makes RL hard to converge.
Therefore, methods such as actor critic [60] or subtracting some baselines l ( X ; C ) − b [61] have been proposed.
Label of
Label of entry-wise concave/affine proxy ...
Random Sampling
Supervised Training ...
Proxy Relaxation in PCO Problems
C 1 , X
C n , X n
Explicitly Write entry-wiseconcave/affineproxy
Proxy Relaxation in CO problems
Randomly Sampled configurations ...
C
C n
Unsupervised Training with Loss:
C'
A Testing Instance
C'
Relaxed Solution Rounding
C'
Discrete Solution
Training
Testing
C
[Figure]
Another way to solve Eq.(2) is based on reparameterization tricks to reduce the variance of gradients [62,63].
Specifically, we set the entries of output ¯ X
=
A θ ( C ) ∈ [0 , 1] n as the parameters of Bernoulli distributions to generate X , i.e., X i ∼ Bern ( ¯ X i ) , for 1 ≤ i ≤ n .
To make dX i /d
¯ X i computable, we may use the Gumble-softmax trick [47–49].
However, this approach suffers from two issues.
First, the estimation of the gradient is biased.
Second, as
A θ ( C ) is essentially a randomized algorithm, sampling sufficiently many X ∼ A θ ( C ) is needed to guarantee a valid and low-cost solution.
However, such evaluation is costly as discussed in Sec. 3.1.
So, empirically, we can also compare A θ ( C ) with a threshold to determine X , which does not have performance guarantee.
We compare different aspects of RL, Gumbel-softmax tricks and our relaxation approach in Table 1.
Applying Our Relaxation Principle to Learning for CO
[Table]
[Table] [Table]
First, we test our relaxation principle in a learning for CO (max clique) task, where we can explicitly write both the cost functions and the constraints into an entry-wise affine form.
In this case, our framework and EPM [1] share the same pipeline, though the relaxation principle and the deterministic performance guarantee are firstly proposed in this work.
The entry-wise affine objective relaxation of the max clique is − ( β + 1) (cid:80) ( i,
j ) ∈
E ¯
X
i ¯ X j + β 2 (cid:80) i ̸
=
j ¯ X i ¯ X j .
Here, we use a real-world dataset (Twitter [64]) and a synthetic dataset (RBtest [1]), and show the experiment results in Table.
We follow the settings in [1] and use a 6:2:2 dataset split for training, validating and testing, each test instance runs within 8 seeds.
Our entry-wise affine pipeline achieves almost the same performance as EPM.
To show the importance of the relaxation principle, we also propose ‘Badloss+R’.
This baseline imposes trigonometric functions to the original entry-wise affine functions f ′ r ( ¯ X ; C ) =
f r (sin(9 π ¯ X/ 2); C ) , g ′ r ( ¯ X ; C ) =
g r (sin(9 π ¯ X/ 2); C ) , where sin( · ) operates on each entry of the input vector.
Note that the relaxed functions also match the original objectives at discrete points, i.e., f ′ r
( X ; C ) =
f r ( X ; C ) =
f
( X ; C ) when X ∈ { 0 , 1 } , while with different relaxations.
The poor performance of ‘Badloss+R’ reveals the importance of our principle for relaxation.
Applying Our Relaxation Principle to Learning for PCO
In this section, we apply our relaxation principle to three PCO applications: (I) feature-based edge covering & node matching, (II) resource allocation in circuit design, and (III) imprecise functional unit assignment in approximate computing.
All the applications have graph-based configurations C .
So later, we first introduce how to use graph neural networks (GNNs) to build proxies that satisfy our relaxation principle.
Such GNN-based proxies will be used as the cost function relaxation f r in all the applications.
Our principle can also guide the relaxation of explicit CO objectives.
The constraints in applications (I)(III) are explicit and their relaxation can be written into the entry-wise affine form.
The constraint in (II) needs another GNN-based entry-wise concave proxy to learn.
5.1 GNN-based Entry-wise Concave Proxies
We consider the data configuration C as an attributed graph ( V, E, Z ) where V is the node set,
E ⊆
V × V is the edge set and Z is the node attributes.
We associate each node with a binary variable and group them together X : ∈ { 0 , 1 } | V | .
where for each v ∈ V , X v = 1 indicates the choice of the node v .
Note that our approach can be similarly applied to edge-level variables (see Appendix C.3), which is used in application (I).
Let ¯ X still denote the relaxation of X .
To learn a discrete function h : { 0 , 1 } | V | × C
→ R , we adopt a GNN as the relaxed proxy of h .
We first define a latent graph representation in R F whose entries are all entry-wise affine mappings of X .
Latent representation:
[Equation]
where W is the graph representation, U v ’s are node representations and Q v,u are edge representations.
These representations do not contain X and are given by GNN encoding C .
Here, we consider at most 2nd-order moments based on adjacent nodes as they can be easily implemented via current
GNN platforms [65,66].
Then, we use ϕ to generate entry-wise affine & concave proxies as follows.
Entry-wise Affine Proxy (AFF):
[Equation]
Entry-wise Concave Proxy (CON):
[Equation]
where w a , w c ∈ R F , b ∈ R are learnt parameters and w c ≥ 0 guarantees entry-wise concavity.
Other ways to implement GNN-based entry-wise concave proxies are also introduced in Appendix C.1.
5.2 The Setting up of the Experiments
[Table]
Training & Evaluation Pipeline.
In all the applications, we adopt the following training & evaluation pipeline.
First, we have a set of observed configurations D 1 ⊂ C .
Each C ∈ D 1 is paired with one X ∈ { 0 , 1 } n .
We use the costs f ( X, C ) (and constraints g ( X, C ) ) to train the relaxed proxies f r ( X, C ) (and g r ( X, C ) , if cannot be derived explicitly), where the relaxed proxies follow either Eq.(5) (named AFF) or Eq.(6) (named
CON).
Then, we parameterize the LCO algorithm
A θ ( C ) ∈ [0 , 1] n via another GNN.
Based on the learned (or derived) f r and g r , we optimize θ by minimizing (cid:80)
C ∈D 1 l r ( θ ; C ) , where l r is defined according to Eq.(3).
We will split D 1 into a training set and a validation set for hyperparameter-tuning of both proxies and A θ .
We have another set of configurations D 2 ⊂ C used for testing.
For each C ∈ D 2 , we use the relaxation ¯ X
=
A θ ( C ) plus our rounding to evaluate the learned algorithm
A θ ( · ) .
We follow [1] and do not consider fine-tuning
A θ over the testing dataset D 2 to match the potential requirement of the fast inference.
Baselines.
We consider 4 common baselines that is made up of different learnable relaxed proxies f r , g r , algorithms A θ and inference approaches as shown in Table 3.
For the proxies f r , g r for baselines, we apply GNNs without the entry-wise concave constraint and use X as one node attribute while keeping all other hyper-parameters exactly the same as CON other than the way to deal with the discrete variables to make fair comparison (See details in Appendix. C);
For the algorithm A θ , we provide the Gumbel-softmax trick based methods (GS-Tr) [48, 49], the actor-critic-based RL method [60] (RL) and the naïve relaxation method (Naïve); For the inference approaches, we consider
Monte Carlo sampling (S) and our proposed rounding (R) procedure.
Although the baselines adopt proxies that are different from ours, we guarantee that their proxies approximate the ground-truth
A plain picture
[Figure]
f, g over the validation dataset at least no worse than ours.
In application II, we also consider two non-learnable algorithms to optimize the proxies without relaxation constraints, simulated annealing (SA) [35] and genetic algorithms (GA) [67,68].
In application III, we put all of the required AxC units either close to the input (C-In) or close to the output (C-Out) of the approximating computing circuit as additional baselines.
More details of the experiments setups and hyperparameter tuning can be found in Appendix C. We also obtain the optimal solutions (OPT) for applications I and III via brute-force search for comparison.
5.3 Application I: Feature-based Edge Covering & Node Matching in Graphs
This application is inspired by [69].
Here, each configuration C is a 4 × 4 grid graph whose node attributes are two-digit images generated by random combinations of the pictures in MNIST [70].
We associated each edge with variables X ∈ { 0 , 1 } | E | .
The objective is the sum of edge weights f
( X ; C )
= (cid:80) e
∈ E w e
X
e where w e is unknown in prior and needed to be learned.
The ground truth of w e is a multiplication of the numbers indicated by the images on the two adjacent nodes.
We adopt
ResNet-50 [71] (to refine node features) plus GraphSAGE [72] to encode C .
We consider using both
Eq.(5) and Eq.(6) to formulate the relaxed cost f r ( ¯ X ; C ) .
Training and validating f r are based on 100k randomly sampled C paired with randomly sampled X .
Note that 100k is much smaller than the entire space { 0 , 1 }
| E | × C is of size 2 24 × 100 16 .
Next, as the constraint here is explicit, we can derive the relaxation of the constraints for this application.
First, the constraint relaxation of the edge covering problem can be written as
Edge Covering Constraint
[Equation]
Each production term in Eq.(7) indicates that for each node, at least one edge is selected.
We can easily justify that g r is entry-wise affine and Ω = { X ∈ { 0 , 1 } | E | : g r ( X ; C ) < 1 } exactly gives the feasible solutions to the edge covering problem.
Similarly, we can derive the constraint for node matching by adding a further term to Eq.(7).
Node Matching Constraint
[Equation]
Here, the second term indicates that no two edges adjacent to the same node can be selected.
This is a case with two constraints while we combine them together.
We can easily justify that g r is entry-wise affine and Ω = { X ∈ { 0 , 1 } | E | : g r ( X ; C ) < 1 } groups exactly the feasible solutions to the node matching problem.
Note that our above derivation also generalizes the node-selection framework in [1] to edge selection.
With the learned f r and the derived g r , we further train and validate A θ over the 100k sampled ( X, C ) ’s and test on another 500 randomly sampled C ’s. Method
[Table]
Naive
[Table]
GS
[Table]
+
[Table] [Table]
- GS
[Table]
+
[Table]
Evaluation.
Table 4 shows the evaluation results.
In the
GS-Tr+S method, the number of sampling is set to(about 2 .
5 times the inference time of our deterministic rounding).
Note that for node matching, GS-Tr+S could hardly sample a feasible node matching solution within 120 samples.
The experiment results show that our principled proxy relaxation exceeds the other baselines on both tasks.
Also, we observe that AFF outperforms
CON, which results from the fact that f ( X ; C ) in these two problems are naturally in entry-wise affine forms
[Figure]
with low-order (1st-order) moments.
One instance of node matching randomly selected from the test set is shown in Fig.
More visualization results can be found in Fig.
6 in the appendix.
5.4 Application II: Resource Allocation in Circuit Design
Resource allocation in field-programmable gate array (FPGA) design is a fundamental problem which can lead to largely varied circuit quality after synthesis, such as area, timing, and latency.
In this application, we follow the problem formulation in [24,30], where the circuit is represented as a data flow graph (DFG), and each node represents an arithmetic operation such as multiplication or addition.
The goal is to find a resource allocation for each node to be either digital signal processor (DSP) or look-up table (LUT), such that the final circuit area (i.e., actual DSP and LUT usage) after synthesis is minimized.
Notably, different allocation solutions result in greatly varied DSP/LUT usage due to complicated synthesis process, which cannot be simply summed up over each node.
To obtain precise
DSP/LUT usage
, one must run high-level synthesis (HLS) [73] and place-and-route [74] tools, which can take up to hours [24,30].
In this application, each configuration C is a DFG with > 100 nodes, where each node is allocated to either DSP or LUT.
Node attributes include operation type (i.e., multiplication or addition) and data bitwidth.
More details about the dataset can be found in Appendix C.5.
Let X ∈ { 0 , 1 } | V | denote the mapping to DSP or LUT.
Let f r and g r denote the proxies of actual LUT and actual DSP usage, respectively.
Note that given different constraints on the DSP usage, we will normalize g r as introduced in Sec.
We train and validate f r , g r , A θ on 8 , 000 instances that consist of 40 DFGs ( C ), each DFG with 200 different mappings ( X ), and test A θ over 20 DFGs.
Note that the actual
LUT and DSP usages of each training instance has been collected by running HLS in prior.
We also run HLS to evaluate the actual LUT and DSP usages for the testing cases given the learned mappings.
Evaluation.
We rank each method’s best actual LUT usage under the constraint of different percentages ( 40% - 70% ) of the maximum DSP usage in each testing instance, then calculate the averaged ranks.
Fig.
5 shows the results.
Our entry-wise concave proxy achieves the best performance.
GS-Tr+R is slightly better than RL, and both of them exceed SA and GA.
We do not include our entry-wise affine proxy in the ranking list, because the affine proxy could be much less accurate than the proxy without constraints and the entry-wise concave proxy.
The comparison between these proxies on learning DSP usage (& LUT usage) is shown in Fig.
4 (& Fig.
9 in the appendix, respectively).
The gap between different proxies indicates the FPGA circuit contains high-order moments of the input optimization variables and 2-order entry-wise affine proxy cannot model well.
We do not include the result of GS-Tr+S and Naive+R, because these methods perform poor and could hardly generate feasible solutions given a constraint of DSP usage.
We leave their results in
Table.
7 in the appendix.
Moreover, we compare the training time between different methods.
To be fair, all methods run on the same server with a Quadro RTX 6000 GPU.
The RL based optimizer takes 22 GB GRAM, while other optimizers only take 7 GB on average.
Fig.
10 in the appendix further demonstrates that our methods and GS-T methods require much less training time than RL.
Also, to give a fair comparison between learning-based approaches and traditional approaches, we implement GA with parallel (on GPU) cost-value inference for all the populations in each generation.
We set the population size as 256 , which is the same as the batch size that we used to train/infer
A θ .
The performance of GA in Fig.
5 is obtained under the condition that the inference time of the implemented parallel GA is about the same as that of our CON method.
Fig.
8 in the appendix provides more detailed comparison on the performance and the inference time between GA with different numbers of generations and our CON method.
[Table] [Table]
5.5 Application III: Imprecise Functional Unit Assignment in Approximate Computing
One fundamental problem in approximate computing (AxC) is to assign imprecise functional units (a.k.a., AxC units) to execute operations such as multiplication or addition [42–46], aiming to significantly reduce circuit energy with tolerable error.
We follow the problem formulation in [45], where given a computation graph, each node represents either multiplication or addition.
The incoming edges of a node represent its two operands.
The goal is to assign AxC units to a certain number of nodes while minimizing the expected relative error of the output of the computation graph.
In this application, each configuration C is a computation graph with 15 nodes (either multiplication or addition) that maps a vector in R 16 to R .
A fixed number θ of nodes are assigned to AxC units with produce 10% relative error.
Let X ∈ { 0 , 1 } | V | denote whether a node is assigned to an AxC unit or not; the proxy of the objective f r is the expected relative error at the output.
We use 100k ( X, C ) as the training dataset and the entire solution space is 2 15 × 2 15 .
For each ( X, C ) , the ground-truth, i.e., expected relative error, is computed by averaging 1k inputs sampled uniformly at random from [0 , 10] 16 .
The constraint g r is (cid:80) v ∈ V X v ≥ θ with normalization, where θ ∈ { 3 , 5 , 8 } .
We test the learned A θ on 500 unseen configurations.
Evaluation.
Table.
5 shows the averaged relative errors of the assignments by different methods.
The problem is far from trivial.
Intuitively, assigning AxC units closed to the output, we may expect small error.
However, C-Out performs bad.
Our proxies AFF and CON obtain comparable best results.
The MAE loss values of the two proxies are also similar, as shown in Table 9 in the appendix.
The reason is that the circuit is made up of 4 layers in total which leads to at most 4 -order moments in the objective function, which is in a medium-level complexity.
Training time is also studied for this application, resulting in the same conclusion as application II (See Table 8 in the appendix).
Conclusion
This work introduces an unsupervised end-to-end framework to resolve LCO problems based on the relaxation-plus-rounding technique.
With our entry-wise concave architecture, our framework guarantees that a low objective value could lead to qualified discrete solutions.
Our framework is particularly good at solving PCO problems where the objectives need to be modeled and learned.
Real-world applications demonstrate the superiority of our method over RL and gradient-relaxation approaches in both optimization performance and training efficiency.
In the future, we aim to further broaden our framework to the applications where the optimization variables allow using more complex embeddings than binary embeddings.
Acknowledgement
We greatly thank all the reviewers for their valuable feedback and the insightful suggestions.
H.
Wang and P. Li are partially supported by 2021 JPMorgan Faculty Award and the NSF award
OAC-2117997.
A Deferred Theoretical Arguments A.1 Proof of Theorem
We analyze the rounding process of the relaxed solution ¯ X =
A θ ( C ) , ¯ X ∈ [0 , 1] n into the integral solution ˆ X ∈ { 0 , 1 } n .
Let ¯ X i ,
ˆ X i , i = { 1 , 2 , ..., n } denote their entries respectively.
The rounding procedure has no requirement on the order of the rounding sequence, w.l.o.g, suppose we round from index i = 1 to i = n .
In practice, it might be better to sort ¯ X and round the entries according to their ranks.
We have the following inequations:
[Equation]
where (a) is due to l r ( θ ; C ) ’s entry-wise concavity w.r.t.
¯ X and Jensen’s inequality, (b) is due to the definition ˆ X 1 = arg min
j 1 = { 0 , 1 } f r
([ j 1 , ¯ X 2 , ..., ¯ X n ]; C )
+ βg r
([ j 1 , ¯ X 2 , ..., ¯ X n ]; C ) , and (c) is due to the assumption that the neural network based proxies could learn the objective and the constraints perfectly for ˆ X ∈ { 0 , 1 } n .
The inequalities above demonstrate the fact that the loss value is non-increasing via the whole rounding process.
By this, once the learnt parameter θ achieves l r ( θ ; C ) <
β , we could get f ( ˆ X ; C )
+ βg
( ˆ X ; C ) ≤ l r ( θ ; C )
< β .
Because of the settings that f ( · ) , g ( · ) ≥ 0 , we have f ( ˆ X ; C ) <
l r ( ¯ X ; C ) , s.t. g ( ˆ X ; C ) < 1 .
A.2 Proof of Theorem
Set h r ( ¯ X )
= (cid:80)
X ∈
[Equation]
We first prove that h r ( ¯ X ) with the form above satisfies (a) h r ( X )
=
h ( X ) for X ∈ { 0 , 1 } n .
Given one X ′ ∈ { 0 , 1 } n , by setting ¯ X = X ′ , we have
[Equation]
if X = X ′ , and otherwise 0 .
Therefore, in h r ( X ′ ) , there is only one term h ( X ′ )
(cid:81) nj =1 X ′ X
j j (1 − X ′ j ) (1 − X ′ j ) =
h ( X ′ ) left.
So, h r ( X ′ )
=
h ( X ′ ) , which satisfies (a).
Then we prove that h r ( ¯ X ) satisfies (b) h r is entry-wise affine.
From the definition, we have:
[Equation]
Consider two sequences ¯ X, ¯ X ′ ∈ { 0 , 1 } n with the entries
¯ X i , ¯ X
i , i = { 1 , 2 , ..., n } .
We have
[Equation]
W.l.o.g, we assume that only the entries ¯ X i and ¯ X
′ i in the two sequences are different.
For any γ ∈ [0 , 1] , we may use the above equality and have
[Equation]
Thus, we prove that the form of h r ( X ) is entry-wise affine.
A.3 Proof of Proposition
Suppose that the output of function h ( X 1 , X 2 ) is denoted as follows.
[Equation]
Then, we pick out the largest value a i among a 0 , a 1 , a 2 , a 3 .
W.l.o.g, we assume that a 0 is the largest and they hold the following inequations:
[Equation]
Then, we define our entry-wise concave function h r ( X 1 , X 2 ) as follows.
[Equation]
( f [2])
[Equation]
( f [3]) , (12) where
Relu ( f [1]) =
Relu (( a
[Equation]
[Equation] [Equation]
= (cid:26) a
[Equation]
a
[Equation] [Equation]
0 , X
[Equation]
otherwise ,
Relu ( f [2]) =
Relu (( a 0 − a 2 )( X 1 − X 2 )) =
(cid:26) a 0 − a
X 1 = 1 , X 2 = otherwise ,
Relu ( f [3]) =
Relu (( a 0 − a 3 )( X 1 + X 2 − 1))
= (cid:26)
a
[Equation]
a
[Equation]
X 1 = 1 , X 2 = otherwise .
B Additional Results B.1 Application I
Here, we display some additional visualization results of the feature-based edge covering and node matching problems in application I in Fig.
In both edge covering and node matching problems, our method based on entry-wise affine proxies could avoid the multiplication between some large numbers so that the final cost could be low enough.
For example, our method avoids 85*85 in the first row, 97*76 in the second row, 71*91 in the third row, and 69*98 in the forth row, which are all selected by the method with Gumbel-Softmax tricks.
[Figure]
edge covering and node matching for Application I.
B.2 Application II
[Table]
The additional visualization results of DSP-LUT usage amount relationship on the test configurations is shown in Figure.
Our entry-concave proxies generates the lowest LUT-DSP combinations among all the methods.
To be fair, we also pick the best results from 200 randomly sampled HLS tool’s assignment as a baseline (called HLS), to show the superiority of the other optimization methods.
The GS-Tr+R and the RL method outperforms the HLS baseline, while the generic methods SA and GA only marginally outperform and are comparable with the best of HLS random solutions.
The average ranking of the LUT usage under the constraint of the maximum DSP usage amount is shown in Table.
7, which adds to another two baselines, the ‘Naive’ baseline and the GS-Tr+S method.
It turns out that these two methods could not generate feasible results that satisfy the DSP usage threshold when the threshold is relatively low, thus we put them in the last place in the ranking if they could not generate feasible solutions.
We also include the percentages of cases where each method takes the first, second and third places according to the rank, which is shown in Table 6.
The comparison about how different proxies approximate the ground-truth LUT usage amount is shown in Fig 9.
Again, the entry-wise affine
[Figure] [Figure]
[Table]
proxy may introduce large error while the entry-wise concave proxy could approximate in a better sense.
We investigate the training time of RL method, GS-Tr method and the entry-wise concave method.
The comparison among these methods is shown in Fig 10.
We run all the three methods on the same server with 2 Intel(R)
Xeon(R)
Gold 6248R CPUs, 1000 GB RAM in total.
In each experiment we take 26 processes of the CPU and run on one Quadro RTX 6000 GPU card.
We count the time cost during training and select the models at different epochs for testing at intervals.
Note that the training objectives in all methods use proxies while the testing results are the outputs given by the HLS tool.
Due to the fact that inferring via HLS consumes a lot of time, we only test limited numbers of cases to draw the figure and thus the curves are not smooth.
We further investigate the inference time of GA method and the entry-wise concave method.
The comparison is in Fig.
In each generation, the inference of all the population runs in parallel on one
Quadro RTX 6000 GPU card, which is the same as our training A θ process.
Our rounding process takes almost the same time as GA in 100 generations, while our CON method achieves competitive results with GA in 500 generations which takes 4 times longer inference time than our method.
B.3 Application III
For each method, we count the ratio that the relative error based on the assignment given by this method exceeds the optimal assignment (ratio = relative error / OPT relative error - 1).
The smaller the ratio is, the closer the method’s relative error is to the optimal solution.
The results are shown in Table 8.
We also include the training time that the methods require to achieve the corresponding
[Figure] [Figure]
t e d
[Figure]
a l u e
[Figure]
L
U
[Figure]
performance in the table.
All the methods run on the same server with 2 Intel(R)
Xeon(R)
Gold 6248R CPUs, 1000 GB RAM in total.
In each experiment we take 26 processes of the CPU and run on one Quadro RTX 6000 GPU card.
The time is obtained by counting the least epoch that a model achieves its reported performance, the time of OPT is the time that the brute-force search takes in the testset.
Threshold
[Table]
-In
[Table] [Table]
Naive
RL
GS-Tr+S GS-Tr+R CON AFF
OPT
[Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
[Table] [Table]
Time / s  90+
[Table]
B.4 Study I: Further Evaluation on The Learning Capability of Different Proxies.
[Table]
We have studied the learning capability of different proxies for Application II, as shown in Fig.
9 and Fig. 4.
We further study how proxies under different constraints fit with historical data on application III.
We show the Huber
[Figure] [Figure]
[Table]
loss [75] of the proxies in Table 9.
The objective of application III has 4 -order moment, the three proxies obtain comparable approximation performance.
B.5 Study II: The Effectiveness of Our ‘Rounding’ Process
Here we empirically study the effectiveness of our rounding procedure.
We show the average relaxed loss value ( l r = f r ( ¯ X ; C ) + βg r ( ¯ X ; C ) , ¯ X ∈ [0 , 1] n ), the average rounded loss value ( l ′ r = f r ( ˆ X ; C ) + βg r
( ˆ X ; C ) , ˆ X ∈ { 0 , 1 } n and the average true value of the rounded assignment ( l = f
( ˆ X ; C )
+ βg
( ˆ X ; C ) ) on the testset of each problem in Table 11.
According to the table, we observe that both the methods that adopt entry-wise affine proxies and entry-wise concave proxies are guaranteed to obtain a drop of the loss values after our rounding procedure.
However, for the proxies that do not satisfy the constraints, the Naïve method and the GS-Tr-R baseline could not always guarantee such a drop after the rounding process.
In particular, the rounding in GS-Tr-R increases the loss in the application of A × C circuit design, while the rounding in Naïve increases the loss in the applications of edge covering and A × C circuit design.
B.6 Study III: The Random Seeds in the Experiments
AFF
CON
[Table]
We study the affect from random seeds on AFF and CON proxy in application III.
We report the performance of the three random seeds in application III in Fig.
We observe no significant difference among the three seeds in our cases.
C Experimental details
All of the experiments are carried out on the same server with 2 Intel(R)
Xeon(R)
Gold 6248R CPUs, 1000 GB RAM in total.
In each experiment we take 26 processes of the CPU and run on one Quadro RTX 6000 GPU card.
The maximum
GRAM of the Quadro RTX 6000 GPU is 24GB.
The proxies that satisfies our principle (AFF, CON) and
GS-Tr run on PyTorch [76] frame with PyTorch geometric [77].
The RL baseline follow the actor-critic technique in [60].
[30] also utilizes the same RL technique to solve the same problem.
The details of each dataset is displayed in Table.
Adam [78] is used as the optimizer in all of the experiments.
All the experiment results are conduct and averaged under three random seeds 12345 , 23456 and 34567 .
To be fair, in the training process, we first train the baseline methods, such as the proxy without constraints and A θ based on the Gumbel-softmax trick.
Then we train our entry-wise concave proxy and A θ with exactly the same hyper-parameters with the baselines except for the necessary changes to construct the entry-wise concavity.
Task
Toy example
Application I
Application II
Application III
[Table]
C.1 Other ways to construct the entry-wise concave proxy
Besides constructing the 2 -order entry-wise affine latent representation as introduced in Section
Eq
[Equation]
¯ X u ), here we introduce another approach to obtain the latent representations with higher than 2 -order moments, which can also be conveniently implemented in the current platform.
We construct such latent representation as follows:
[Equation]
where U v , U ′ v are node representations (by breaking one whole node representation into two parts), and Q v,u and Q ′ v,u are edge representations (by breaking one whole edge representation into two parts) output by GNNs.
The above form could be obtained by running one-layer message passing and the log-sum-exponential trick: (cid:80) v
[Equation]
exp
[Equation]
E log
[Equation]
X u + Q ′ v,u )] .
This alternative approach of the latent representation construction could generate the entry-wise affine latent representations with the order of the moments as high as the maximum degree of the graph.
C.2 The toy example
The ground truth of the objectives is designed as follows.
[Equation]
where C =
[ C 1 , C 2 ] and
[Equation]
The constants are set arbitrarily.
To match our graph-based pipeline, in this toy example, we also build a single edge graph for each configuration where the two nodes are associated with the attributes
C 1 and C 2 , and the binary variables X 1 and X 2 .
The proxy without constraints: We use 3 layers of GraphSAGE [72] convolutional layers that take both the node attibutes C and the optimization variables ¯ X as inputs with leaky ReLU activation and batch normalization.
Then, the structure is followed by a global mean pooling.
After several MLP layers, the proxy outputs the cost.
We use MSE loss to train this proxy.
The learning rate is set as 1e-2.
The batch size is set as 4096 .
The reported performance is trained within 200 epochs.
The entry-wise concave proxy: We use 3 layers of GraphSAGE with the same hyper-parameters as the proxy without constraints but it only takes the configuration C as inputs to encode the configuration.
Then, the encoded configuration H ∈ R | V |× d ( d is the dimension of the latent node feature) is separated equally into two parts U ∈ R | V |× d 2 and W ∈ R | V |× d 2 , we construct
U ¯ X + W, ( ¯ X ∈ [0 , 1] | V | ) , then we multiply U 1 ¯ X 1 + W 1 with U 2 ¯ X 2 + W 2 to obtain the latent node representation ϕ ( ¯ X ; C ) , followed by a linear layer as the implementation of the AFF proxy h ar ( ¯ X ; C ) as introduced in Section 5 Eq. 6.
MSE loss is used as the criterion, the learning rate is 1e-2, the batch size is 4096 , the model is trained within 200 epochs.
eeee 4 e 5 enn 2 n
Lifting eeeeee
[Figure]
A θ based on Gumbel-softmax tricks: When training A θ , we also use 3 GraphSAGE layers to encode the configuration C with leaky Relu activation and batch normalization.
Then the encoded latent feature is followed by fully connected layers to reduce the dimension and the Gumbel-softmax trick to sample a distribution from the soft probability predicted by the model.
We use the soft
Gumbel-softmax [48,49] without the straight through trick.
The learning rate is set as 1e-2, the batch size is 4096 , the model is trained for 200 epochs.
A θ in { relaxation (Naïve), relaxation with entry-wise concave proxy (Ours) } :
In A θ , the structure is the same as that based on Gumbel-softmax tricks except that the structure has no pooling layer and takes a Sigmoid layer.
The learning rate is 1e-2, the batch size is 4096 , the model is trained forepochs.
C.3 Application I - Edge Covering
Dataset details: Each configuration C is a 4 × 4 grid graph.
Each node of the graph consists of two images randomly selected from the MNIST dataset [70] and thus represents a number betweenand 99 .
The ground truth of the objective are designed as follows:
[Equation]
(17) where
[Equation]
The proxy without constraints: We firstly utilize ResNet-50 [71] to extract the latent fixed node feature and then send the feature into a GNN, the GNN is also based on 3 MPNN [79] layers, which involves the edge assignment ¯ X, ( ¯ X ∈ [0 , 1] | E | ) in the message passing.
Global mean pooling is used to generate the final predicted value f r ( ¯ X ; C ) .
MSE loss is utilized as the criterion, the learning rate is 5e-3, the batch size is 160 .
The entry-wise affine proxy: We also use ResNet-50 and 3 layers of MPNN [79] which take the output of ResNet-50 as inputs with leaky Relu activation and batch normalization to encode the configuration C into the latent node representation H ′ ∈ R | V |× d 1 ( d 1 is the dimension of the node feature).
After the encoding procedure, the encoded node features are lifted to each side of the edges according to the edge index, then these node features on two sides of the edges are concatenated together and sent into MLP layers to generate the latent edge representation H ′′ ∈ R | E |× d 2 ( dis the dimension of the edge feature).
Then H ′′ is separated into two parts U ∈ R | E |× 3 d 24 and
W ∈ R | E |× d 24 , and we calculate U
¯ X
+ W, ( ¯ X ∈ [0 , 1] | E | )
to construct the latent representation ϕ
( ¯ X ; C ) .
The structure is followed by mean pooling and linear layers to construct the AFF proxy h ar ( ¯ X ; C ) .
The whole procedure generalizes our framework from solving node problems to edge problems, as is shown in Fig.
We use MSE loss for training, the learning rate is set as 5e-3, the batch size is 160 .
The entry-wise concave proxy: The network shares the same structure with the AFF proxy in the front part, while we utilize linear layers mixed with a negative Relu function to construct the
CON proxy h cr ( ¯ X ; C ) = ⟨ w c , − Relu ( ϕ ( ¯ X ; C )) ⟩ + b , as introduced in Section 5.
Note that we use torch.clamp() function to control the entries in w c greater or equal to zero in each batch of data during the training process.
We use MSE loss for training and set the learning rate as 5e-3, the batch size is 160 .
The RL baseline: We apply an actor critic model [60].
This model consists of 4 key components: 1)States, the states are formulated as every possible partially assigned grid graph; 2) Actions, given the current state and the currently candidate edges of the grid graph, the action is which new edge to pick.
Note that the model is only allowed to pick from the edges which connect at least one node that has not been covered yet; 3) State transition, given a state and an action, the probability of the next states; 4)Reward, the reward is 0 for all intermediate actions, in the last action the reward is the evaluation of the covering score predicted by the proxy without constraints.
In each state at a time step, we extract the features from the last layer of the proxy without constraints f r .
We utilize another ResNet-50 + GNN to encode the whole grid graph into a vector encoding.
The features are further combined with the vector embedding as the state encoding.
Then the state encoding is sent into the policy network that is made up of multiple MLP layers to output the critic value c and the action a which indicates the next edge to pick from.
The loss for the actor is calculated by subtracting the reward by c , and we use Huber loss to make c close to the reward.
In each state, the model would only choose from the edges which connect at least one node that has not been covered yet.
The reward is defined as the negative proxy prediction:
[Equation]
where T is the max step, and s denotes the number of the step.
The learning rate is set as 1e-2, the discount factor for the reward is set as 0 .
95 , we train the RL baseline for more than 20 , 000 epochs to achieve the reported performance.
The constraint g r ( ¯ X ; C ) : As to the penalty constraint g r ( ¯ X ; C ) =
(cid:80) v ∈ V (cid:81)
e : v ∈ e (1 − ¯ X e ) which naturally satisfies our definition of CO problems in Section 2, we apply the log-sum-exponential trick (cid:80) v ∈ V exp( (cid:80) v ∈ e log(1 − ¯ X e )) to calculate it via message passing in PyTorch geometric.
A θ based on Gumbel-softmax trick: We utilize 3 GraphSAGE layers to encode the node feature, with leaky Relu activation function and batch normalization.
The encoded node features are lifted to each side of the edges, concatenated together and then sent into MLP layers to reduce the dimension and map to A θ ( C ) ∈ [0 , 1] | E | .
Then the model is followed by the Gumbel-softmax trick to obtain the output X ∼ Ber ( A θ ) .
We use the soft Gumbel-softmax [48,49] without the straight through trick.
The learning rate is set as 1e-3, the batch size is 60 .
A θ in { relaxation (Naïve), relaxation with entry-wise concave proxy (Ours) } :
The model shares the same structure as that based on the Gumbel-softmax trick, except that the Gumbel-softmax trick is replaced by ¯ X ∈ [0 , 1] | E | directly.
The learning rate is set as 1e-3, the batch size is 60 .
C.4 Application I - Node Matching
The ground truth of the objective are designed as follows:
[Equation]
where
[Equation]
Every structure design keeps the same as Application I - Edge Covering except for the extra penalty constraint (cid:81)
[Equation]
2 in Eq.
(8) which naturally follows our request on g r , and is also conducted via matrix operations on PyTorch geometric.
As to the RL baseline, the structure design is basically the same as Application I, while in this problem, at each time step, the model is only allowed to pick an edge whose two nodes are both not covered.
The reward is defined as follows:
[Equation]
where “no options” means that there are some covered nodes whose neighboring nodes have been all covers, “option exists” denotes the case when eligible edges still exist, T is the max step, β is a large hyper-parameter, and s denotes the number of the step.
The learning rate is set as 1e-2, the discount factor for the reward is set as 0 .
95 , we train the RL baseline for more than 20 , 000 epochs to achieve the reported performance.
C.5 Application II - Resource Binding Optimization
Dataset details In this application, we focus on the resource binding problems in field-programmable gate array (FPGA) design.
Each configuration C in the dataset is a data flow graph (DFG) with more than 100 nodes.
Each node represents an arithmetic operation such as multiplication or addition.
The operations need to be one-to-one mapped into a micro circuit to carry out the calculation.
Given an assignment of the mapping, we run high-level synthesis (HLS) simulation tools to obtain the actual circuit resource usage under the assignment, which might take up to hours time.
Note that different assignments of the mapping could result in vastly different actual resource usage.
In this dataset, we focus on the resource balancing problems between digital signal processors (DSP) and look-up tables (LUT).
Here DSP is a small processor that is able to quickly perform mathematical operation on streaming digital signals, LUT is the small memory that is used to store truth tables and perform logic functions.
The optimization goal of the dataset is to allocate those nodes with pragma to either LUT or DSP, such that the actual usage amount of LUT could be minimized given a maximum usage amount of the DSP usage.
We use 1 (LUT) or 0 (DSP) to assign each node’s mapping.
We encode the fixed node feature into a 10 -dimension embedding which contains the following information: 1) 4 digits to indicate the types of nodes in {input, m-type, intermediate-type, output}; 2) 5 digit binary encoding of the node’s calculation precision, from 2 bits to 32 bits;digit encoding that indicates whether the node requires pragma.
For those nodes that do not require pragma, HLS tools have a set of heuristic assignments to the nodes during the simulation.
The proxy without constraints: We separately utilize two GraphSAGE GNN models [72] to predict the LUT usage f r ( ¯ X ; C ) and the DSP usage g r ( ¯ X ; C ) , the structure of them are the same.
We use 3 layers of GraphSAGE [72] convolutional layers that take both the node attibutes C and the optimization variables ¯ X as inputs with leaky ReLU activation and batch normalization.
Then, the structure is followed by a global mean pooling.
After several MLP layers, the proxy outputs the cost.
We use MSE loss to train this proxy.
The learning rate is set as 1e-3.
The batch size is set as 256 .
The entry-wise affine proxy: For both f r and g r , we use 3 layers of GraphSAGE to encode the configuration C and the hyper-parameter α to control the DSP usage threshold with leaky Relu activation and batch normalization into the latent node representation H ∈ R | V |× d ( d is the node feature dimension).
The hyper-parameters of the layers are exactly the same as the proxy without constraints.
Then H is separated equally into two parts U ∈ R | V |× d 2 and W ∈ R | V |× d 2 , and we calculate U ¯ X + W , after that we do the log-sum-exponential trick (cid:80) v ∈ V exp[log( U v ¯ X v + W v )
+ (cid:80) u :( u,v )
∈
E log( U u ¯ X u + W u )] via message passing to generate the 2 -order moment entry-wise affine latent representation as introduced in Section 5.
Finally, the global mean pooling and a linear layer is used to obtain the output f r ( ¯ X ; C ) , g r ( ¯ X ; C ) .
Huber loss is used as the criterion, the learning rate is set as 5e-4 for g r and 1e-3 for f r , the batch size is 256 .
The entry-wise concave proxy: The models share basically the same structure as that in the AFF proxy except for the last layers.
We use linear layers with a negative Relu function to construct the CON proxy h cr ( ¯ X ; C ) =
⟨ w c , − Relu ( ϕ ( ¯ X ; C )) ⟩ + b , as introduced in Section 5.
We utilize torch.clamp() function to control the entries in w c to be always greater or equal to zero in each batch of data processing during the training process.
The simulated annealing baseline: We run the simulated annealing algorithm guided by the proxy without constraints.
The initial temperature is set as 1000 , the cool down factor is 0 .
99 , the ending temperature is 699 .
For each temperature, the number of jumps is 20 .
And, we set the probability for mutation is 0 . 1 .
The genetic algorithm baseline: We run the genetic algorithm guided by the proxy without constraints.
The algorithm runs parallel on GPU.
The max generation is set as 100 , the population of each generation is 256 , which is the same as the batch size that we used to train A θ , the probability of crossover is 0 .
6 , the probability of gene mutation is 0 .
The inference via proxy of each generation runs parallel on GPU.
The RL baseline: We apply an actor critic model [60].
This model consists of 4 key components: 1)States, the states are formulated as every possible partially assigned DFG; 2) Actions, given the current state and the currently considered node of the DFG, the action is whether to assign the LUT to this node; 3) State transition, given a state and an action, the probability of the next states; 4)Reward, the reward is 0 for all intermediate actions, in the last action the reward is the evaluation of the fully assigned DFG subject to the DSP usage threshold.
In each state at a time step, we extract the features from the last layer of the proxies without constraints f r , g r and concatenate them together.
We utilize another GNN to encode the whole DFG into a vector encoding.
The concatenated features is further combined with the vector embedding as the state encoding.
Then, the state encoding is sent into the policy network that is made up of multiple MLP layers to output the critic value c and the action a which indicates whether to assign LUT for the current multiplication node.
The loss for the actor is calculated by subtracting the reward by the critic value c , we use Huber loss to make c close to the reward.
Note that the above scheme follows the original paper that studied the same application [30] while the status representation is based on an intermediate output given by the GNN in our proxy without constraints.
The reward is defined as the negative weighted sum of LUT usage and the difference between the DSP usage and the DSP threshold:
[Equation]
where T is the max step, α, β are hyper-parameters and set as 0 . 1 , 10 respectively, t is the DSP usage threshold and s denotes the number of the step.
The learning rate is set as 1e-2, the discount factor for the reward is set as 0 .
95 , we train the RL baseline for more than 9 , 000 epochs to achieve the reported performance.
The mapping of g r ( ¯ X ; C ) :
Here we introduce the mapping of the constraints in detail.
The relaxed optimization goal could be written as follows:
[Equation] [Equation]
where t − 1 is the threshold for the DSP usage amount, ¯ X
=
A θ ∈ [0 , 1] n .
As introduced in
Section 2, we map the above constraints into the normalized constraint g ′ r ( ¯ X ; C ) via the following normalization.
[Equation]
where g +min = min X ∈{
[Equation]
1 } | V | \ Ω g r ( X ; C ) =
t and g min = min X ∈{ 0 , 1 } | V | g r
( X ; C )
=
in this case.
Thus, the normalized constraint could be written as:
[Equation]
The constraint above could satisfy our definition of the CO problems as introduced in Section 2.
The overall loss function could thus be written as follows:
[Equation]
) where β > max X ∈ Ω f ( X ; C ) .
In our implementation, we uniformly feed the network with different α = βt +1 for different t ’s such that the model can be automatically suitable for different α ’s. Simultaneously, for different t , we expect the algorithm
A θ to adapt such a constraint t , so we also use t as an input, i.e., using A θ ( · ; t ) .
During testing, the obtained A θ ( · ; t ) outputs ¯ X that would satisfy different DSP usage thresholds by taking different t as the input.
By this, a single model could handle all ranges of DSP usage thresholds.
A θ based on Gumbel-softmax trick: We also use 3 GraphSAGE layers to encode the configuration C into the latent features.
Then, we use MLP layers to reduce the dimension and map to A θ ( C ) ∈ [
[Table]
C.6 Application III - Circuit Design for Approximate Computing
Dataset details: Each configuration C in our approximating computing (A × C) dataset is a computation graph whose nodes represent either multiplication or addition calculation.
For each operand, we have two different calculators to carry out the calculation: one is the precise calculator which always output the precise result but requires high computational resource workload, the other is the A × C unit which costs low computational resource but always randomly produces 10% relative error of the actual result.
To balance the computation precision and the resource workload, the optimization goal is to minimize the average relative error of the computation graph given the need to use at least a certain number θ of the A × C units, where θ ∈ { 3 , 5 , 8 } .
For each instance in the dataset, we randomly take 1 , 000 different inputs to calculate the average relative error.
Each input consists ofinteger numbers that are uniformly sampled from 1 to 100 .
To simulate the locality of some data, some of the inputs only sample 14 integers and randomly re-use two of them.
The C-In, C-Out baselines: In the C-In (C-Out) baseline, as many A × C units as the threshold requires are placed randomly near to the input (output) of the approximate computing circuit.
The proxy without constraints: We utilize 4 PNA [80] layers as the GNN backbone to show that our method is not limited with certain GNN backbones.
The PNA layers take both the configuration C and the optimization variable ¯ X as inputs with leaky Relu activation and batch normalization.
Then the structure is followed by global mean pooling with MLP layers to output f r ( ¯ X ; C ) .
Huber loss is used as the criterion, the learning rate is 1e-3, and the batch size is 2048 .
The entry-wise affine proxy: We also use 4 PNA layers but only take the configuration C as input to generate the latent node features H ∈ R | V |× d ( d is the dimension of the node features).
The hyper-parameters are exactly the same as the proxy without constraints.
Then H is separated equally into two parts: U ∈ R | V |× d 2 and W ∈ R | V |× d 2 , and we calculate U
¯ X
+ W , after that we do the log-sum-exponential trick (cid:80) v ∈ V exp[log( U v ¯ X v + W v )
+ (cid:80) u :( u,v )
∈
E log( U u ¯ X u + W u )] via message passing to generate the 2 -order moment entry-wise affine latent representation as introduced in Section 5.
Huber loss is used as the criterion, the learning rate is set as 1e-3, the batch size is 2048 .
The entry-wise concave proxy: The model shares basically the same structure as that in the AFF proxy except for the last layers.
We utilize linear layers mixed with a − Relu function to construct the CON proxy h cr ( ¯ X ; C ) = ⟨ w c , − Relu ( ϕ ( ¯ X ; C )) ⟩ + b , as introduced in Section 5.
We use torch.clamp() function to control the entries in w c to be always greater or equal to zero in each batch of data processing during the training process.
The RL baseline: We apply an actor critic model [60].
This model consists of 4 key components: 1)States, the states are formulated as every possible partially assigned A × C computation graph; 2)
Actions, given the current state and the currently considered node of the A × C circuit, the action is the next node to assign with the A × C unit; 3) State transition, given a state and an action, the probability of the next states; 4)Reward, the reward is 0 for all intermediate actions, in the last action the reward is the evaluation of the fully assigned A × C computation graph.
In each state at a time step, we extract the features from the last layer of the proxy without constraints f r .
We utilize another GNN to encode the whole computation graph into a vector encoding.
The features are further combined with the vector embedding as the state encoding.
Then the state encoding is sent into the policy network that is made up of multiple MLP layers to output the critic value c and the action a which indicates the next node to assign with an A × C unit.
The loss for the actor is calculated by subtracting the reward by c , and we use Huber loss to make c close to the reward.
Note that the state stops if the model has already assigned with as many A × C units as the threshold requires.
The reward is defined as the negative proxy prediction:
[Equation]
where T is the max step, and s denotes the number of the step.
The learning rate is set as 1e-2, the discount factor for the reward is set as 0 .
95 , we train the RL baseline for more than 9 , 000 epochs to achieve the reported performance.
The mapping of g r ( ¯ X ; C ) :
The relaxed optimization goal could be written as follows:
[Equation]
where t + 1 is the A × C unit usage threshold, X v = 1 denotes the usage of an A × C unit.
The relaxation of the above constraint could be written as g ′ r ( ¯ X ; C ) = n − (cid:80) ni =1 ¯ X i ∈ [0 , n − t ) .
With the method introduced in Section 2, we could normalize it as follows:
[Equation]
where g +min = min X ∈{ 0 , 1 } n \ Ω g ′ r
( X ; C )
= n − t and g min =
min X ∈{ 0 , 1 } | V | g ′ r
( X ; C )
=
in this case.
Thus, the normalized constraint could be written as:
[Equation]
The constraint above could satisfy our definition of the CO problems as introduced in Section 2, the overall loss function could thus be written as:
[Equation]
where β > max X ∈ Ω
f ( X ; C ) .
In our implementation, we uniformly feed the network with different α = βn − t for different t ’s such that the model can be automatically suitable for different α ’s. Simultaneously, for different t , we expect the algorithm
A θ to adapt such a constraint t , so we also use t as an input, i.e., using
A θ ( · ; t ) .
During testing, the obtained A θ ( · ; t ) outputs ¯ X that would satisfy different A × C unit usage thresholds by taking different t as the input.
By this, a single model could handle all ranges of A × C unit usage thresholds.
A θ based on Gumbel-softmax trick: We also use 3 GraphSAGE layers with leaky Relu activation functions and batch normalization to encode the configuration C into the latent features.
Then, we use MLP layers to reduce the dimension and map to A θ ( C ) ∈ [0 , 1] n and the Gumbel-softmax trick to sample X ∼ Ber ( A θ ) .
We use the soft Gumbel-softmax [48,49] without the straight through trick.
The learning rate is set as 1e-3, the batch size is 2048 .
A θ in { relaxation (Naïve), relaxation with entry-wise concave proxy (Ours) } :
The model shares the same structure as that based on the Gumbel-softmax trick, except that the Gumbel-softmax trick is replaced by ¯ X ∈ [0 , 1] n directly.
The learning rate is 1e-3, the batch size is 2048 .
D Broader Impact
In this paper, we introduce a general unsupervised framework to resolve LCO problems.
The broader impact of this paper is discussed from the following aspects:
1) Who may benefit from this research.
The researchers, companies and organizations who utilize our
optimization framework to solve
CO
, LCO or PCO problems might benefit from this research, because our framework reduces the cost of data labeling and improves the performance of the optimization
In addition, more broader people might also benefit from this research, because the unsupervised framework and the standardized low-cost training in comparison with the current methods mean lower energy cost and less pollution, which might do good to the whole society.
Who
may be put at a risk
from
this research.
Although our method guarantees the quality of the obtained solution when the loss is low, how much gap between the obtained solution and the optimal solution is
still
unclear.
There might be still some gaps to fill in before our method gets deployed in the scenarios where rigorous approximation guarantee of the solutions is requested
What are the sequences of the failure of the system.
A failure of our approach will fail to give a relatively good enough solution to the CO problem.
E Licenses
We use the following datasets in our research, their licenses are listed as follows:
• The feature based edge covering and node matching problem dataset in application I is generated and proposed by us.
It is inspired by [69] and utilizes the images from MNIST [70],
which is under the Creative Commons Attribution-Share Alike 3.0 license.
The dataset is publicly available.
• The resource binding problem dataset in application II is from [30] and is publicly available.
Please cite their paper in the new publications.
• The imprecise functional unit assignment problem dataset in application III is from [45] and is publicly available.
Please cite their paper in the new publications.
All the datasets and code bases are publicly available.
They contain no human information or offensive content.