DRL-based Distributed Resource Allocation for Edge Computing in Cell-Free Massive MIMO Network

In this paper, with the aim of addressing the stringent computing and quality-of-service (QoS) requirements of recently introduced advanced multimedia services, we consider a cell-free massive MIMO-enabled mobile edge network. In particular, benefited from the reliable cell-free links to offload intensive computation to the edge server, resource-constrained end-users can augment on-board (local) processing with edge computing. To this end, we formulate a joint communication and computing resource allocation (JCCRA) problem to minimize the total energy consumption of the users, while meeting the respective user-specific deadlines. To tackle the problem, we propose a fully distributed solution approach based on cooperative multi-agent reinforcement learning framework, wherein each user is implemented as a learning agent to make joint resource allocation relying on local information only. The simulation results demonstrate that the performance of the proposed distributed approach outperforms the heuristic baselines, converging to a centralized target benchmark, without resorting to large overhead. Moreover, we showed that the proposed algorithm has performed significantly better in cell-free system as compared with the cellular MEC systems, e.g., a small cell-based MEC system.


I. INTRODUCTION
Over the past few years, there has been a surge in computation hungry, and yet highly delay-intolerant multimedia applications. To support these applications in resource-limited end-user devices, it is essential to augment on-board (local) processing by offloading part of the intensive computation to more powerful computing platforms at the network edge. To this end, the ubiquitous radio and computing resources at the mobile edge network should be jointly optimized in a way to improve certain system objectives such as execution delay and energy consumption. In this regard, a plethora of joint communication and computing resource allocation (JCCRA) schemes based on conventional optimization methods have been investigated. However, most of these approaches either assume accurate knowledge of network-wide information, which is difficult to obtain in practice, or are limited to quasi-static systems, such as deterministic task size and timeinvariant channel conditions. Thus, their application to support time-sensitive applications in dynamic mobile edge network might be critically limited.
Driven by the recent advances in machine learning and deep reinforcement learning (DRL), several learning-based schemes have been proposed to provide flexible joint resource allocation. For instance, deep Q-network (DQN) is employed in [1,2] for designing joint offloading and resource allocation decisions, while [3] presents a deep deterministic policy gradient (DDPG)-based scheme in heterogeneous networks with multiple users. However, these schemes rely on central entities to make joint resource allocation decision, suffering from considerable signaling overhead and scalability issues. [4] investigates distributed JCCRA problem in a single-cell mobile edge computing (MEC) system, however, the adopted computation model is not applicable for tasks with extreme reliability and ultra-low hard deadline requirements. We note that the large amount of effort on optimizing joint resource allocation in MEC networks focuses on cellular system. However, as we move towards the next decade, the current cellular MEC systems may not keep up with the diverse and more stringent requirements of the envisaged advanced applications, such as holographic displays, multi-sensory extended reality, and others.
In light of the recently proposed cell-free massive MIMO architecture, envisioned for beyond-5G and 6G networks, however, there are only limited works. Notably, cell-free architecture can provide sufficiently fast and reliable access links without cell-edge by serving a relatively small number of users from several geographically distributed access points (APs) [5]. It, therefore, opens up a new opportunity to support energy-efficient and consistently-low latency computational task offloading, in contrast to cellular MEC systems. [6] presents several performance analyses in a cell-free MEC system considering coverage radius of the APs, while the issues of active user detection and channel estimations are discussed in [7]. In this paper, we consider a JCCRA problem that minimizes total energy consumption of the users while meeting the user-specific application deadlines by jointly optimizing the allocation of local processor clock speed and uplink transmission power for each user. We then present a fully distributed solution approach based on cooperative multi-agent reinforcement learning, alleviating the signaling and communication overheads associated with centralized implementations. In sharp contrast to our work, both [6] and [7] Fig. 1: User-centric cell-free massive MIMO-enabled mobile edge network: Illustrative system model with the JCCRA problem. To the best of our knowledge, this is the very first attempt to solve JCCRA problem in a fully distributed fashion for cell-free network-enabled mobile edge network. The fully distributed and intelligent JCCRA in our framework combined with the reliable access links of the cellfree massive MIMO architecture can be a promising means to handle the stringent requirements of the newly introduced multimedia services. The rest of the paper is organized as follows: In Section II, we discuss the system model and problem formulation for the JCCRA framework. Section III presents the proposed distributed JCCRA scheme based on cooperative multi-agent reinforcement learning (MARL) framework. Simulation results are presented in Section IV, followed by some concluding remarks in Section V.

II. SYSTEM MODEL AND PROBLEM FORMULATION
A. User-centric Cell-free Massive MIMO: Overview We consider a cell-free massive MIMO-enabled mobile edge network, depicted in Fig. 1, where a central processing unit (CPU) with an edge server of finite capacity f CP U (in cycles per second) is connected to M single-antenna access points (APs) via ideal fronthaul links. Furthermore, M APs serve K single-antenna users, such that M K, entailing to the widely known system model for cell-free massive MIMO [5]. Let M = {1, 2, ..., M } and K = {1, 2, ..., K} denote sets of AP and user indices, respectively. Besides, each user k ∈ K is also equipped with limited local processor with maximum capability f max k (in cycle per second). Let the channel between m-th AP and k-th user is given as g mk = β 1 /2 mk h mk where β mk is a large-scale channel gain coefficient that models the effects of path loss and shadowing while h mk ∼ CN (0, 1) represents small-scale channel fading. Let τ c denote a channel coherence period in which h mk remains the same. The coherence period τ c is divided into pilot transmission interval of τ p samples and uplink data transmission interval of (τ c − τ p ) samples for offloading computation to the edge server in the CPU.
At the beginning of each coherence time, each user k ∈ K simultaneously transmit a pilot sequence ψ k ∈ C τp× 1 , such that ψ k 2 = 1, which is used to estimate the respective channelsĝ mk at each AP m ∈ M. Assuming pairwise orthogonal sequences {ψ 1 , ψ 2 , ....., ψ K }, i.e., τ p = K, we ignore pilot contamination problem in the current model. Then, the received pilot vector at the m-th AP, y p m ∈ C τp× 1 , can be represented as where q p k is the pilot transmit power, and ω p m is a τ pdimensional additive noise vector with independent and identically distributed entries of ω p m ∼ CN 0, σ 2 m . Based on the received vector y p m , the least-square (LS) channel estimatê g mk can be expressed as: The channel estimates are used to decode the uplink transmitted data of the users. After pilot transmission, the users transmit offloaded data to the APs. Let x k denote the uplink data of user k, with transmit power of p k , which is determined as p k = η k p max k , where η k , and p max k represent power control coefficient and maximum uplink power of the k-th user, respectively. Then, the received signal y u m at the m-th AP is represented as It is important to ensure the scalability of cell-free massive MIMO system, in terms of complexity for pilot detection and data processing. To this end, we limit the number of APs that serve the k-th user to N k < M , and form a user-centric cluster of APs C k ⊂ {AP 1 , AP 2 , · · · , AP N k }, by including all APs with the largest β mk to C k until the maximum allowable cluster size is reached, i.e., N k = C max . Thus, the transmitted data by user k is only decoded by the APs in C k . Then, after performing maximum ratio combining (MRC) at each AP m ∈ C k the quantityĝ * mk y u m is transmitted to the CPU via a fronthaul link. The received soft estimates are combined at the CPU to decode the data transmitted by user k as follows: Then, the uplink signal-to interference and noise ratio (SINR) γ k for user k can be expressed as: Given the system bandwidth W , the uplink rate of user k is given as R k = W log 2 (1 + γ k ) by Shannon's theory.

B. Parallel Computation Model
We assume each user k has a computationally intensive task of T k (t) bits at the beginning of every discrete time step t, whose duration ∆t = τ c . The task sizes in different time steps are independent and uniformly distributed over [T min, T max, ], for every user k ∈ K. Let t d k denote the maximum tolerable delay of user k to complete execution of the given task. Considering the delay constraint and energy consumption, the k-th user processes T local k (t) bits locally while offloading the remaining T of f load k (t) bits to the edge server at the CPU. 1], denote the k-th user processor speed (in cycle per second) allocated for local task execution. The entire task is offloaded to the edge server if α k = 0, while α k = 1 implies that the whole local processing capability is fully utilized and the remaining task bits are offloaded to the edge server. Accordingly, the proportion of locally computed task size at time step t is expressed as T local where N cpb corresponds to the number of cycles required to process one-bit task. Then, the time taken for local execution at time step t is expressed as The corresponding energy consumption is given by where ς corresponds to the effective switched capacitance.
2) Computation Offloading: The remaining T of f load k (t) = max 0, T k (t) − T local k (t) bits are offloaded to the edge server at the CPU for parallel computation. While offloading computation to the edge server, the experienced latency can be broken down into transmission delay, computing delay at the edge server, and transmission delay for retrieving the processed result. Assuming the retrieved data size after computation is much smaller compared to the offloaded data size, we ignore the retrieving delay. Then, the transmission delay to offload T of f load , where R k (t) is the uplink rate of user k at time step t. The computing time at the edge server is given by t comp is computation resource at the CPU allocated for user k, which is in proportion to T of f load k (t). The total offloading delay for edge computation is then given as The corresponding energy consumption for offloading computation is then expressed as where p k (t) = η k (t) p max k , ∀η k ∈ [0, 1]. Then, the overall experienced latency t k (t) by user k to execute T k bits locally and at the edge is given as: Similarly, the energy consumption E k (t) of user k at time step t can be expressed as C. JCCRA Problem Formulation According to the aforementioned communication and parallel computation models, we intend to jointly optimize the local processor speed f local k (t) and uplink transmission power p k (t) for every user k ∈ K at each time step t, in order to minimize the total energy consumption of all users subject to the respective user-specific delay requirements. The JCCRA problem can mathematically be formulated to jointly determine (α k (t) , η k (t)) , ∀k ∈ K as follows: (12) is a stochastic optimization problem in which the objective function and the first condition involve constantly changing random variables, i.e., task size and channel conditions. Consequently, the problem must be solved frequently, i.e., at every time step t, and the solution must converge rapidly within the ultra-low delay constraint. Therefore, it is challenging to solve the problem using iterative optimization algorithms with reasonable complexity. Furthermore, relying on a one-shot optimization, it is difficult to guarantee a steady long-term performance with conventional algorithms since they cannot adapt to the changes in the mobile edge network.

III. THE PROPOSED MULTI-AGENT REINFORCEMENT
LEARNING-BASED DISTRIBUTED JCCRA To cope up with the dynamics in the MEC while supporting efficient and adaptive joint resource allocation for every user, we propose a fully distributed JCCRA based on cooperative multi-agent reinforcement learning (MARL). We note that solving the JCCRA problem centrally at the CPU might allow for efficient management of the available radio and computing resources due to globally processing of network-wide information. However, the associated signaling and communication overheads are forbiddingly significant, especially given the ultra-low delay constraints. Accordingly, we transform the JCCRA problem into a partially observable cooperative Markov game that consists of K learning agents. One of the main challenges in multi-agent domain is the nonstationarity of the environment since the agents update their policies concurrently, which might lead to learning instability. To deal with this challenge, the agents are trained with the state-of-the-art multi-agent deep deterministic policy gradient (MADDPG) algorithm under the framework of centralized training and decentralized execution [8].

A. DRL Formulation for JCCRA
Each user is implemented as a DRL agent that learn to map local observation of the environment to efficient JCCRA actions by sequentially interacting with the mobile edge network in discrete time steps. Let O k , and S denote the local observation space of agent k ∈ K, and the complete environment state space, respectively. At the beginning of each step t, agent k perceives the local observation of the environment state o k (t) : S → O k , and takes an action a k (t) ∈ A k from its action space A k according to the current JCCRA policy µ k . The interaction with the environment produces the next observation of the agent o k (t + 1) ∈ O k and a realvalued scalar reward r k (t) : S × A k → R that guides the agent to constantly improve the policy until it converges. The goal of the agent is, therefore, to derive an optimal JCCRA policy µ * k that maximizes the expected long-term discounted cumulative reward, defined as where ε ∈ [0, 1] is a discount factor and T is the total number of time steps (horizon). In the sequel, we define the local observation, action, and reward of agent k for the JCRRA at a given time t.
1) Local observation: At the beginning of each time step t, the local observation of agent k is defined as o , and R k (t−1) are the incoming task size, user-specific application deadline, and the uplink rate from the previous time step, respectively. Note that the local observation is only a partial view of the environment, i.e., it does not include information about the other agents.
2) Action: Based on the local observation of the environment, the agent takes action a k (t) , and uplink transmit power p k (t) = η k (t) p max k .

3) Reward:
To reflect the design objective of the JCCRA problem and enforce a cooperative behavior among the agents, we define joint reward as where ξ k = 1 if t k (t) ≤ t d k , otherwise ξ k = 10 to punish potentially selfish behavior of the agents that leads to failure in meeting the delay constraint.

B. MADDPG Algorithm for Distributed JCCRA
During the offline training phase, the agents can be trained in a central unit, which presents an opportunity to share extra information among the agents for easing and accelerating the training process. Specifically, agent k has now access for the joint action a (t) = (a 1 (t) , ..., a K (t)), and full observation of the environment state s is the local observation of other agents at time step t. The extra information endowed to the agents, however, is discarded during the execution phase, meaning the agents rely on their local observation entirely to make JCCRA decisions in a fully distributed manner.
As an extension of the single-agent deep deterministic policy gradient (DDPG) algorithm [9], the MADDPG is an actorcritic policy gradient algorithm. Specifically, the MADDPG agent k employs two main neural networks: actor network with parameters θ µ k to approximate a JCCRA policy µ k (o k |θ µ k ) and a critic network, parametrized by θ Q k , to approximate a state-value function Q k s k , a|θ Q k , along with their respective time-delayed copies, θ µ k and θ µ k , which serve as targets. At time step t, the actor deterministically maps local observation o k (t) to a specific continuous action µ k (o k (t) |θ µ k ) and then, a random noise process N k is added to generate an exploratory policy such that a k (t) = µ k (o k (t) |θ µ k ) + N k (t). The environment, which is shared among the agents, collects the joint action a (t) = {a k (t) , ∀k ∈ K} and returns the immediate reward r k (t) and the next observation o k (t + 1) to the respective agents. To make use of the experience in later decision-making steps efficiently and improve the stability of the training, the agent's transition along with the extra information e k (t) = (s k (t) , a (t) , r k (t) , s k (t + 1)) is saved in the replay buffer D k of the agent.
To train the main networks, a mini batch of B samples , is randomly drawn from the replay buffer D k , where i denotes a sample index. The critic network is updated to minimize the following loss function: where y i k is the target value expressed as y i On the other hand, the parameters of the actor network are updated along the deterministic policy gradient given as The target parameters in both actor and critic networks are updated as θ µ k ← τ θ µ k + (1 − τ ) θ µ k , and θ Q k ← τ θ Q k + (1 − τ ) θ Q k , respectively, where τ is a constant close to zero. It is worth mentioning that the proposed JCCRA scheme is trained offline. Once it converges, real-time decision making can be conducted in a fully distributed fashion by simply performing inference with the trained actor network of each agent, relying on the respective local observation only.

IV. PERFORMANCE ANALYSIS
We consider M = 100 APs and K = 10 users uniformly distributed at random over an area of 1 km 2 . The APs are connected to the CPU via ideal fronthaul links. We assume only 30% of the entire APs are clustered to serve each user, i.e. N k = 0.3M, ∀k ∈ K. The system bandwidth is set to 5MHz and all active users share this bandwidth without channelization. Denoting the standard deviation of the shadow fading by σ sh , the large-scale channel gain is given as β mk = 10 P L mk 10 10 σ sh z mk 10 , where z mk ∼ N (0, 1). The path loss P L mk is given according to the three-slope model [10] as follows: Here, f is the carrier frequency (in MHz), h AP is the AP antenna height (in m), and h u denotes the user antenna height (in m). Further, no shadowing is considered unless d mk > d 1 .
The edge server at the CPU has computation capacity f CP U = 100 GHz, while the users are equipped with local processor with f max k = 1 GHz. The length of a time step ∆t is set to 1ms, and each user generates a task of a random size that is uniformly distributed in the range of 2.5 to 7.5 kbits at the beginning of every time step t. Furthermore, Furthermore, additional simulation parameters are set to N cpb = 500, ς = 10 −27 , p max k = 0.1W, σ sh = 10dB, and t d k = ∆t = τ c = 1ms. For the proposed MADDPG-based JCCRA implementation, the actor and critic networks of each agent are implemented with fully connected neural networks, which consist of 128, 64, and 64 nodes. All the hidden layers are activated by ReLu function, while the outputs of the actor are activated by sigmoid. The parameters of critic and actor networks are updated with adaptive moment (Adam) optimizer with the learning rates of 0.001 and 0.0001. Further, we set the discount factor γ k = 0.99, target update parameter τ = 0.005, and mini batch size B = 128. In our simulations, the agents are trained for several episodes, each consisting of 100 steps.
To evaluate the performance of the proposed MADDPGbased JCCRA, we compare it with three benchmarks: 1) Centralized DDPG-based JCCRA scheme: This approach refers to a DDPG-based centralized resource allocation scheme implemented at the CPU. We adopt the same neural network structure and other hyperparameters as the MADDPG-based scheme to train the actor and critic in the single DDPG agent. Since global information of the entire network is processed centrally at the CPU to make JCCRA decisions for all users, we can potentially obtain the most efficient resource allocation. Consequently, this baseline serves as a target performance benchmark. However, as it involves significant signaling and communication overheads, this scheme might be infeasible to support time-sensitive applications.
2) Offloading-first with an uplink fractional power control (FPC) scheme: This approach preferably offloads the computation to the edge server with the aim of aggressively exploiting the reliable access link provided by cell-free massive MIMO while saving the local processing energy consumption. The uplink transmit power for the k-th user is determined by the standard fractional power control (FPC) [11] as follows: where p 0 = −35 dBm, λ k = N k m=1 β mk , and ν = 0.5.
3) Local execution-first with an uplink fractional power control (FPC) scheme: The entire local processing capability is fully utilized, i.e., f local k = f max k , and the remaining task bits are offloaded to the edge server with uplink transmit power given according to (18).
In Fig. 2, we investigate the convergence and performance of the proposed MADDPG-based JCCRA scheme by evaluating the total reward accumulated during the training process. It can be observed that the performance of the proposed distributed scheme has converged to the target performance benchmark, i.e. the centralized DDPG-based JCCRA, while relieving the large overhead of the latter. This implies that by relying on local observation and additional information provided during the offline centralized training phase, the agents manage to learn efficient joint resource allocation. Moreover, the proposed scheme has significantly outperformed the heuristic baselines in terms of total reward accumulated.
In Fig. 3, we compare the average success rate of the users in attaining the delay constraint of the time-sensitive applications. One can observe that the proposed MADDPGbased JCCRA has achieved more than 99% success rate in accomplishing the tasks within the deadline as the training episodes progress. Even though local execution-first policy achieves 100% success rate, the performance comes at the cost of high energy consumption, as reflected in Fig. 2. Moreover, the fact that the policy of the learning agents outperforms the offloading-first baseline implies even if cell-free massive MIMO can provide reliable access links to the users, aggressive computation offloading can result in performance degradation due to ineffective use of the limited resources. We then implemented the proposed MADDPG-based JC-CRA scheme in two different cellular MEC architectures, including a small-cell system and a single-cell system with colocated massive MIMO, to further investigate the gain obtained from cell-free architecture. For the small-cell MEC system, each user is served by a single AP with the largest largescale fading coefficient according to the methodology in [5], whereas in co-located massive MIMO case, each user connects to a base station with total number of N k antennas. From Fig.'s 4(a) and 4(b), we can observe that the proposed algorithm over a cell-free system has significantly outperformed the cellular MEC systems, in terms of average success rate and total reward accumulated. This is attributed to the channel quality degradation due to spatial co-channel interference from other near-by cells in the small-cell system case, while in the singlecell MEC system, users are subjected to large interference from all co-located antennas under MRC, hence limiting the uplink rate for computation offloading.

V. CONCLUSION AND FUTURE WORKS
In this paper, we presented a novel distributed joint communication and computing resource allocation (JCCRA) scheme based on cooperative multi-agent reinforcement learning framework for the cell-free massive MIMO-enabled mobile edge network. More specifically, each trained agent can make intelligent and adaptive joint resource allocation in real-time, based on local observation only, in order to minimize the total energy consumption while meeting the respective delay constraints of the dynamic MEC system. The performance of the proposed distributed JCCRA scheme is shown to converge to the centralized target baseline, without resorting to large overhead. Finally, we have shown that the proposed algorithm in cell-free system has outperformed two cellular MEC systems by wide margins. In the future, it would be interesting to extend the current formulation to determine a set of APs that are adaptive to dynamic user mobility.