scieee AI-readable full text Open interactive document viewer

Automatic synthesis and optimization of chip multiprocessors

Nikitin, Nikita

Abstract

The microprocessor technology has experienced an enormous growth during the last decades. Rapid downscale of the CMOS technology has led to higher operating frequencies and performance densities, facing the fundamental issue of power dissipation. Chip Multiprocessors (CMPs) have become the latest paradigm to improve the power-performance efficiency of computing systems by exploiting the parallelism inherent in applications. Industrial and prototype implementations have already demonstrated the benefits achieved by CMPs with hundreds of cores.CMP architects are challenged to take many complex design decisions. Only a few of them are:- What should be the ratio between the core and cache areas on a chip?- Which core architectures to select?- How many cache levels should the memory subsystem have?- Which interconnect topologies provide efficient on-chip communication?These and many other aspects create a complex multidimensional space for architectural exploration. Design Automation tools become essential to make the architectural exploration feasible under the hard time-to-market constraints. The exploration methods have to be efficient and scalable to handle future generation on-chip architectures with hundreds or thousands of cores.Furthermore, once a CMP has been fabricated, the need for efficient deployment of the many-core processor arises. Intelligent techniques for task mapping and scheduling onto CMPs are necessary to guarantee the full usage of the benefits brought by the many-core technology. These techniques have to consider the peculiarities of the modern architectures, such as availability of enhanced power saving techniques and presence of complex memory hierarchies.This thesis has several objectives. The first objective is to elaborate the methods for efficient analytical modeling and architectural design space exploration of CMPs. The efficiency is achieved by using analytical models instead of simulation, and replacing the exhaustive exploration with an intelligent search strategy. Additionally, these methods incorporate high-level models for physical planning. The related contributions are described in Chapters 3, 4 and 5 of the document.The second objective of this work is to propose a scalable task mapping algorithm onto general-purpose CMPs with power management techniques, for efficient deployment of many-core systems. This contribution is explained in Chapter 6 of this document.Finally, the third objective of this thesis is to address the issues of the on-chip interconnect design and exploration, by developing a model for simultaneous topology customization and deadlock-free routing in Networks-on-Chip. The developed methodology can be applied to various classes of the on-chip systems, ranging from general-purpose chip multiprocessors to application-specific solutions. Chapter 7 describes the proposed model.The presented methods have been thoroughly tested experimentally and the results are described in this dissertation. At the end of the document several possible directions for the future research are proposed.

Full text

TECHNICAL UNIVERSITY OF CATALONIA (UPC) DEPARTMENT OF SOFTWARE Ph.D. Dissertation Automatic Synthesis and Optimization of Chip Multiprocessors Nikita Nikitin Advisor: Prof. Jordi Cortadella February 2013 Abstract The microprocessor technology has experienced an enormous growth during the last decades. Rapid downscale of the CMOS technology has led to higher operating frequencies and performance densities, facing the fundamental issue of power dissipation. Chip Multiprocessors (CMPs) have become the latest paradigm to improve the power-performance efficiency of computing systems by exploiting the parallelism inherent in applications. Industrial and prototype implementations have already demonstrated the benefits achieved by CMPs with hundreds of cores. CMP architects are challenged to take many complex design decisions. Only a few of them are: •What should be the ratio between the core and cache areas on a chip? •Which core architectures to select? •How many cache levels should the memory subsystem have? •Which interconnect topologies provide efficient on-chip communication? These and many other aspects create a complex multidimensional space for architectural exploration. Design Automation tools become essential to make the architectural exploration feasible under the hard time-to-market constraints. The exploration methods have to be efficient and scalable to handle future generation on-chip architectures with hundreds or thousands of cores. Furthermore, once a CMP has been fabricated, the need for efficient deployment of the many-core processor arises. Intelligent techniques for task mapping and scheduling onto CMPs are necessary to guarantee the full usage of the benefits brought by the many-core technology. These techniques have to consider the peculiarities of the modern architectures, such as availability of enhanced power saving techniques and presence of complex memory hierarchies. ii This thesis has several objectives. The first objective is to elaborate the methods for efficient analytical modeling and architectural design space exploration of CMPs. The efficiency is achieved by using analytical models instead of simulation, and replacing the exhaustive exploration with an intelligent search strategy. Additionally, these methods incorporate high-level models for physical planning. The related contributions are described in Chapters 3, 4 and 5 of the document. The second objective of this work is to propose a scalable task mapping algorithm onto general-purpose CMPs with power management techniques, for efficient deployment of many-core systems. This contribution is explained in Chapter 6 of this document. Finally, the third objective of this thesis is to address the issues of the on-chip interconnect design and exploration, by developing a model for simultaneous topology customization and deadlock-free routing in Networks-on-Chip. The developed methodology can be applied to various classes of the on-chip systems, ranging from general-purpose chip multiprocessors to application-specific solutions. Chapter 7 describes the proposed model. The presented methods have been thoroughly tested experimentally and the results are described in this dissertation. At the end of the document several possible directions for the future research are proposed. iii Acknowledgments First of all, I would like to express gratitude to my Ph.D. advisor Prof. Jordi Cortadella for this unique opportunity to work on the thesis in the wonderful city of Barcelona, within a team of talented, open-minded and especially friendly colleagues. These have been great years of experience and unrivaled memories! A special, sincere and warm Thanks to my family. To my Mom and Dad, grandmas and aunt who were always there to listen, share and support my endeavors. To my sister Lialya, eager to exchange the thoughts and feelings, good news and useful lessons learned. To Kate who changed my world with a blink of an eye. I love you all. I would like to acknowledge and thank Prof. Valery Perekatov who noticed my abilities in research and convinced me this would be a worth path to follow. I am also very thankful to Prof. Alexander Marchenko who assisted me in gaining first industrial experience, which essentially contributed to my skills. Another very special gratitude is to Dima Bufistov, Gladys Utrera and Josep Carmona, who became my friends almost as soon as I landed in Barcelona for the first time, guided me though the very first steps in Spain and kept assisting all these years. And my gratitude to Marc Galceran who has been an excellent guide during my first US trip. Thank you all so much! A big thanks for sharing the amazing time together and helping with great ideas to all colleagues from UPC and Intel Corporation, especially to Javier de San Pedro, Cesc Guim, Mike Kishinevsky, Umit Ogras, Jordi Petit and Sat Chatterjee. This time would not had been so exciting without all of you guys, who I met in the office S108 of Edifici Ω. An astonishing team of the office mates with a great sense of humor and excellent problem solving capabilities (I’ll never forget our puzzling activities at the whiteboard) is who I was awarded with for the thesis years. Finally, this page would be incomplete without acknowledging the effort of all people at UPC who make the life of (international) students easier, and in particular, Merc`e Juan Badia, Maria Serna and Anna F`abregas. Thank you! This work has been supported by a scholarship from Spanish Ministry of Science and Innovation (FPI grant BES-2008-004612), a gift from Intel Corporation and research project FORMALISM (CICYT TIN2007-66523). iv Contents 1 Introduction 1 1.1 Design challenges for CMPs and NoCs . . . . . . . . . . . . . . . . . 4 1.2 Motivation and contributions . . . . . . . . . . . . . . . . . . . . . . 7 1.3 Document organization . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 The Architecture of Chip Multiprocessors 13 2.1 Processingcores.............................. 14 2.2 Memorysubsystem............................ 16 2.3 On-chip interconnects . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.4 Networks-on-Chip............................. 21 2.5 Relatedwork ............................... 32 3 Modeling Networks with Constant Service-Time Routers 41 3.1 Modeloverview .............................. 42 3.2 Queueingmodel.............................. 44 3.3 Networkmodel .............................. 50 3.4 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 3.5 Conclusions ................................ 57 4 Analytical Modeling of CMP Architectures 59 4.1 The importance of contention: an example . . . . . . . . . . . . . . . 59 4.2 Analytical performance model . . . . . . . . . . . . . . . . . . . . . . 61 4.3 Analytical methods for latency estimation . . . . . . . . . . . . . . . 67 4.4 Extensions of the model . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.5 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 4.6 Conclusions ................................ 78 vi 5 Metaheuristics for Architectural Exploration 81 5.1 The Exploration Problem . . . . . . . . . . . . . . . . . . . . . . . . 81 5.2 Transformations.............................. 84 5.3 Exploration with Simulated Annealing . . . . . . . . . . . . . . . . . 87 5.4 Exploration with Extremal Optimization . . . . . . . . . . . . . . . . 89 5.5 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 5.6 Conclusions ................................ 97 6 Static Task Mapping for Tiled Chip Multiprocessors 99 6.1 An example of the mapping problem . . . . . . . . . . . . . . . . . . 100 6.2 A mathematical model . . . . . . . . . . . . . . . . . . . . . . . . . . 102 6.3 Mapping by metaheuristics . . . . . . . . . . . . . . . . . . . . . . . . 109 6.4 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 6.5 Conclusions ................................120 7 Link Allocation for NoC Topologies 123 7.1 Modeloverview..............................124 7.2 The integer programming model . . . . . . . . . . . . . . . . . . . . . 126 7.3 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 7.4 Conclusions ................................144 8 Conclusions and Future Work 145 Bibliography 148 vii Chapter 1 Introduction The performance of microprocessors has improved drastically in the last few decades. For many years, the increase in operating frequencies, driven by the rapid downscale of the CMOS technology, has served the primary source for performance improvement of computing systems. Several important architectural decisions have been introduced, which now represent widely adopted paradigms for microprocessor design [64]. Instruction pipelining is a technique used to increase the system throughput and fully exploit the benefits of the high clock rates. Superscalar processors improve single-threaded performance by addressing the instruction-level parallelism (ILP) inherent in applications. ILP refers to a group of instructions, for which the result of every instruction from the group does not depend on the result of the other instructions from the same group. Hence, superscalar architectures have multiple execution units to process such groups of instructions simultaneously. Out-of-order execution extends superscalarity for ILP-driven optimization. It offers on-the-fly reordering of instructions to prioritize execution of those, for which the input data has already been obtained. The constantly increasing gap between the performance of the processing and memory units, known as the memory wall problem [136] imposed significant limitations on the overall performance of Von Neumann architectures. Luckily, the observation of the spatial and temporal locality of memory accesses made it possible to reduce the severity of this problem by incorporating fast, although low-capacity on-chip caches. As the manufacturing process advanced, the growing transistor budget was further used to alleviate this problem by incorporating larger caches, effectively hiding the memory access latency. However, as the cache latency increased with its size, the growth in the cache size was penalized. This led to the hierarchical organization of memory subsystem with several levels of on-chip cache, trading-off the hit-ratio and the access latency, and exploiting the locality of memory references. 1 1 10 100 1000 10000 1E+05 1E+06 1E+07 1E+08 1E+09 1E+10 1E+11 1E+12 1E+13 Simulation (full system) Simulation (probabilistic) Analytical (exhaustive) Analytical (metaheuristic) Exploration runtime (sec) Design space: 109configurations 300 centuries 300 years 100 days 100 seconds Figure 1.4: Comparison of runtimes for various exploration strategies. Many design options must be explored, such as the variety of core implementations, interconnect types, topologies, cache hierarchies and memory management policies. Moreover, the amount of configurations increases drastically as the technology advances, allowing more cores and memory to fit into the chip area. The complexity of the search space makes an exhaustive simulation-driven exploration prohibitively expensive. One of the ways to handle this problem is to decrease the number of points to be considered. Exhaustive exploration is replaced by an intelligent search strategy leveraging the methods of machine learning [77], design of experiments [124] or analytical optimization [31]. Another option to shorten the exploration time is to reduce the cost of evaluating every design point. In this scenario, analytical modeling becomes an effective alternative to simulation for rapidly pruning the design space during early exploration and selecting a small set of promising configurations. Along this line, several analytical models for CMP exploration have been recently proposed (e.g., [107, 31]). However, the use of analytical models alone is not enough for efficient exploration. Figure 1.4 gives an idea of the ratio of exploration run times, when a simulator or an analytical model is used to estimate the cost of architectures. For a search space comprised of one billion configurations, the exploration task is intractable even when a fast probabilistic simulator is used. Analytical modeling reduces run time to approximately 100 days, which is a feasible period assuming the design cycle of several years, though the timing cost of fixing an error committed at this stage remains very high. Implementation of the intelligent search strategies (e.g. metaheuristics) on top of the analytical model allows to further decrease the search time to the order of minutes, making the exploration tool a very efficient instrument for the designer. 8 This thesis addresses the techniques for analytical modeling of CMPs and the on-chip interconnects in Chapters 3 and 4. A method for intelligent design space exploration is proposed in Chapter 5. Application mapping for tiled CMPs From a certain point of view, a tiled CMP is similar to a coarse-granularity programmable array (FPGA), with general-purpose logic, specialized units (memories, DSPs) and a distributed communication network for routing. The main difference is that CMPs are software-configurable, whereas FPGAs are hardware-configurable. In a similar way a design has to be transferred to FPGA, an application has to be mapped onto the target CMP. One of the peculiarities of mapping onto tiled CMPs is the presence of heterogeneous tiles, preserving the regularity of the structure, but introducing several classes of processors [86, 14, 38]. Such systems may include some specialized processors (e.g., graphics, DSP) or different implementations of the same architecture (e.g., in-order/out-of-order, multi-threading) with varied power-performance tradeoffs. Figure 1.5 depicts a tiled CMP with three classes of tiles: general-purpose cores (C), cores with graphics units (G) and DSPs (D). CMPs are designed to operate under a certain power budget that assures the performance and thermal properties of the system. One of the most effective ways to manage power is to floorplan various voltage islands and assign the best voltage and frequency for each core [82]. Unfortunately, voltage islands have a high design cost. Firstly, the floorplanning of the system is constrained by the design of the power delivery network and the location of the level shifters. Secondly, and more important, power management requires different voltage regulators for each power supply. Off-chip regulators need extra area on the PCB that may be unacceptable if the system has a large amount of power domains. On-chip regulators involve a significant area overhead and power consumption due to the large inductances and switching capacitors required to provide a stable supply voltage [79]. CCCC C G D C C D G C CCCC Core L2 L1 R MC MC Figure 1.5: Tiled heterogeneous CMP architecture. 9 It is therefore realistic to consider that future CMPs will have many cores (hundreds) and voltage islands with several cores (e.g., 4 or 8). This fact imposes an additional constraint in the task mapping problem: even though some cores could possibly run at lower voltages and frequencies, sharing the island with other cores may prevent from taking advantage of this flexibility. Hence, it is convenient to allocate tasks in a way that cores within the same voltage islands can share similar voltage/frequency parameters. The mapping problem for tiled CMPs has to assume that the chip has already been manufactured. Therefore, the voltage islands have been already floorplanned and the maximum bandwidth of the links between cores is also known a priori. Another peculiarity of CMP mapping (as opposed to SoCs), is the presence of traffic to the off-chip memory, as well as the limited bandwidth of the memory controllers (MCs). Finally, the methods proposed for task mapping must be scalable and suitable to handle systems with hundreds of cores. Chapter 6 describes the contribution of this thesis in the field of application mapping onto tiled heterogeneous CMPs with predefined voltage islands. Network-on-Chip topology customization and routing Consider an example of a system, which is specified by a set of processing elements (PE), routers and communication requirements between PEs. Assume that the underlying system topology has been selected and the assignment of the PEs to the routers has been performed. Some of the design problems one would like to solve are: •Finding a subset of links satisfying the communication requirements of the system and minimizing the design cost. •Defining the routing paths for each pair of communicating PEs that satisfy the performance requirements. •Guaranteeing that the selected routes to communicate PEs are deadlock-free. The first problem can be referred to as the link allocation problem. The other two problems are related to the efficient route assignment with deadlock avoidance. These problems have different optimization criteria. By solving one of them optimally and independently from the others, no acceptable solution might be found when solving the subsequent problems. It is therefore necessary to devise nonmyopic strategies to explore the solution space in a way that all design constraints are met and the implementation cost is minimized. Chapter 7 describes the last contribution of this thesis for the simultaneous interconnect topology customization by link allocation and routing. 10 1.3 Document organization The dissertation is organized as follows: •Chapter 2 gives an overview of the chip multiprocessing technology and summarizes related work in the field of CMP and NoC synthesis and optimization. •Chapter 3 presents the first contribution of the thesis, which is an analytical model for a special class of networks-on-chip with constant-length data packets. This specific class of the interconnects finds application in CMP systems. •Chapter 4 describes the second contribution of the thesis, representing an analytical modeling of the complete CMP. This section emphasizes the importance of modeling contention of the CMP interconnect and captures the cyclic dependency between the latency and traffic of memory requests. •Chapter 5 proposes a metaheuristic-based intelligent search of the design space to eliminate the need for exhaustive architectural exploration for CMPs. This technique is the third contribution of the thesis. •Chapter 6 addresses the issues of efficient usage of general-purpose CMPs after fabrication. A task mapping algorithm for tiled CMPs with multiple voltage islands for power management is proposed in this section, which is another contribution of this work. •Chapter 7 represents the last contribution of the thesis, which is a mathematical model for simultaneous topology customization by link allocation and deadlock-free route assignment for NoCs. •Chapter 8 concludes the work and outlines possible directions for future research. 11 Chapter 2 The Architecture of Chip Multiprocessors This chapter provides a brief overview of the chip multiprocessor architecture, with the objective to understand the problem domain and help evaluating the contributions of this thesis. Last section of the chapter summarizes the work in the field, relevant to the problems considered in this dissertation. When examining the organization of a chip multiprocessor, one may find certain similarities with the structure of a single-core processor. Basic components of the latter would include a processing unit (ALU), memory units (registers and L1-cache), a control unit, a datapath and an input/output subsystem. The components of a chip multiprocessor resemble most of those found in a single-core implementation: •The processing cores are the computing units executing the instruction flow. These may be general-purpose or application-specific processors, offering various cost/performance trade-offs for a variety of workloads. •The memory subsystem is a collection of memory units representing a trade-off between the memory capacity and access latency. On-chip components include the private and shared cache modules. •The on-chip interconnect is the backbone of a chip multiprocessor, providing communication between the cores, memory units and input/output interface. The topic of interconnect design for efficient on-chip communication is of special interest for this work. •The input/output interface is a set of controllers to interact with the off-chip components of the computing system. Memory controllers can be considered as a part of I/O interface, providing access to the off-chip memory. Another example is a Quick-Path Interconnect (QPI) [71]. 13 For the problems addressed in this work, the cores, memories and on-chip interconnects represent the CMP components of major interest. In the following sections an overview of the design alternatives for each of these component types is given. 2.1 Processing cores Cores are the main processing units executing the instruction flow. Modern CMP architectures include from several up to hundreds of processing units [73, 118, 119, 74]. The cores of a homogeneous CMP are identical, while heterogeneous architectures may include various combinations of core implementations for speeding-up particular applications. One of the popular examples of a heterogeneous CMP is the IBM Cell processor [38]. The first computing cores were implemented as sequential finite-state machines for loading, executing and writing the result of the instructions, as given by the original instruction flow. The processing of every instruction could take several cycles limiting the overall performance of the core, measured in instructions per second. It was observed that in the given implementation certain modules of computing logic would stall while waiting for the other modules to complete their job: for example, the execution unit would wait for the instruction loading to bring the data in for processing. Instruction pipelining was proposed to introduce parallelism and increase the effective load of independent pipeline modules [22]. The flow of instruction processing is divided into several stages and every stage is executed within an individual clock cycle in a pipelined fashion. The stages of a typical pipeline include instruction fetch,decode,execute and memory write. Although this technique does not improve the latency of executing a single instruction, it raises the core throughput and enables higher operating frequencies. It was further noticed that the instruction flow of many applications is inherently parallel, in the sense that there exist groups of instructions whose result does not depend on the other instructions in the group. This property is referred to as instruction-level parallelism (ILP) of the application. All instructions in every such group can be executed in parallel without affecting the result of the program. This observation led to the decision of supplying cores with multiple execution units, which could handle parallel instructions simultaneously, reducing the total execution time of the program. Cores with replicated execution units are referred to as superscalar. Still, superscalarity enabled the execution of multiple instructions in parallel only when the instructions followed one another in the original instruction flow. In other words, superscalar architectures represented an example of in-order execution of the instruction flow. Performance was considerably penalized in cases when a long- 14 latency memory request was issued, causing the whole pipeline to stall for a long number of cycles. Out-of-order execution was proposed to extend the benefits of ILP by locally reordering the instruction flow, and giving priority to those instructions for which the input data had already been computed. An analysis of dependencies in the instruction flow is required to guarantee that the program result is not affected by the manipulations with the order. While superscalar and out-of-order architectures aim at automating the search of ILP by hardware, Very Long Instruction Word (VLIW ) [54] architectures delegate the responsibility of finding ILP to software, either at the compiler or programmer level. VLIW processors realize a set of “wide” instructions, each implementing several operations (e.g. a sum, an increment and a multiply). The task of defining the instruction patterns is deferred to software, which is shown to be convenient for certain application domains, where such operation patterns are common (e.g. DSP or numerical computations). Finally, simultaneous multi-threading (SMT) [126] emerged to exploit the threadlevel parallelism (TLP), as opposed to ILP. There are two primary sources of TLP. First, as in the case of VLIW architectures, TLP can be specified explicitly by the programmer within the software development process. Second, TLP often appears due to the fact that one core is commonly used to run several applications simultaneously. Hence, modern cores implement multi-threading support by replicating the thread-processing units. An interesting observation regarding the efficiency of advances in single-core implementations is known as the Pollack’s rule [29] [116]. It states that the core performance, in terms of instructions per cycle,IPCc, only grows as a square root of the core area Ac: IPCc=α·pAc, where αdenotes the performance of a basic core chosen for comparison. Figure 2.1 plots an illustration of Pollack’s rule from [42], constructed for more than a hundred of real processor implementations, using the data from Stanford CPU Database [4]. The performance and area of Intel 80386 processor are used as a baseline. This rule has served as one of the motivations for chip multiprocessing, favoring instantiation of a multitude of simpler cores rather than several complex designs, for the purpose of throughput optimization [108]. However, it is worth noting that Pollack’s rule only predicts a generic trend between performance and cost of single core architectures. Depending on the type of workload, the amount of ILP and TLP in the executed application, a CMP with more complex out-of-order cores may deliver more throughput than the one comprised of many simple core implementations. 15 Figure 2.1: Pollack’s rule for processing cores [42], [4]. The problem of searching for the throughput-optimal CMP architecture, given a library of components and application workloads, is one of the major problems addressed by this thesis. 2.2 Memory subsystem Processing cores execute instructions that operate on data. Both instructions and data are stored in memory, and hence its organization has a significant impact on the overall performance of the computing system. Since its conception, dynamic RAM technology continuously evolved, with about 15% increase in performance and 2×increase in density every two years [29]. At the same time, the performance of processing cores advanced exponentially, leading to the constantly growing gap between the performance of computing and memory units, known as the memory wall [136]. The principle of locality of the memory references helped to alleviate the memory wall problem. It was observed that at least two major types of locality are inherent to the memory access patterns. Temporal locality refers to the fact that if a particular memory address is accessed at some moment in time, it is very likely that the same address will be requested again in the near future. Spatial locality observes also that 16 Private cache Private cache Shared cache Main memory Permanent storage Core (registers) On-chip memoryOff-chip memory Core (registers) Capacity Latency Tens GBs - TBs GBs Tens of MBs Tens of KBs - MBs Hundreds of bytes 1 cycle 2-10 cycles Tens of cycles Hundreds of cycles Thousands and millions of cycles Figure 2.2: Hierarchical organization of memory subsystem. if a particular memory address is accessed at some moment in time, it is very likely that the nearby addresses will be requested in the near future. These observations made it possible to effectively reduce the average memory latency by organizing fast caches of moderate sizes, even when it is not feasible to supply fast and large memory which would store all data requested by applications. According to the principle of locality, the regions of memory which have a high probability of being accessed in the near future are loaded and kept in the caches for improving the average memory latency. The introduction of caches led to hierarchical organizations of the memory subsystem, which includes several layers of memories of increasing sizes and latencies. Figure 2.2 gives an overview of the hierarchical organization. In addition to the core registers, which have a very fast access time, but a limited capacity of only hundreds of bytes, the on-chip memory subsystem is represented by several levels of cache. The fastest private first-level cache, L1, typically has the latency of several cycles and a capacity of tens of kilobytes. A larger private cache, L2, can be added, providing capacities of several MBs and latencies around ten cycles. A shared cache of a larger size, often called a last-level cache, LLC is included to extend the onchip memory with a flexible storage, which can be redistributed among the cores according to the needs of the executed applications. The off-chip memory subsystem includes the main dynamic RAM and the permanent storage. The capacities of the former have the order of GBs at the expense of 17 Meshes A 2-dimensional mesh, depicted in Fig. 2.6(a), is the most widely adopted topology for network-on-chip, both in research and industry. Its popularity is determined by several factors, such as regularity, good physical properties and scalability. The layout of regular 2D mesh facilitates the chip floorplanning and is especially valuable for tiled architectures, which are popular for rapid prototyping of many-core systems. Indeed, to extend the mesh to an arbitrary number of nodes one simply needs to add rows or columns to the mesh without the need to redesign the basic network components, such as routers and links. The family of mesh topologies is known as k-ary n-meshes, where kdefines the number of nodes per dimension and nis the number of dimensions. Meshes with dimensions of three and higher have a limited applicability due to issues of physical implementation. Figure 2.6(b) sketches a 3D mesh (cube), which despite its nice theoretical properties, has to be planarized when implemented in traditional CMOS technology. Planarization leads to an increase of delay in certain links, so the final performance of this topology will be strongly affected by physical implementation. It is worth noting that with the emergence of three-dimensional semiconductor technologies (e.g. stacked memories), 3D topologies become more popular. However, the interest in meshes of higher dimensions is still limited to the research community. Although meshes can adopt any arbitrary number of components without significant design effort, they are considered to be poorly scalable: the network diameter grows linearly with the mesh dimensions and its bisection bandwidth scales slower than the communication requirements, as the number of components increases. Concentrated mesh or C-mesh was proposed to decrease the average latency in traditional meshes (Fig. 2.7(a)). The reduction in latency is obtained through the increase of router degree and concentration of larger number of nodes at one router. Although this organization incurs a penalty on network throughput, it becomes beneficial when a certain degree of traffic locality is observed. Another family of solutions that improve network performance in presence of local traffic is hierarchical mesh-based topologies. An example of two-level mesh-bus architecture is shown in Fig. 2.7(b). Similar to a hierarchical bus, this topology implements individual low-latency bus interconnects for local communication in clusters. Additionally, a high-throughput global mesh is responsible for inter-cluster communication. The benefit of hierarchical approach is the separation of local and global traffic for eliminating their interference, although at the cost of additional resource consumption. Hierarchical meshes are of high interest for this work, since they are considered as a promising architecture for low-power high-performance interconnects of CMPs with hundreds or even thousands of computing units. 24 R R R R R R R R R R R R R R R R (a) 2D mesh (4-ary 2-mesh) R R R R R RR R (b) 3D cube (2-ary 3-mesh) Figure 2.6: K-ary n-mesh topologies. R R R R (a) Concentrated mesh NI A NI A NI A NI A R R R R (b) Hierarchical mesh-bus NoC Figure 2.7: Extensions of 2D meshes. R R R R R R R R R R R Figure 2.8: Irregular mesh topology. 25 Finally, irregular meshes represent a specific class of mesh-based topologies, which are especially popular among the ASIC community, where heterogeneous nodes (i.e. cores, memories) appear frequently. Heterogeneity of node sizes leads to irregular floorplans, which as Figure 2.8 proposes, can be arranged in a grid of a fine granularity and effectively connected by a mesh-based structure. The obtained mesh may miss some routers, as compared to a regular implementation; the links may have different lengths and router degrees may vary - explaining the “irregular mesh” terminology. The fact that the interconnect topology is grid-based speeds-up the design time considerably, making irregular meshes popular for application-specific systems. The aspects related to mesh topology customization are considered later in this thesis. Tori and rings A two-dimensional torus is another widely used solution for NoCs and represents a mesh with added wraparound links, as in Fig. 2.9(a). The torus family is denoted as k-ary n-cubes, with the same notation for kand nas in the case of meshes. Tori of dimension two and higher are exposed to the same planarization problems as high-dimension meshes. Depending on the implementation, wraparound links may exhibit delays similar to traversing the whole chip in one dimension. For certain chip sizes this results into a severe mismatch between the predicted link delay and its silicon realization, causing a noticeable performance penalty. One-dimensional tori, also known as rings (Fig. 2.9(b)) represent another example of broadly applied topologies, due to several convenient properties. First, rings are regular symmetric topologies which are easily floorplanned and implemented in silicon. One can choose among uni-directional and bi-directional ring implementations to explore typical cost/performance trade-off. Another reason for using rings R R R R R R R R R R R R R R R R (a) 2D torus (4-ary 2-cube) R R RR R R (b) Ring (6-ary 1-cube) Figure 2.9: K-ary n-cube topologies. 26 is the low router degree, consisting of only three ports for uni-directional or four ports for bi-directional rings, thus simplifying router design and cost significantly. The drawback of rings is the low bisection bandwidth, which is however compensated by low area and power requirements, making rings a good choice for hierarchical interconnect architectures. Fat-trees and butterflies As opposed to meshes and tori, which are examples of direct topologies, fat-trees represent indirect topologies, implemented as multistage interconnect networks (MINs), as shown in Fig. 2.10(a). The data has to traverse several stages of intermediate routers in order to reach destination. The main benefit of this topology is the high bisection bandwidth, which scales linearly with the number of network nodes. Nevertheless, the cost of increased bandwidth is paid with the augmenting number of routers. Even more important, the problem of physical implementation of the MIN-based topologies in silicon appears due to the complex wiring between routers. Fat-tree topologies continue raising interest in the domain of optical interconnects. Recent techniques aimed at improving the physical planning of NoCs based on fat-trees [138]. Butterfly networks are also based on MINs and similar in their physical structure to fat-trees. However, these are uni-directional interconnects, with sender and receiver nodes situated along the opposite sides of the network (Fig. 2.10(b)). The routing path between any sender-receiver pair in butterfly network has a predetermined number of stages. The drawback of this topology is the existence of only one path between a communicating pair of nodes. This observation requires additional mechanisms for implementing fault-tolerance techniques in the presence of faulty links or routers. A similar notation is used for k-ary n-trees and k-ary n-flies, where kdenotes the number of nodes connected to each router and nis the number of MIN stages. RRRR RR RRRR RR (a) Fat-tree (2-ary 3-tree) RRRR RR RRRR RR (b) Butterfly (2-ary 3-fly) Figure 2.10: Trees and butterflies. 27 Switching The switching technique determines the policy for allocating the network resources required for data transmission through the interconnect. Several switching schemes are considered in this section. The technique of reserving a dedicated channel between sender and receiver is referred to as circuit switching. Prior to any data transmission, a path has to be allocated between the two nodes, guaranteeing that all shared resources have been properly allocated and the data can be commuted avoiding interference with other flows. Once the data transmission has been completed, the path is deallocated and its resources are released to favor communication of other flows. The major benefit of circuit switching is the absence of contention between different flows. This property eliminates the need for buffering resources, effectively reducing the NoC area and power requirements. On the other hand, the need for path allocation and deallocation not only introduces a performance penalty, but also reduces the amount of parallelism in communication. Indeed, the requirement to establish and maintain a path between different parts of the network reserves resources unnecessarily, blocking the data transmission of the other flows with a high probability. Packet switching is an alternative approach which does not require path reservation, since the data packets determine their paths independently as they propagate through the network. Sending data in packets allows communication at a finer level of granularity. The downside of the technique is a chance for contention when several packets compete for the same shared resource, such as a network link. This implies the allocation of buffer resources across the network so that the packets can be temporarily stored and then forwarded, after contention has been resolved. The basic implementation of packet switching is hence referred to as store-and- forward. Every router input is provided with a buffer space, with a size greater or equal to the size of one data packet. In this scenario, a blocked packet is stored in the input buffer and waits for the output channel to be released. Consequently, the requirements for a packet to continue transmission is the availability of the output channel as well as the sufficient amount of buffer space at a receiving router. The requirement for the complete packet to arrive at the router input before initiating its transmission through the router was found too restrictive. Since packets are typically formed by a number of smaller fragments, called flits (flow units), the header flit of the packet was allowed to start transmission through the router before the whole packet arrived to the router input. This approach was called virtual cutthrough and allowed for slight performance improvement over the store-and-forward technique. 28 Later, the virtual cut-through scheme was extended and applied to the whole sequence of flits. This new scheme was called wormhole switching. The wormhole paradigm considers a packet as a sequence of flits, led by the header flit. As the header flit propagates through the network, it establishes the path, so that the subsequent flits follow the same path in order, experiencing no contention from the other packets. The path is reserved until the tail flit of the packet propagates, deallocating the resources. In this sense packet propagation resembles the behavior of a worm, stretching across several network routers, and contributing to the name of the technique. Wormhole switching considerably reduces the buffering requirements of a NoC, though the inter-packet contention is increased, as distributed packets block a higher number of router resources. The addition of virtual channels to wormhole switching allows to alleviate the contention problem at the cost of larger buffer space. The concept of a virtual channel is used to denote a buffered logical channel for transmitting data between sender and receiver. Virtual channel has a dedicated physical buffer, however one physical link is multiplexed between several virtual channels. Assuming Nvirtual channels, the total buffer space of the router inputs is subdivided into Nsmaller buffers, while Nvirtual links are multiplexed over one physical link. This organization enables the support of Nmessage classes, whose packets are stored in individual buffers at every router, and hence avoid blocking packets among different message classes. The wormhole technique is the widely adopted scheme for switching in NoCs and is the one that will be assumed in the work presented in this thesis. Flow Control The mechanisms of flow control actually govern the process of packet and flit propagation in the network. They define the conditions for the data units to advance and guarantee the correctness of data transmission. A simple approach to manage data propagation is for the receiver to send an acknowledgment to the sender, once the data has been received. For this purpose, an ack signal is emitted by the receiver if the data has been accepted successfully, or a negative acknowledgment nack otherwise. This scheme is known as ack/nack flow control. An alternative approach, which eliminates the unnecessary data transmission if the receiver is not ready to accept data, is to supply every sender with a go/stop signal governed by the receiver. The receiver maintains the signal in the go state while it is ready to accept new data and changes it to the stop state otherwise. A more advanced flow control technique is realized by means of credit exchange between sender and receiver. Every sender is assigned an initial number of credits, specifying the amount of data units which the sender is allowed to transmit. The 29 sender can only transmit data when its credit is positive. The transmission of every data unit decrements the number of available credits. This mechanism prevents the buffer overflow at the receiver if the initial number of credits does not exceed the buffer size. The receiver in turn supplies sender with additional credits as soon as the data units depart from the buffer so that the sender is able to resume data transmission. Routing The routing strategy has a significant impact on network performance. Routing algorithms are used to determine the actual paths of packet propagation through the network. Every path is defined by the sequence of links and routers that the packet uses to travel between the sender and the receiver. Routing algorithms can be classified according to the following criteria [92]: •Static vs. dynamic routing. Static (also known as deterministic) algorithms define the paths for every sender-receiver pair prior to the beginning of data transmission and these paths remain fixed throughout the communication process. Dynamic (also known as adaptive) algorithms generate paths for every packet, considering the current state of the network, typically with the objective of avoiding congestion regions and minimize packet latency. •Minimal vs. non-minimal routing. Minimal algorithms generate routes with the minimum hop-count between source and destination nodes, while nonminimal algorithms can favor longer paths for better communication properties (e.g. load distribution or fault tolerance). •Source vs. distributed routing. In source routing, the complete path for a packet is defined at the source node and is incorporated in the packet header for taking routing decisions as the packet propagates through the network. In distributed routing the directions for a packet at every router are taken locally, typically by using routing tables. An important and widely-used category of deterministic minimal routing algorithm, suited for regular topologies such as meshes and tori, is dimension-ordered routing [92]. With this approach, an order for the dimensions of the topology is defined and the packets are always sent according to the selected order of dimensions. A popular dimension-ordered algorithm for 2D topologies is XY-routing, when the packets are first routed in the X-dimension and then by the Y-dimension. 30 Deadlock avoidance is one of the important properties of the routing algorithm, which can be achieved by dimension-ordered routing in certain topologies (i.e. meshes and hypercubes) or alternatively by prohibiting routes from taking certain turns of the topology [59, 34]. A generic approach to guaranteeing deadlock freedom for both static and adaptive routing algorithms is based on resolving cyclic dependencies in the channel dependency graph [50, 52]. Router Architecture A router is a basic building block of an on-chip network, which performs the principle tasks for enabling communication: data buffering, arbitration and switching. The architecture of an on-chip router is highly dependent on its implementation. Figure 2.11 outlines a generic structure of a router with ninputs, moutputs and k virtual channels [58]. The main components include the input buffers, routing and switching logic, and a crossbar switch. The internal operation of a router can be well understood by considering how a single flit traverses the router. This process can be summarized by the following steps: •Buffering is performed when a flit arrives at an input port. For this purpose, every input port implements a collection of buffering slots, which can be separated into kgroups to support kvirtual channels. In the latter case, the arriving flits are demultiplexed from the physical link and stored in the appropriate buffer. Credits are delivered to the sender as the buffer slots become available, to resume data transmission. •Route computation is the first step in calculating the output port, to which the flit has to be transmitted. The route computation logic can be designed either to extract the routing information from the flit itself, as in source routing, or to consult the routing tables, as in distributed routing. •Virtual channel allocation is the following step, aimed at configuring the index of the virtual channel at the output port. The virtual channel allocation logic also selects the flit to be transmitted in the current cycle, among the flits waiting for transmission at the input virtual channels (as shown in the figure). •Switch allocation aims at configuring the crossbar to connect the selected inputs with the outputs, according to the routing decision for the current cycle. •Switch traversal finalizes the process of router traversal for a flit, after which the flit continues its path through the output link. 31 Input port 1 ... Route computation X-bar Virtual channel allocation Switch allocation vc 1 vc k Data in Credit out Input port n ... vc 1 vc k Data in Credit out ... Data out 1 Credits in Data out m Figure 2.11: On-chip router architecture. Note that depending on the implementation, some of the previous stages can be pre-computed (e.g. route computation) or performed in parallel (e.g. virtual channel and switch allocation), effectively reducing the router latency. 2.5 Related work This section presents an overview of the state-of-art related to the problems addressed by this thesis. Analytical modeling of on-chip interconnects The problem of analytical modeling of on-chip interconnects aims at estimating the system parameters (e.g. throughput, power, total latency) analytically, without the need for simulation. In this section we consider the problem of modeling the total latency for the data requests to traverse the interconnect from source to destination nodes. This latency consists of two terms. The first term is the static (or hop-count) latency, which depends on the geometrical distance between the source and destination nodes, and hence can be predicted statically, once the interconnect topology and the routing function have been defined. The second component is the dynamic 32 R R R R CL CL CL CL MC MC (a) R C1C2NI DIRL3 (b) Figure 2.12: Queueing model for (a) mesh NoC and (b) bus-based cluster. (or contention) latency. Contention happens in the interconnect when several data requests compete for the same shared resource, such as a bus or a NoC link. This results in additional delays experienced by the data in the buffers (queues) distributed over the on-chip interconnect. The first analytical models appeared for basic types of multiprocessor interconnection networks, such as buses, multiple buses and crossbars [23, 121]. The emergence of more complex on-chip interconnects attracted a variety of novel techniques to the traffic modeling problem. Figure 2.12 depicts a generic structure of a CMP with a hierarchical network-on- chip interconnect. Without loss of generality, a two-level hierarchical interconnect is shown, with a 2D mesh at the top level. Figure 2.12(a) shows the queueing representation of the top-level mesh. The mesh routers (R) have up to five inputbuffered ports to store the incoming flits. The primary ports of the routers are connected to the clusters (CL), which in case of a flat CMP organization may consist of one device (e.g. a core with private caches in Figure 1.3(a)). Figure 2.12(b) presents an example of queueing model for a bus-based cluster, corresponding to one tile of the hierarchical CMP. This cluster consists of five devices, communicating via a shared bus: two cores with private caches, an instance of an L3 shared cache, a directory and a network interface. Every device has a buffer to store the requests to the bus. To distribute the off-chip memory traffic uniformly over the mesh and avoid high contention of certain routers, memory controllers may have multiple connections to the mesh, as shown in Figure 2.12(a). One of the approaches to estimate the contention delays in the interconnect is to apply queuing theory (QT) [81]. This technique models every router (or bus) as a single server and estimates the waiting time in the input queues of the server. In this work, one of the common flow control techniques is considered: the wormhole routing [40]. Multiple analytical models have been proposed for wormhole routers, but most of them are based on the standard M/G/1 and M/M/1 queueing models. A simplified M/G/1-based model is proposed in [49]. The model in [103] offers a convenient definition of queue delays via the injection rates in a closed form. The method calculates the probabilities of the packets coming 33 and turn prohibition [59] schemes were developed to guarantee deadlock-freedom in meshes. A more general approach to deadlock-free routing is based on the construction and analysis of the channel-dependency graph, with the objective to remove cyclic dependencies [52, 39]. Insertion of virtual channels to resolve cycles in the channel-dependency graph for deterministic routing was first proposed in [40]. In [51] a necessary and sufficient condition for deadlock-free adaptive routing functions were formulated and [50] proposed two methodologies for deadlock-free adaptive routing by insertion of either virtual or physical channels for improved fault-tolerance. 40 Chapter 3 Modeling Networks with Constant Service-Time Routers This chapter describes the first contribution of the thesis, which is the queuing model for estimating the average end-to-end latency in NoC. The model addresses a special class of networks with fixed packet length. This assumption holds for certain on-chip systems, such as CMPs, where the data packets carry cache lines of a fixed size. This research was published in [100]. The objective of the analytical model for on-chip interconnect is to provide a rapid and accurate estimation of the network contention delay. Queueing theory (QT) [81] is often used to model the network contention. QT represents a technique to estimate the queueing delays of users waiting for some service of the system, given the customer distribution and the service process characteristics. Therefore it can be applied to model the delays of packets waiting for the router service. The QT provides an M/D/1 model describing a system with Poisson input and constant service time [20]. This work shows that due to the correlation of packet size and service time, the Poisson property of the flow degrades as packets propagate through the network. This dependency affects substantially the delay values so that the M/D/1 modeling with the Poisson input assumption is no longer accurate. Hence [100] proposes a number of intuitive equations to significantly improve the delay estimation accuracy for the networks with constant service-time routers (CSTR). The new model is referred to as the constant-time model (CTM). 41 3.1 Model overview Modeling a network as a system of routers requires an approach for calculating packet delays depending on the network topology. An example of a 3x3 mesh network is presented in Figure 3.1. Each router (R) is connected to a processing element (PE) and a set of neighboring routers by two unidirectional links. In our model we focus on the delay estimation (waiting time) at the input buffers. Hence, we assume each router to have an input buffer from each neighbor and one from the PE. A net is an end-to-end route in the network, from one PE to another, and can be represented as a sequence of routers that a packet must propagate through. Each router may have an arbitrary number of input channels. Consider the simple example in Fig. 3.2: a chain of two servers with constant service time Tand a Poisson arrival process with rate λ1. The classical QT model for a constant-time server with Poisson input is the M/D/1 model. The waiting time in the first input queue WS1can be estimated using Pollaczek-Khinchin (P-K) formula [81]: W=λT2 2(1 −λT).(3.1) However, unlike the systems with exponentially distributed service times, the output from an M/D/1 system is no longer a Poisson process: the time between two consecutive outputs is guaranteed to be greater than or equal to the service time value T. In other words, a constant-time server produces a de-randomization of the Poisson process, thus reducing the degree of randomness of the inter-arrival times, which is the main cause of contention delays at the input queue. R RR R RR R RR PE PEPE PE PEPE PE PEPE Figure 3.1: 3x3 mesh Network-on-Chip example. 42 S1S W λ 1 W S1 Figure 3.2: A simple server chain. S2 S W S2 W 1 λ 2 S1 W S1 λ 1 W 2 Figure 3.3: Merging two M/D/1 output flows. While WS1can be accurately predicted with (3.1), using the same equation to estimate the waiting time at the input queue of S may result in significant errors. More precisely, the waiting time Wwill be equal to zero as the successive arrivals of packets at S occur not earlier than T, which is exactly the time to process a packet by server S. That means that the incoming packet will never wait for his service. This fact illustrates the inaccuracy of applying (3.1) for the estimation of the waiting time at server S. In the general case, a router may have an arbitrary number of inputs, including constant-time server output flows. The goal of this work is to derive the equations for an accurate queueing delay estimation, as an alternative to the P-K equation. The qualitative importance of an accurate queueing delay estimation is shown in the following example. Consider now two inputs to server S, each one being an output from the constant service time systems S1 and S2 (Fig. 3.3). Table 3.1 reports the estimation of the waiting times W1and W2by the M/D/1 model and the constant service time model (CTM) of this work depending on different input rates (λ1and λ2). The total delay at the server for the packets of the first flow is D1=T+W1, where Tis the packet service time (assumed to be 1 cycle for the example). Table 3.1: Modeling results for the example in Fig. 3.3. CTM M/D/1 SIM Error λ1λ2W1W2D1W1, W2D1D1CTM M/D/1 0.1 0.1 0.07 0.07 1.07 0.13 1.13 1.07 0.1% 6% 0.3 0.3 0.53 0.53 1.53 0.75 1.75 1.54 0.7% 14% 0.5 0.1 0.29 0.47 1.29 0.75 1.75 1.29 0.3% 36% 43 The traffic rates of the flows (flits/cycle) are specified in the first two columns of the table. The following three columns show the waiting times and the delay of the first flow (in cycles) obtained by the CTM model. Next, the estimations for W1, W2 and D1obtained with the M/D/1 model are reported. The column SIM displays the delay of the first flow obtained by simulation. Finally, the error of D1with regard to the simulation is reported in the last two columns. One can easily observe the reduction of waiting times, which is the result of the de-randomization (W1,W2of CTM vs those by M/D/1). Another important aspect is that the Poisson-input models assume equal waiting times for all input streams regardless their rate. This is not true in the case of constant service time systems. This results into larger differences in delay estimation (see the difference between W1 and W2in the last row of the CTM model). We also note that the difference between our model and simulation is less than 1% in this example, while M/D/1 reveals up to 36% of overestimation. This simple example shows that proposed CTM approach can provide more accurate estimations. This is essential for QoS optimization. 3.2 Queueing model This section presents the main contribution of this chapter: the QT model for constant-time routers. Definitions and assumptions We use the following definitions: •Arouter is a basic entity that routes traffic in a network. The router is also referred to as server in the nomenclature of queueing theory. •Apacket is a data transmission entity. A packet consists of one or more flits that are the minimum transmission units. •An input flow, also referred to as input process, is an arrival process at one of the router input buffers. •Atraffic source (sink) of the net is a processing element that injects (consumes) packets to (from) the network. •The traffic rate λkof the net kis the average rate of packet generation at the net source. 44 •The waiting time at the input buffer of a router is the average steady-state time the packets spend in the buffer before being processed by the router. In the QT nomenclature it is referred to as a queueing delay at the input queue (buffer). The following assumptions are considered: •Traffic sources generate packets according to a Poisson distribution. •Traffic sinks consume packets immediately. •The input buffers of the routers have infinite capacity. •The packets have fixed size and the routers take constant time to process them. A simple model for a 2-input router We have already stated an important difference between a system with exponentially distributed service times and one with constant-time service, assuming a Poisson input in both. The output process from the former is also a Poisson process of the same rate and exponentially distributed inter-arrival times. Thus we may use (1) for M/M/1 systems to estimate the waiting time for any of the routers. The output flow from a constant service time system with Poisson input has a complex distribution discussed in [109] and [110]. The important property due to its deterministic service time is that the time between two successive outputs is not less than the service time T. Because of this fact, the waiting time for all the routers in a chain will be equal to zero except for the first one (Fig. 3.2). The first router delay can be successfully estimated with (1), since the packet generators are said to generate packets according to a Poisson distribution. Consider the two-input server example presented in Fig. 3.3. All three servers S1, S2 and S, have a constant service time T. Both sources generate packets assuming a Poisson distribution with average traffic rates λ1and λ2. Our goal is to model the waiting times W1and W2at the input queue of the server S. For example, note that if the flow λ2were not sending packets, i.e. λ2= 0, then W1would be equal to zero as in the single-input server case. This fact supports the idea that the waiting time W1is generated by the packets of the complementary flow λ2and its value depends on the traffic rate of both flows. To simplify the analysis, we use the concept of mean residual service time R(λ) for an input flow [20]. If an incoming packet Piarrives at the server queue at time tiwhile some other packet Pjis being processed by the server, then the residual time Rifor the packet Piis the time left for Pjto finish its service. The mean 45 residual service time is an average value of residual times for each packet defined by the service time and the flow traffic rate. The following equation represents its steady-state value [20]: R(λ) = 1 2λT2.(3.2) Using the definition of residual time, the Pollaczek-Khinchin equation can be rewritten as W(λ) = λT2 2(1 −λT)=R(λ) 1−λT .(3.3) We generalize the above expression by distinguishing traffic rates in the P-K formula. Let us consider the traffic flow of rate λtr that is merged with some complimentary flow of rate λres at the router input. As our experiments show, the waiting time for the packets of flow λtr will depend on both rates. Then we can rewrite (3.3) as W(λtr, λres) = λresT2 2(1 −λtrT)=R(λres) 1−λtrT.(3.4) This generalized waiting time can be treated as that of the traffic flow λtr experiencing a delay produced by the complementary flow with rate λres, inducing a residual time R(λres). Using (3.4) in combination with the standard M/D/1 equation (3.3) we propose the following empirical expression that was found to provide an accurate estimation for W1and W2: Wk=W(λ1+λ2)−W(λ1)−W(λ2) + W(λk, λj) = W(X i=1,2 λi)−X i=1,2 W(λi) + W(λk, λj),(3.5) where k∈ {1,2}and jis the complementary flow for k. The form of (3.5) was suggested intuitively resulting from the numerous experimental observations and was further empirically verified for a large range of input parameters λiand T. The intuition behind this equation can be explained with the following considerations. Expression (3.5) has three terms: the first one is the M/D/1 waiting time (3.3) that input packets would observe if both inputs were Poisson processes. The second term is the sum of the M/D/1 waiting times for each separate flow. It can be considered as the measure of “de-randomization” introduced by the source constant-time router. In fact this is the waiting time packets of each 46 0 0.5 1 1.5 2 2.5 3 0 2 4 6 8 10 Traffic rates ratio Waiting time (cycles) W1 (CTM) W2 (CTM) W1, W2 (M/D/1) Figure 3.4: Estimated waiting time for different traffic rates ratio (λ1/λ2). input process spend at the source router. The last term estimates the impact of the complementary inputs on the k-th input, similarly as it was discussed in (3.4). An important fact that is not evident and not observed in M/D/1 systems modeling is that the waiting time for the input flows differs when the traffic rates are not equal. This phenomenon is also proved by simulation. When two flows interact at the router input, the packets of the flow with greater traffic rate have less average input delay. Indeed, if a packet belongs to the flow with the smallest rate it has greater probability to be blocked by a packet of the complementary flow. As a result, in average its waiting time will be greater than that of the packet of complementary flow. An illustration of this fact is presented in Fig. 3.4. The traffic rate ratio λ1/λ2 ranges from 1 to 10 while their sum is kept constant (λ1+λ2= 0.4 flits/cycle). The waiting time W1,W2estimations by both models are depicted. One can observe the increasing difference between W1and W2estimated by the CTM model as the rate ratio increases. In contrast, the M/D/1 model provides a pessimistic constant waiting time for both flows that does not depend on the ratio of traffic rates. Generalization for an N-input router Equation (3.5) can be generalized for an arbitrary number of inputs N > 2. The waiting time WN kat input kcan be calculated as WN k=W(X i=1..N λi)−X i=1..N W(λi) + W(λk,X i=1..N, i6=k λi) (3.6) 47 It is also valuable to notice that this equation holds for the case of one input flow (N= 1). In this case we obtain W1 1= 0, which is consistent with zero delay at all routers in a chain, except for the first one. Hybrid process at the router input Another important case to consider when modeling a network is a hybrid input process consisting of Poisson flows and constant-time router outputs. It is necessary for modeling the traffic coming from two different sources: the Poisson processes from the PE’s and the traffic coming from constant-time routers. We start again considering a simple two-input server example where one net is an M/D/1 output and another is a Poisson source (Fig. 3.5). Combining (3.2), (3.3) and (3.4) we obtain the following expressions: W1=W(λ1+λ2)−W(λ1)−R(λ2) + W(λ1, λ2),(3.7) W2=W(λ1+λ2)−W(λ1) + R(λ1).(3.8) This result can be extended to the general case presented in Fig. 3.6. Consider a complex arrival process at the input queue of server S: an arbitrary number dof M/D/1 output flows (λ1, .. , λd) and pPoisson flows (λd+1, .. , λd+p). Let us denote the set of all M/D/1 outputs as Dand set of all Poisson sources as P. Let also N=d+pbe the total number of inputs. As the sum of Poisson processes with rates λk, k =d+ 1, .. , d +pis also a Poisson process of the total rate λp=Pd+p k=d+1 λi, we can treat the source flows as a single input with the total rate λp. This results into packets of all the flows in P experiencing equal waiting time. Finally we present the generalized equations for the waiting time WN kestimation. For any input flow k∈D ∀k∈D:WN k=W(X i=1..N λi)−X i∈D W(λi)− X i∈P R(λi) + W(λk,X i=1..N, i6=k λi),(3.9) and for any Poisson input flow k∈P ∀k∈P:WN k=W(X i=1..N λi)−X i∈D W(λi) + X i∈D R(λi).(3.10) 48 S W 1 λ 2 S1 W S1 λ 1 W 2 Figure 3.5: Merging an M/D/1 output and a Poisson flow. W i λd+1 λd+p … … S1 Sd W S1 W Sd S λ1 λd Figure 3.6: Hybrid input process at a constant-time router. We note that in case P=∅, equation (3.9) reduces to (3.6), thus demonstrating that (3.9) is the generalized case of the server not having traffic source inputs. Also note that in case of pure Poisson input flows, i.e. D=∅, equation (3.10) is reduced to ∀k∈P:WN k=W(X i=1..N λi),(3.11) that is exactly the waiting time expression for the M/D/1 system. Thus, our equations are consistent with the M/D/1 model and provide a simple and accurate extension for the hybrid case of input processes. Another interesting fact is that we can apply (3.10) for waiting time estimation at the sources of the nets and at any point in which the input traffic can be modeled by a pure Poisson process estimated by the Pollaczek-Khinchin formula (3.1). We are using the pair (3.9)-(3.10) to predict contention delays at the input buffers of the network routers and build our delay model around them. As we show in the experimental section these equations allow accurate estimations for a wide range of input model parameters. 49 Table 3.4: Relative delay error between simulation and modeling for a 3x4 network with highly communicating central nodes. Utilization Priority CTM error (%) M/D/1 error (%) (flits/cycle) scheme net buffer net buffer FCFS 0.34 19.02 1.97 99.92 0.10 RR 0.58 27.96 2.23 114.94 LQ 0.68 25.86 2.25 111.41 FCFS 2.01 14.15 7.05 71.41 0.50 RR 5.75 34.89 9.39 85.60 LQ 3.93 31.21 8.83 84.74 FCFS 5.54 23.93 11.80 76.65 0.90 RR 28.05 78.76 33.14 102.35 LQ 13.31 54.12 18.87 100.28 To sum up, the CTM model with different priority schemes provides a notable improvement in accuracy in comparison with the M/D/1 model within wide range of traffic loads. The buffer delay estimation improvement reaches up to several times in absolute value, while the net delay mainly determined by the hop count at low and medium loads improves up to several tens of percent. This is a significant result for designs that have QoS constraints for end-to-end latencies. Figure 3.8: Traffic distribution for an 8x8 mesh NoC example. 56 0 5 10 15 20 25 30 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Router utilization (flits/cycle) Relative error of net delay (%) FIFO (CTM) FIFO (M/D/1) RR (CTM) RR (M/D/1) LQ (CTM) LQ (M/D/1) Figure 3.9: Relative errors between simulation and modeling for 8x8 NoC. 3.5 Conclusions This work addresses the problem of modeling constant service time systems via queueing theory. The major contributions can be summarized as follows: •It has been demonstrated that the classical Markovian models provide pessimistic approximation of waiting times for CSTR systems, due to the effect of “de-randomization” at intermediate routers. •A constant-time model has been proposed to eliminate the assumptions of the Markovian models and improve the modeling precision. •The results have been validated for networks with variable sizes, different packet lengths, traffic loads and priority schemes. The traffic process in a network is a complex process that is the result of merging and splitting the traffic flows of individual nets. This work addresses the estimation of the waiting time at the router inputs for the case of merging an arbitrary number of flows. Future work on this model should cover the splitting process to improve the modeling precision. 57 Chapter 4 Analytical Modeling of CMP Architectures This chapter addresses the problem of analytical modeling of CMP architectures. The contribution in this field is the analytical method for estimating performance of large-scale hierarchical CMPs with hundreds and thousands of cores, published in [102]. Specifically, it was shown that contention of the interconnect network has a major significance when analyzing CMP performance. The proposed approach not only captures the behavior of different core architectures and cache hierarchies, but also estimates the traffic and contention of various interconnect topologies. To model the contention in the interconnect network, the cyclic dependency between latency and memory traffic is formulated as a system of non-linear equations. Two numerical methods are proposed to resolve it efficiently: fixed-point iteration and bisection. These methods can use any black-box analytical model for latency, making the approach flexible to incorporate new interconnect models. As the performance of a CMP is highly determined by the executed applications, the proposed method can be parametrized with various workload models. The application of this model to the exploration of large-scale CMPs is discussed in the next chapter. 4.1 The importance of contention: an example Consider a CMP with 48 cores and 16 shared on-chip cache modules. Figure 4.1 presents three (of the many) possible architectures with such parameters. One of the architectures has an 8×8 structure of regular tiles connected with a mesh (Figure 4.1(a)). The cores and caches are shown as light and dark squares, respectively. Solid lines represent the mesh links. 59 (a) 8×8 mesh (b) 4×4 mesh with bus clusters (c) 2×2 mesh with bus clusters Figure 4.1: Possible architectures for a 48-core CMP. Table 4.1: Performance of architectures in Figure 4.1. Architecture Lest θest Lsim θsim (a) 11.17 8.23 11.26 8.16 (b) 10.12 9.04 10.40 8.81 (c) 9.95 9.19 16.69 5.58 To take advantage of the locality of memory accesses, several cores and caches can be grouped in a cluster and communicate via the local interconnect. For instance, clusters with bus interconnects were shown to notably improve the average communication latency [43]. This fact encourages the exploration of hierarchical interconnects. Figure 4.1(b) describes the CMP organization with 16 clusters, each one having three cores, one cache and a shared bus. The clusters communicate via the top-level 4×4 mesh. Another option is to increase the cluster size up to 16 components (12 cores and 4 caches) and decrease the dimensions of the top-level mesh (Figure 4.1(c)). One of the problems of architectural exploration is to select the configuration with the best performance. We first estimated the throughput of each configuration using only the static (hop-count) latency of the network, i.e., assuming no contention. In this experiment we assumed the ideal throughput of cores (under the assumption of zero-latency memory) to be 2.0 IPC (instructions per cycle), and the number of memory references per instruction to be 0.5. The values of static latency (in cycles) and the estimated throughput (in IPC) are displayed in the columns Lest and θest of Table 4.1. Hierarchical architectures show a higher performance due to the exploited locality: configuration (c) has the largest size of local cache (per cluster), hence the increased local hit ratio. Therefore, (c) shows the highest estimated throughput. However, this conclusion is incorrect when network contention is taken into account. Simulation reveals rather distinct performance numbers, reported in the Lsim and θsim columns of Table 4.1. For configurations (a) and (b), the estimated throughput with no contention is close to the one reported by simulation. How- 60 ever, the performance of configuration (c) drops by about 40%. In fact, simulation concludes that (c) is the worst in terms of performance. The reason of this significant discrepancy is the network contention. It occurs because of the competition between memory requests for the shared resources of the interconnect. This results in longer latencies, decreasing the overall performance of the system. In this example, configuration (b), which incorporates hierarchy at some extent, is the one with the highest throughput and represents the best architectural trade-off between cache locality and communication parallelism. 4.2 Analytical performance model This section introduces the models for the evaluation of CMP performance and power. First, we explain the assumptions and input parameters of the models. Next, the equation for modeling static latency is presented. This equation is then extended to consider the contention component of communication. Finally, the throughput model is next discussed and the formula for the memory traffic rate is derived, emphasizing the cyclic dependency between traffic and latency. Assumptions and input parameters of the models This work focuses on systems with two-level hierarchical interconnect fabrics. However, the approach can be applied for an arbitrary number of hierarchical levels, including the particular case of flat interconnects. Several components are grouped into a cluster: cores, components of the memory subsystem and the local interconnect. The top-level interconnect provides communication between the clusters and access to the off-chip memory (Figure 1.3(b)). The system has Ncores in total with parametrizeable architectures: in-order, out-of-order, single- or multi-threaded. The workload model assumes that every core is executing an application, characterized by two parameters. IPC0is the ideal throughput of the core for the application, i.e., the amount of instructions per cycle executed by the core, assuming zero-latency memory. MPI is the average number of memory references generated per instruction. Without loss of generality, we assume that the memory subsystem has four hierarchy levels. Every core has a private L1 cache and possibly, a private L2 cache of larger size but higher latency. The clusters incorporate modules of a distributed L3 cache, shared by all cores. The off-chip memory is accessible via a set of memory controllers. The latencies of the caches and off-chip memory are parameters of the model. 61 L1 Core L2 L3 MC f(c, L1) f(c, L2) f(c, L3) f(c, MC) F(c) Figure 4.2: Memory flows F(c) of a core. The term memory flow is used to denote a feasible communication between a core and a component of the memory subsystem. For example, each core may access its own L1 or L2 caches, or any of the L3 modules or MCs. In this work we only consider the request and reply flows between the cores and the memories. However, a specific coherence protocol can be modeled by adding the synchronization traffic. Figure 4.2 gives an example of the set of all possible memory flows for a core c, which is denoted as F(c). In this example, a pair of the request and reply flows between cand a particular level of memory hierarchy, Lx, is denoted as f(c, Lx), e.g. the flows between cand L1 are denoted as f(c, L1). Every flow f∈F(c) is realizable with probability pf, that defines the probability for cto request data from a certain memory component. In our work we calculate these probabilities using a model of cache miss behavior for the workload in consideration, which represents the dependency between miss ratio and cache size. A power law model was proven to be a good approximation [63]: Miss(S) = κS−α,(4.1) where Sis the cache size, and κ,αare the model parameters (Fig. 4.3). Alternatively, the miss model can be precharacterized using simulation and specified as a set of cache-size / miss-ratio points and interpolation between them. Since L3 is a distributed cache, its access latency depends on the cluster where the requested data is stored. In this work the probability to find the data in a particular cluster is assumed to be inversely proportional to the distance between the requesting core and the cluster. However, the method can be parameterized with any other model for distributed cache. 62 0 0.1 0.2 0.3 0.4 0.5 02468 Miss Ratio Cache Size (Mb) Miss (S) = 0.1 ∙ S -0.5 Figure 4.3: Power-law cache miss model. Static latency In this section we describe how to calculate the average static latency of memory accesses for a core cin the presence of memory hierarchy. Given the probability pf for each particular flow f∈F(c) and its static latency Lf, the average static latency Lst cis: Lst c=X f∈F(c) pfLf.(4.2) Since requests to L3 and MC are sent via the communication network, its delay must also be considered. This delay is defined using the routing function R:f→π(f), that for any flow freturns its routing path π(f). In this work we consider the XY-routing function [39], however any deterministic or even adaptive routing can be used, specifying the probabilities for certain paths. The total latency to access an L3 instance is the sum of the network traversal latency along the path π(f) and the L3 latency. The total latency of the off-chip memory accesses is calculated likewise. The flow probabilities pfare obtained using the miss ratio model, Miss(S), given by (4.1). Assuming the sizes SL1,SL2 of the two low-level caches, the probabilities to access them are: pL1 = 1 −Miss(SL1), pL2 = (1 −pL1)(1 −Miss(SL2)). As L3 is shared, the miss ratio is defined by the effective L3 size, Seff L3, seen by each core [12]. To estimate Seff L3 we use the concept of the average number of cores 63 R R R R CL CL CL CL MC MC (a) R C1C2NI DIRL3 (b) Figure 4.4: Queueing model for (a) mesh and (b) cluster. sharing each line, as proposed by [12]. The probability to access L3 is then: pL3 = (1 −pL1)(1 −pL2)(1 −Miss(Seff L3)). Finally, pL3 should be multiplied by the probability to find the data in a particular L3 instance (cluster). A similar strategy is used to calculate the probabilities of flows to every memory controller. Queueing model for the on-chip interconnect Equation (4.2) describes the static latency of memory accesses. Another important part of the communication delay is the dynamic or contention latency [39]. Contention happens in the interconnect fabrics when several packets compete for the same shared resource, such as a bus or an NoC link. This results in additional delays experienced by packets in the buffers distributed over the on-chip interconnect. One of the approaches to estimate the contention delays is to model the CMP as a system of queues and apply queuing theory to calculate the buffer delays. In this work two-level hierarchical interconnects are assumed, with a 2D mesh at the top level. At the lowest (cluster) level, buses, uni- and bi-directional rings are used for the interconnection. Figure 4.4(a) shows the queueing representation of the top-level mesh. The mesh routers (R) have up to five input-buffered ports to store the incoming flits. The primary ports of the routers are connected to the clusters (CL), which in case of a flat CMP organization may consist of one device (e.g. a core with private caches in Figure 1.3(a)). Figure 4.4(b) presents an example of queueing model for a bus-based cluster, corresponding to one tile of the hierarchical CMP. This cluster consists of five devices, communicating via a shared bus: two cores with private caches, an instance of an L3 shared cache, a directory and a network interface. Every device has a buffer to store the requests to the bus. To distribute 64 the off-chip memory traffic uniformly over the mesh and avoid high contention of certain routers, we assume that memory controllers have multiple connections to the mesh, as shown in Figure 4.4(a). Total memory latency The average total latency for core c,Lc, is calculated by adding the static latency (Lst c) and the queue delays along the communication paths (wq). Hence, given the paths π(f) for every flow f, we extend equation (4.2) accordingly: Lc=Lst c+X f∈F(c) pfX q∈π(f) wq .(4.3) To find the values for wq, an analytical model for the on-chip interconnects can be used. In this work we apply the model from [103], which offers a convenient definition of queue delays via the injection rates in closed form. The method calculates the probabilities of the packets coming from different bus (or router) inputs to move towards the same output. It represents an efficient generalization of the M/G/1 queueing model [81]. The efficiency of this model is essential for our iterative procedure, described in Sect. 4.3. Another advantage of this model is the capability to deal with a variety of interconnect types, such as buses and router-based topologies. Given the vector of injection rates, λ∈RN, the model in [103] proposes to express queue delays in the form of a system of equations with a matrix W: wq=W(λ),(4.4) where wqis the vector of delays for all queues of the interconnect. The exact form of the matrix Wis given by the expressions (5) and (18) in [103]. What only remains is to compute the rates λ, which is covered in the next section. Throughput model The throughput of a CMP and the traffic in the interconnect are closely related. To derive the exact dependencies, we start with the performance model for a single core, given in [64]. For a core with the average rate of accesses to remote memory (RemRate), and the cost of an access (RemCost), the average number of cycles for executing an instruction, CPI, is: CPI =CPI0+RemRate ·RemCost,(4.5) 65 Similarly, the cache power depends on the number of accesses to the cache per cycle (e.g. traffic), Λc, and the energy per access Eacc,c: Pdyn,c =Eacc,c ·Λc·Freqc. Dynamic power for the components of on-chip interconnect, such as routers and links, is proportional to the traffic through the component, Λc, and the energy per flit transmission Eflit,c: Pdyn,c =Eflit,c ·Λc·Freqc. Here the areas Acand the performance metrics θcand Λcof the components are calculated by the performance model. Frequency is a parameter of exploration. To find the power and energy coefficients we employ the data obtained from [117] for the cores, CACTI 5.3 model [2] for caches and Orion 2.0 model [76] for on-chip routers and links. 4.5 Experimental results In this section we describe several experiments used to validate the proposed analytical method for efficiency and quality. Validation is performed with respect to simulation. Next subsections describe our simulation environment and the experiments. Simulation environment A cycle-accurate simulator for hierarchical CMP interconnect networks has been designed [45] using BookSim 2.0 [39] as underlying infrastructure. The simulator can model the contention of the interconnect network at flit level. Three enhancements were made to BookSim. First, the probabilistic traffic injection patterns were replaced by state-machine models for cores, caches and memory controllers. The cores inject memory requests according to parameters characterizing the average workload of the system. Cores are stalled when they are waiting for responses from memory. Both in-order and out-of-order cores can be modeled. Memories accept requests from cores and send replies after a predefined latency. Support for hierarchical topologies was added, thus enabling the simulation of multi-level interconnect networks with an arbitrary number of levels. Finally, models for bus and multibus topologies were also created. Each simulation was run long enough to obtain a 2% relative error (the same value used for the analytical model) with a 95% confidence degree. The 95% confidence interval is guaranteed using the batch means method [55]. 72 Table 4.2: Performance comparison of analytical methods. Test Mesh Content. Num. of Runtime (sec) latency var./eqn. MATLAB Fixed-point Bisection T1 2 ×2 5% 236 0.023 0.001 0.001 T2 4 ×4 13% 1224 1.412 0.001 0.002 T3 6 ×6 8% 3108 30.831 0.002 0.003 T4 8 ×8 12% 6128 408.539 0.006 0.010 T5 10 ×10 23% 10620 >1h 0.010 0.012 T6 10 ×10 46% 10620 >1h 0.022 0.015 T7 10 ×10 55% 10620 >1h NA 0.016 Efficiency of the model In this section we compare the efficiency of the three analytical methods for resolving the cyclic dependency presented in Section 4.3: solver (MATLAB), fixed-point iteration (FP) and bisection (BS). We generated a set of CMPs having flat mesh topologies with various dimensions and contention degrees. The reason to select flat interconnects is to demonstrate that even for rather simple architectures the obtained system of equations is hard to be tackled in a straightforward way. The test cases and the results are summarized in Table 4.2. The first three columns show the test name, mesh dimension and the ratio of contention latency with respect to the average total latency. The fourth column represents the number of variables and equations in the obtained system. The fifth column shows the time required to find a solution using the general nonlinear solver provided by MATLAB. The last two columns show the time consumed by the FP and BS methods. For each test case the three methods converged to the same solution, within the given tolerance region of 2%. Test cases T1 to T5 accentuate how the MATLAB time grows with the mesh size. The solution of T5-T7 could not been found within an hour. Clearly, this straightforward method is not acceptable for efficient exploration of CMPs. The purpose of test cases T6 and T7 is to compare the FP and BS methods. T6 has higher contention than T5. As a result, FP takes more time to converge than BS. T7 has even more contention, resulting in a violation of the steady-state assumption for the queueing model (see Section 4.3). Hence, FP can not be used in this case, so BS is the only option. We observed that FP typically outperforms BS when the contention component of latency is moderate, i.e. does not exceed about 30-40% of the total latency. Hence we choose to run FP first and use BS only when the former method fails. 73 Table 4.3: Parameters of the exploration space S1. Parameter S1values Chip area 350 mm2 Core area 1.25 mm2 Core ideal IPC 2.0 L1 size 64, 128 Kb L2 size 128 Kb to 1 Mb Mesh dimensions 2×2 to 10×10 Off-chip memory latency 100 cycles Type of cluster interconnect Bus, uni-ring, bi-ring Interconnect link width 256 bits Workload MPI 0.25 Workload MLP 1.25 Table 4.4: Cache area-performance model. Cache size 64K 128K 256K 512K 1M 2M 4M 8M Area (mm2)0.063 0.125 0.25 0.5 1.0 2.0 4.0 8.0 Latency (cycles)2 3 4 5 6 7 8 9 Quality of the model To validate the quality of the model in estimating performance, we carry out a CMP design space exploration experiment. For every configuration of the design space we obtain the throughput using both analytical modeling and simulation. The search space in this experiment is made intentionally small in order to allow an exhaustive simulation of all configurations. With this experiment we demonstrate that the analytical model selects a set of best-throughput architectures very similar to the simulator, but in much shorter time. The parameters of the exploration space S1for this experiment are listed in Table 4.3. The value chosen for chip area is typical for CMP exploration studies [107, 32]. The estimates for the area of each component are derived from the parameters of the Intel Core 2 Duo E6400 processor [6]. The ideal IPC of core is obtained from [117]. We also assume that the core is out-of-order (OoO). We scale the core area and memory density down to 16nm to allow hundreds of cores within the chip area. Table 4.4 shows the area-performance model for cache memory. 74 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 1 2 3 4 Miss Ratio Cache Size (Mb) Figure 4.7: Cache miss model of soplex application. Without loss of generality, we assume all cores to be running the soplex application from SPEC CPU2006. Figure 4.7 depicts the miss ratio produced by the application as a function of the cache size, obtained through simulation. The number of cores and cache sizes are varied to explore the trade-off between computing units and on-chip memory. Three types of local interconnects are considered inside the clusters: buses, uni- and bi-directional rings. The exploration of the mesh dimensions compromises the number of clusters and processors per cluster. The maximum power of all configurations is limited to 130W. Given these parameters, our framework generates 2095 feasible configurations. The simulation of all configurations takes about 18 hours, while the analytical model takes 48 seconds, delivering more than a 1300x speedup. The best configuration obtained by simulation has a throughput of 72.07 IPC. This architecture has a 2×2 mesh (4 clusters with bi-ring interconnect, 21 cores per cluster), a total of 84 cores with 128Kb L1, 1Mb L2 private caches and 150Mb shared L3 cache. In Fig. 4.8 we sort the configurations by throughput horizontally, as estimated by simulation. One can see that the analytical model tracks the simulation curve with reasonable accuracy. The analytical model underestimates contention and, for this reason, the discrepancy with simulation increases with higher values of contention. Configurations with similar throughput may have different contention values, hence the noisy behavior of the modeling curve. The average absolute error in throughput is 7.7%, which corresponds to the error reported by the latency model [103]. The worst-case error for all nearly-optimal configurations does not exceed 10% (low-error zone), although it grows as we move away from the optimum. This is explained by the fact that architectures with balanced interconnects tend to have higher throughput and less contention. The precision of the analytical model drops 75 0 10 20 30 40 50 60 70 80 1 67 133 199 265 331 397 463 529 595 661 727 793 859 925 991 1057 1123 1189 1255 1321 1387 1453 1519 1585 1651 1717 1783 1849 1915 1981 2047 2113 Throughput (IPC) Configurations sorted in descending order of throughput Modeling Simulation Low error (< 10%) Figure 4.8: Throughput comparison for analytical model and simulation. when the contention increases, hence the error grows for configurations which are far from the optimum. Since the design exploration problem is aimed at selecting configurations with the highest throughput, this loss of precision is not critical. If required, the quality of the model can be further improved by considering alternative analytical models in conjunction with the iterative techniques proposed in this work. What really matters for exploration are the relative, rather than the absolute values of throughput. When exploring a huge design space we would like to discard suboptimal architectures and keep a moderate subset of promising solutions. These configurations can be further simulated to select the best one. Hence, we are interested in comparing the order of configurations by the highest throughput, as delivered by the analytical model and the simulation. Here is where our technique demonstrates very accurate results: Figure 4.9 shows the comparison for the bestthroughput order. To make the picture illustrative, we only consider the 50 best configurations, although this tendency is maintained for the whole set of configurations. The horizontal axis specifies the number Nof best configurations chosen by simulation. The vertical axis indicates the minimum number of best configurations chosen by the analytical model that include the Nbest ones by simulation. For example, the point with coordinates (1;1) means that the best configuration by simulation is also the best one by modeling. The rightmost point on the plot (50;60) means that the 60 best configurations by modeling include the 50 best by simulation. This is actually a very accurate result for the analytical model, considering that two thousand configurations are compared. 76 (5; 33) (9; 61) (1; 1) (8; 22) (50; 60) 0 10 20 30 40 50 60 70 0 10 20 30 40 50 60 Best configurations by modeling that include N Number of best configurations by simulation (N) Model with static latency Model with total latency Ideal model (Simulation) Figure 4.9: Order comparison for analytical model and simulation. We also demonstrate that estimations based on static latency deliver a deficient order. It biases the exploration towards configurations with large bus-based clusters, given the fact that the long contention latency in the buses is not considered. The point (5;33) in Figure 4.9 means that the fifth best configuration is on the 33rd position when not considering contention. Note that modeling with only static latency fails to discover the four best configurations due to the power constraint. In the absence of contention, the latency (4.3) is underestimated, while the throughput (4.6) and traffic (4.7) are overestimated, resulting in overestimation of power (see Sect. 4.4). The problem could be avoided by setting the power constraint to a higher value. However, a higher power limit would bring new configurations into consideration, aggravating the deviations in the order with respect to simulation. Scalability of the model To investigate the scalability of the analytical model, we generated several CMPs with mesh-of-buses topology and similar structure. Each cluster contains four components (three cores and one cache module) and a bus interconnect. The top-level mesh dimensions are varied from 2×2 to 16×16, producing CMPs with 16 to 1024 components. For each test case we executed both fixed-point and bisection and com- 77 0.001 0.01 0.1 1 10 100 1000 0 100 200 300 400 500 600 700 800 900 1000 Runtime (seconds) Number of components in CMP Simulation Modeling ≈700-component CMP in 1 second Figure 4.10: Performance comparison of the analytical model and simulation. pared the average runtime value of these two methods with simulation. Figure 4.10 shows the comparative results. Our probabilistic simulator demonstrates very good performance. Simulation of the 16-component CMP takes just 2.5 seconds, and for the 1024-component CMP about 600 seconds. However, the analytical model yet brings about three orders of magnitude improvement in efficiency. For the 16- and 1024-component CMPs modeling took only 0.002 seconds and 3.3 seconds respectively. In one second our method handles a CMP with nearly 700 components. This result justifies high scalability of the proposed method and its ability to efficiently explore architectures with many hundreds of cores. 4.6 Conclusions Analytical models for CMP performance are crucial to make the architectural exploration possible. This work shows that such models need to incorporate the contention factor in order to adequately estimate performance. We have presented an analytical method to model contention of hierarchical interconnects, by resolving the cyclic dependency between the memory latency and traffic. The important conclusions drawn from the experiments are: •The proposed numerical methods for resolving the cyclic dependency (4.8) demonstrated several orders of magnitude improvement in performance compared to a generic solver. The approach was shown to be suitable for efficient analytical modeling of CMP architectures. 78 •The scalability of the model was illustrated by estimating the performance of a CMP with nearly 700 components (cores, memories, routers) in one second. •The estimation of CMP throughput using the approximation by static latency (i.e. without considering the interconnect contention) resulted in a poor ranking, which did not match well with simulation. •The exploration of the design space, using the proposed model as an architecture estimator selected a very similar set of best-throughput architectures as simulation. Furthermore, modeling delivered more that 1300x speedup, as compared to simulation. The techniques described in the following chapter show how this model can be combined with an intelligent search strategy to avoid exhaustive exploration. 79 Chapter 5 Metaheuristics for Architectural Exploration The goal of this chapter is to propose a methodology for efficient architectural exploration of large-scale hierarchical CMPs within vast design spaces. Efficiency is achieved by using analytical modeling instead of simulation, and by replacing the exhaustive exploration by an intelligent search strategy. The proposed approach is built on top of the analytical power-performance model presented in Chapter 4 and performs an efficient metaheuristic-based search that does not require simulation. To the best knowledge of the author, this work becomes the first one to integrate an analytical model for CMP with metaheuristic optimization. Architectural exploration for CMPs must be performed on a highly discrete design space. For this reason, hill-climbing strategies for combinatorial optimization are a promising approach, as it was shown in [77]. Two probabilistic metaheuristics based on extensions of hill climbing are considered: Simulated Annealing [80] and Extremal Optimization [24]. SA has been successfully applied in many design automation problems and EO has recently emerged as a very competitive alternative. For our problem, both heuristics exhibit similar performance and results, although for some design spaces one may behave more efficiently than the other. This chapter explains the customization of both methods for the exploration problem. 5.1 The Exploration Problem The exploration problem addressed in this chapter assumes tiled hierarchical CMP architecture, the benefits of which for shortening the CMP design cycle have already been discussed in the previous chapters. Tiled architectures are organized as arrays of identical clusters, each one incorporating one or several computing cores, caches and an on-chip interconnect. Figure 5.1 shows an example of a tiled hierarchical 81 Procedure 1 SimulatedAnnealing 1: CurC←BestC ←”Some initial solution” 2: Tcur =Tinit 3: while improvement in last kiterations do 4: for P iterations do 5: select tirandomly with uniform probability 6: generate NewC by applying tito CurC 7: if Accept(CurC,NewC)then CurC ←NewC 8: if Obj(CurC)>Obj(BestC )and Feasible(CurC)then BestC ←CurC 9: end for 10: Tcur =α·Tcur 11: λ=λ/α 12: end while 13: return BestC Procedure 2 Accept(CurC,NewC) 1: if Obj(NewC)>Obj(CurC )then return true 2: else return true with probability Pa, defined by (5.4) The new configuration is accepted probabilistically according to Procedure 2. Configurations with better objective value (calculated using (5.3)) are always accepted (line 1), other configurations are accepted with probability Pa: Pa=e−γ, γ =Obj(CurC) Obj(NewC)·1 Tcur .(5.4) This probability depends on two exponent factors. The former avoids the acceptance of solutions with high degradation of the objective function. The latter increases the probability of hill climbing as the temperature cools down. We use a commonly applied strategy for defining the initial temperature, Tinit [134, 17]. Running the algorithm for Piterations and always accepting the new configurations, we calculate the average cost variance as: ∆ = 1 P P X i=1 Obj(CurC)i Obj(NewC)i . This value is further used in (5.4) in place of the objective ratio to evaluate Tcur which gives a high initial acceptance probability, e.g. around 0.95. 88 Note that the best solution is updated only when the CurC is feasible as given by the Feasible(CurC)procedure in line 8. This procedure returns true if and only if CurC satisfies all constraints (for area, power and aspect ratio in our case). 5.4 Exploration with Extremal Optimization Extremal Optimization (EO) [24] is inspired by the principle of evolution in ecosystems, which were observed to evolve by selecting against its worst components (or features). We draw here an analogy with the exploration problem, by considering every configuration to be determined by the conjunction of its variables, P, similarly to the components (features) of the ecosystem. Given a configuration, EO evaluates the fitness of its variables by comparing the current objective value with that of the neighbors, defined by the transformation set. A variable is well-fit if the configuration objective can not improve significantly by applying any of the transformations changing this variable. EO focuses on improving the status of variables with low fitness. Since there are transformations that update several variables simultaneously, it is more convenient to work with the transformation fitness. As opposed to variables, well-fit transformations are those that cause higher improvement of the objective, when applied. More precisely, given the current configuration CurC, the fitness of transformation tiis: Φ = Obj(NewC),(5.5) where NewC is the configuration obtained by applying tito CurC. To maximize the objective function, at every iteration EO algorithm selects a transformation with high fitness and applies it to the current configuration. Local optima are avoided by randomizing the selection process. The transformations are ranked according to their fitness in descending order (the best transformations have lower indices in the rank). The transformations are randomly selected by some probability distribution biased towards the ones with highest fitness values. The power-law distribution is a typical one for EO. For example, if the system has Ntransformations ranked from 1 to Nin descending order of their fitness, the index iof the selected transformation can be calculated as follows: i=dN·pτe(5.6) where pis a random number obtained from a uniform distribution in the interval [0,1] and τis the power law exponent. 89 Procedure 3 ExtremalOptimization 1: CurC←BestC ←”Some initial solution” 2: while some improvement in the last kiterations do 3: local search: evaluate Prandomly selected transformations and accept only those that improve the Obj(CurC); 4: sort all transformations in descending order of Φ; 5: select tiaccording to equation (5.6); 6: apply tito CurC; 7: if Obj(CurC)>Obj(BestC )and Feasible(CurC)then BestC ←CurC; 8: λ=λ·βτ; 9: end while 10: return BestC The EO algorithm is described in Procedure 3. After the definition of an initial solution, the execution is continued until no further improvement is observed during a certain number of iterations. In this work we use a variation of EO called Continuous Extremal Optimization [140]. This variant combines EO with a local search at the beginning of each iteration, contributing to improve the objective value of the final solution and the speed of the algorithm. Local search implements hill climbing by sequentially trying Prandom transformations and accepting only those that improve the objective. To select a transformation ti, all transformations are sorted according to their fitness value (5.5). The power law described by equation (5.6) is used to randomize the selection. Finally tiis accepted unconditionally and BestC is updated if the objective is better than any other configuration visited so far. Penalization weight λincreases as the system evolves, as in the SA algorithm. Since EO does not have the notion of temperature, we select a geometric law to update λ(line 8), where βis a constant, slightly greater than one (such as 1.01). The selection of βhas to assure that λgrows slow enough for an efficient exploration, which implies a periodical acceptance of infeasible configurations. 5.5 Experimental results In this section we present the experiments used to validate the quality and efficiency of metaheuristics. For this purpose we consider a substantially large search space S2, containing about 1.5·109configurations. The parameters of S2and their comparison with the parameters of space S1from previous chapter are given in Table 5.3. There are three types of cores available in S2, which is the major reason for the dramatic explosion in the number of configurations. Figure 5.4 plots the ideal 90 Table 5.3: Parameters of the exploration spaces S1and S2. Parameter S1values S2values Core types C2 C1,C2,C3 L1 size 64, 128 Kb 64, 96, 128 Kb L2 size 128 Kb to 1 Mb 64 Kb 1 Mb Mesh dimensions 2×2 to 10×10 2×2 to 16×16 Chip area 350 mm2 Memory density 1 mm2/ Mb Off-chip memory latency 100 cycles Type of cluster interconnect Bus, uni-ring, bi-ring Interconnect link width 256 bits Workload MPI 0.25 Workload MLP 1.25 performance of every type of core (C1,C2 and C3) as a function of the core area. The parameters for C2 are obtained from [117], whereas the parameters for C1 and C3 are generated by applying Pollack’s rule [116] to the parameters of C2. We also assume that the smallest core, C1, implements in-order execution (IO), while the other two implement out-of-order execution (OoO). The models for in-order and out-of-order architectures were explained in Section 4.4. Additional values for cache sizes and mesh dimensions also contribute to the expansion of the design space. Without loss of generality, we assume all cores to be running the same application. For this study we select the soplex application from SPEC CPU2006. Figure 5.5 depicts the miss ratio produced by the application as a function of the cache size. 1.5 1.75 2 2.25 2.5 2.75 0.75 1 1.25 1.5 1.75 2 2.25 Ideal IPC Area (mm2) C1 (IO) C2 (OoO) C3 (OoO) Figure 5.4: Core types for S1and S2exploration. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 1 2 3 4 Miss Ratio Cache Size (Mb) Figure 5.5: Cache miss model of soplex application. 91 There are several ways how exploration can be performed for multiple applications. If all cores can execute only one type of application simultaneously, which can change in time though, one can evaluate a configuration with a weighted objective function. For example, if for two applications A1and A2some configuration Cdelivers performance IPC(A1) and IPC(A2) respectively, then the aggregate performance for Ccan be defined as IPC(C) = α·IPC(A1) + β·IPC(A2), where αand βare the user-defined weights. In the other scenario, several applications can be executed in parallel. For this case, the applications have to be distributed among the cores assuming some mapping algorithm, and the exploration procedure can be applied without any change. Evolution of search in time Figure 5.6 shows the evolution of the best throughput discovered by the heuristics as the exploration evolves. To emphasize the need for intelligent search, we compare SA and EO with a naive Random Best (RB) strategy. RB simply generates random solutions, without tracking any history, keeping only the best known result. The exploration is performed with a maximum power Pmax = 180W, which was found to be a reasonable value to explore the trade-off between throughput and power. The metaheuristic parameters are α= 0.995 and τ= 1.6. One can observe that SA discovers the optimum2(103.26 IPC) in about 160 seconds. EO reaches the optimum in just 80 seconds. However, for RB it takes almost 400 seconds to find a configuration with 85.71 IPC, 17% worse than the optimum. The exhaustive exploration of all configurations in S2would have taken more than 100 days using a single-core machine. These facts justify the importance of the metaheuristics in the exploration. Importance of selecting the set of transformations Next, the importance of several transformation types is demonstrated. Figure 5.7 shows the evolution of the best discovered throughput in time (using Simulated Annealing), when the power constraint is set to 180W. The dashed line shows an exploration trace for the case when only the first-type transformations are considered. It takes approximately 600 seconds to reach the optimum solution of 103.26 IPC. The solid line depicts a trace for the case when all three transformation types are used. Time to reach the optimum solution drops to 120 seconds, delivering a 5x speed-up. 2We have computed the optimum by exhaustively running the model for all configurations in S2. A high-performance computing cluster was used, which effectively reduced the exploration time to five days. 92 0 20 40 60 80 100 120 0.001 0.01 0.1 1 10 100 1000 Best throughput (IPC) Exploration runtime (sec) Simulated Annealing Extremal Optimization Random Best 103.26 IPC 85.71 IPC Figure 5.6: Evolution of best discovered throughput in time. 0 20 40 60 80 100 120 0.001 0.01 0.1 1 10 100 1000 Best throughput (IPC) Exploration runtime (sec) All transformations First-order transformations 103.26 IPC Figure 5.7: Evolution of the exploration objective in time for different sets of transformations. 93 70 80 90 100 110 120 130 100 120 140 160 180 200 220 240 Throughput (IPC) Power (W) 6x5, Bi-Ring, 4C2 5x4, Bi-Ring, 6C2 5x3, Bi-Ring, 8C2 4x3, Bi-Ring, 10C2 4x2, Bi-Ring, 15C2 3x2, Bi-Ring, 20C2 6x5, Bus, 4C2 7x4, Bus, 3C2+1C3 7x4, Bus, 4C2 6x5, Bus, 2C1+2C2 6x4, Bus, 3C1+2C2 Figure 5.8: Power-performance trade-off in S2. This example emphasizes how the second-type and reclustering transformations improve the performance of metaheuristic-based search. Power-performance exploration This study shows how our model can be used to explore power-performance tradeoffs. Figure 5.8 depicts configurations with best throughput (Y-axis) discovered by metaheuristics with different power budgets (X-axis). We start with the power limit that delivers highest performance, and reduce the budget in amounts of 10W until we reach 130W. This plot illustrates the expected decrease in performance for configurations with lower power budgets. The configuration with highest performance (118.99 IPC) has a power of 230W. The block diagram of this configuration is shown in Fig. 5.9(a) and represents a 6×5 mesh with four C2 cores and bi-ring interconnect in clusters. As we reduce the power budget, the mesh dimensions are reduced, decreasing the number of highperformance but power-hungry routers. The clusters incorporate more cores, resulting into higher latencies of memory access. Therefore, performance of configurations decreases. Note that the bi-ring interconnects are preferred for budgets greater than 180W. The layout of the last configuration with a bi-ring, at 180W, is shown in Fig. 5.9(b). It has a 3×2 mesh and 20 C2 cores per cluster. Bi-rings deliver the highest performance, however they are less power-efficient when compared to buses. Hence, buses replace rings as soon as the power budget 94 MC RRRRRR RRRRRR RRRRRR RRRRRR RRRRRR MC MC MC C2 L2 C2 L2 C2 L2 C2 L2 L3 R NI Bi-Ring (a) No power constraint (230W) MC RR RR MC MC MC L3 C C C C C CCC C CCC CCC R NI C C C R R CC (b) 180W MC RRRRRR RRRRRR RRRRRR RRRRRR MC MC MC C2 L2 C2 L2 C1 L2 L3 R NI Bus C1 L2 C1 L2 (c) 130W Figure 5.9: Best configurations, discovered by exploration for some power budgets. 95 drops significantly (below 180W). With further decrease in the budget, power is saved by either reducing the number of cores, or by selecting more power-efficient cores (e.g. C1 vs. C2). Thus, the best configuration for 130Wcontains 24 bus-based clusters with 3 C1 and 2 C2 cores (Fig. 5.9(c)). Also note that C2 cores are typically preferred when the power budget does not impose strong limits. This is explained by the fact that C2 are the most efficient in terms of performance per area unit. C2 is out-of-order, hence it hides memory latency more efficiently than the in-order C1 core. At the same time, even though C3 is out-of-order too, C2 delivers more performance per unit area, which makes it the most competitive among the three types of cores. Comparison with simulation The main question this section tries to answer is: how can we check that the accuracy of the results given by metaheuristics is acceptable for a huge search space? To answer this question one would need to simulate all configurations exhaustively. This task is intractable due to enormous computational cost. What we propose is to run the exploration and store the nbest configurations discovered by the search (nis a parameter). Afterwards, we simulate those nconfigurations and check whether the best configuration retains its rank after simulation. In this experiment we run the EO algorithm with τ= 1.6 and a power constraint of 180W. As the search evolves, a set of n= 100 best configurations is maintained. Upon the algorithm termination these configurations are simulated. The dotted line in Fig. 5.10 shows the throughput values in descending order, as calculated by the analytical model, with the maximum being 103.26 IPC (#1) and the minimum 80 85 90 95 100 105 110 1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 Throughput (IPC) Configurations sorted in descending order of throughput Analytical model Simulation Best configuration (#2) with 105.81 IPC Figure 5.10: Throughput of 100 best configurations. 96 94.77 IPC (#100). Then, all 100 configurations are simulated, and for each one the throughput obtained by simulation is plotted (solid line in Fig. 5.10). The best configuration by simulation is #2, with a throughput of 105.81 IPC. Although this configuration is assigned the second place in the order created by model, the difference between the simulated throughput of #1 and #2 is less than 4%. Certain deviations in this experiment are inevitable due to the simplifying assumptions of the analytical model. However, for the majority of configurations the tendency for the throughput is to decrease as the rank id increases, indicating a good correlation between the simulator and the model. 5.6 Conclusions This chapter shows how to effectively reduce the number of configurations considered during the exploration by using metaheuristics for the combinatorial optimization. This contribution is indispensable to make the architectural design space exploration of future hundred- and thousand-core CMPs tractable. The main conclusions from experimental results are summarized below: •The metaheuristic-based search can discover the optimal configuration of a large design space, such as S, within tens of seconds. Naive search strategies show worse results, even with longer running times (17% lower throughput with 5x increase in exploration time). •The proposed methodology can be efficiently applied to power-performance exploration of CMPs. An example of the power-constrained exploration was given above. •By simulating 100 configurations with the top throughput, discovered by the search, it was demonstrated that the throughput rankings between the model and simulation match closely. This fact is an additional confirmation of the quality of the analytical model introduced in Chapter 4, when applied to large search spaces. These results confirm that the metaheuristic-based search strategy, supplied by the carefully selected transformations, can replace exhaustive search and substantially reduce the exploration time. There remain open questions related to the selection of transformation set in an optimal way. Chapter 8 discusses some of these questions, which require future investigation. 97 A CMP has a set of controllers to access the off-chip memory. Guided by the existing implementations [118, 119], in this work we assume controller placement at the periphery of the mesh. However, this does not limit the proposed approach from having the controllers placed inside the mesh, that was demonstrated beneficial by recent research [10]. Another assumption we make is that every processor pjis associated with one controller, as defined by the function MC(pj). This assumption can be eliminated by specifying the probabilities of accessing different controllers for pj. Function McDist(pj) returns the hop-count distance from pjto the related controller. The McBw parameter sets the maximum controller bandwidth to guarantee performance of memory access. Cost function The goal of the model is to minimize power consumption under a set of design and performance constraints. The binary variables aijk define whether task tiis mapped onto processor pj operating at voltage vk. The total power consumption for computation can be defined as follows: Pcomp =X ti∈T X pj∈PX vk∈V aijk ·P(pj, vk). The power consumption for communication has two terms: the on-chip communication, defined by the flows between the tasks and the off-chip communication, defined by the traffic to the memory controllers. To model the first term, we introduce the variables hx sd and hy sd that represent the hop-count of flow fsd in the x- and y-directions, respectively. Assuming minimal-path routing, the power consumption for inter-task communication can be defined as Pt comm =X fsd∈F Bsd ·(hx sd +hy sd)·Ebit, and the term related to communication with memory controllers Pmc comm =X ti∈T X pj∈PX vk∈V aijk ·Λ(ti)·McDist(pj)·Ebit, where Ebit is the estimated energy for transmitting one bit over a link. The objective of the problem is to minimize the total power: min : P=Pcomp +Pcomm =Pcomp +Pt comm +Pmc comm.(6.1) 104 Constraints The first two constraints are the classical requirements for an assignment problem. Every task tihas to be assigned to some processor pjand every processor can hold one task at most: ∀ti∈ T :X pj∈PX vk∈V aijk = 1.(6.2) ∀pj∈P:X ti∈T X vk∈V aijk ≤1.(6.3) The next step is to model the communication component of the power. A set of constraints is introduced to calculate the hop-count of each flow assuming an XY- routing. Each processor pjis located in a tile at column xjand row yjof the mesh (Fig. 6.2a). The coordinates are uniquely defined by the index j:xj=jmod Wand yj=bj/Wc, where Wis the width of the mesh. For any task ti, we define (xi, yi) as the location of the processor assigned to the task. Then, the location is specified by the expressions over the task assignment variables: xi=X pj∈P (jmod W)X vk∈V aijk yi=X pj∈P (bj/Wc)X vk∈V aijk.(6.4) For every flow fsd, the source and destination tasks, tsand td, are mapped onto processors psand pd, with coordinates (xs, ys) and (xd, yd), respectively, defined by (6.4). The horizontal hop-count, hx sd =|xs−xd|, and the vertical hop-count, hy sd =|ys−yd|are defined by the following constraints1: xs−xd≤hx sd, xd−xs≤hx sd ys−yd≤hy sd, yd−ys≤hy sd.(6.5) The next group of constraints defines the relations between voltage islands and throughput. Let the binary variable vn krepresent the fact that the voltage island ιn operates at voltage vk. First, for every island ιnonly one voltage has to be selected: ∀ιn∈ I :X vk∈V vn k= 1.(6.6) 1the pair of inequalities and the fact that the hvariables are implicitly minimized with the cost function (since this implies minimization of power), guarantee the equality with the absolute value. 105 xj yj 0 1 2 3 0 3 2 1pj EAST MC WEST MC (a) Processor pjlocated in the cell (xj, yj) of the mesh. xlb xle yl 0 1 2 3 0 3 2 1 EAST MC WEST MC (b) East link from cell (xlb, yl) to cell (xle, yl). Figure 6.2: Definition of the processor and link location in mesh. To enforce that all processors in the same voltage island work with the same voltage, the following constraint is added: ∀ιn∈ I,∀vk∈ V :X ti∈T X pj∈ιn aijk ≤Num(aijk)·vn k,(6.7) where Num(aijk) is the number of aijk variables in the LHS of the inequality. Expression (6.7) in combination with (6.6) guarantees that only the assignment variables for the selected voltage may take non-zero values. The throughput constraint should guarantee that for each task tiexecuted on processor pjthe product of IPC(ti, pj) and the processor frequency F(pj, vk) defined by the current voltage, is not less than the required throughput IPS(ti). Hence, the following relation is specified for each ti∈ T : X pj∈PX vk∈V aijk ·IPC(ti, pj)·F(pj, vk)≥IPS(ti).(6.8) The last group of constraints aims at satisfying the requirements for link capacity and memory controller bandwidth, under the assumption of XY-routing. We start by considering the link capacity. The total link bandwidth can be expressed as the sum of the bandwidths of all flows that pass through the link. There are two terms that contribute to link bandwidth, related to the inter-task and memory controller traffic, hence the constraint can be written as ∀l∈ L :TaskTerm(l) + McTerm(l)≤Cap.(6.9) Let us consider the task term first. In XY-routing, the data is always sent in the X-direction first and the Y-direction afterward. Hence, the route of a flow will 106 pass through a link, only in case the source and destination tasks are mapped to a specific subset of processor locations. Thus, for every link land flow fsd we define the binary properties, MapSrc(l, fsd) and MapDst(l, fsd), that indicate whether the source and destination tasks are mapped onto the locations that imply link lto be on the flow route. To guarantee that lis on the route of fsd, both properties should be asserted, i.e., MapSrc(l, fsd)·MapDst(l, fsd) = 1. This is a non-linear constraint that we linearize by introducing the real variables ml sd: MapSrc(l, fsd) + MapDst(l, fsd) = ml sd.(6.10) Since the mapping properties can only take binary values, the ml sd variable can only take three values: 0, 1, or 2. We use another scaling of ml sd to the binary variables rl sd, that take non-zero values only when ml sd = 2, i.e. both mapping properties are true: rl sd ≥ml sd −1,2·rl sd ≤ml sd.(6.11) The variables rl sd are equal to 1 if the route of flow fsd goes through link l. Now the task term for link lis written as: TaskTerm(l) = X fsd∈F Bsd ·rl sd.(6.12) Next we explain how to represent the mapping properties MapSrc(l, fsd) and MapDst(l, fsd). Consider the horizontal east link of a cell with coordinates (xlb, yl) to a cell (xle, yl) (Fig. 6.2b). The XY-route of flow fsd can only pass through the link in case the source task tsis mapped onto one of the two dotted processor cells. Indeed, the processor psshould be located on the same row and in a column that is lower than or equal to the origin of the link: (xs≤xlb)∧(ys=yl). Hence, the source mapping property for an east link is: MapSrc(l, fsd) = X pj:xj≤xlb, yj=ylX vk∈V asjk.(6.13) For the destination task tdthe requirement is to be located in a column that is greater than or equal to the link endpoint xle (striped cells). The destination mapping property becomes: MapDst(l, fsd) = X pj:xj≥xle X vk∈V adjk.(6.14) 107 The mapping properties for south, west and north links are derived in a similar manner. Now consider the term related to the memory controller traffic. For link llet us denote Req(l) the set of processors that send requests to their controllers through link l. Similarly, Rep(l) is the set of processors that receive replies from controller through l. Hence, traffic to and from controllers through lis defined by the rate of tasks mapped to the sets Req(l) and Rep(l): McTerm(l) = X ti∈T X pj∈Req(l)X vk∈V aijk ·ρ·Λ(ti)+ X ti∈T X pj∈Rep(l)X vk∈V aijk ·(1 −ρ)·Λ(ti).(6.15) The sets Req(l) and Rep(l) can be expressed similarly to the MapSrc and MapDst properties for links. As an example, let us consider the same east link (Fig. 6.2b). Assuming XY-routing, pjsends requests in the direction of the associated controller. Hence, the set of processors sending requests through the link is limited by those, associated with the EAST controller and located on the same row in the column that is lower or equal to the link origin: Req(l) = {pj: (MC(pj) = EAST)∧(xj≤xlb)∧(yj=yl)}. The sets for other links are derived similarly. The inequalities (6.9) together with the scaling relations (6.10), (6.11) and definitions (6.12)-(6.15) guarantee that the link capacity constraints are met. The last step is to specify the bandwidth constraints of the memory controllers. The bandwidth of controller mcκ∈MC is defined by the rates of tasks mapped onto processors, associated with mcκ: ∀mcκ∈MC :X ti∈T X pj:MC(pj)=κX vk∈V aijk ·Λ(ti)≤McBw.(6.16) Problem formulation The problem can now be formulated as follows. Minimize:power consumption (6.1) subject to: assignment constraints and hop-count definition (6.2)-(6.5), 108 voltage selection constraints (6.6), (6.7), throughput constraints (6.8), link capacity constraints (6.9)-(6.15) and memory bandwidth constraints (6.16). 6.3 Mapping by metaheuristics This section discusses two metaheuristics commonly used to solve complex combinatorial problems: Simulated Annealing (SA) [80] and Extremal Optimization (EO) [24]. Both methods are inspired by equilibrium statistical physics. SA has been successfully applied in many EDA problems, mostly related to layout synthesis. However, EO has emerged as a very competitive alternative that can give superior results in quality and computational cost. This section shows how EO can be customized to effectively solve the task mapping problem. The results prove the superiority with regard to SA. The SA and EO metaheuristics have already been considered in Chapter 5. In this section they are reviewed again for self-containment of the present chapter. Both metaheuristics start from an initial mapping obtained by greedily placing the tasks with highest throughput to the fastest processors. It is assumed that the system is not highly throughput-constrained and that a feasible initial assignment can be achieved by a greedy heuristic. The bandwidth constraints may be violated in the initial mapping and will be handled during the optimization process. Simulated annealing The general algorithm for SA is described in procedure 4. To evaluate every configuration, two functions are used. Cost() returns the cost of a configuration, calculated as the total system power according to equation (6.1). CapP() calculates the penalty for link capacity and memory bandwidth violations: CapP =X l∈L max Bl−Cap Cap ,0+X mc∈MC max Bmc −McBw McBw ,0, where Blis the total bandwidth of flows routed through link land Bmc is the bandwidth of controller mc. If all constraints are satisfied, then CapP = 0. The SA algorithm implements a conventional annealing schedule. Given the initial temperature Tinit and the cooling factor α, a new solution (NewSol) is generated (line 4) and may be accepted probabilistically, depending on the current temperature Tcur (line 5). The value of Tcur decreases as the system evolves in time (line 8). 109 Procedure 4 SimulatedAnnealing 1: Tcur =Tinit 2: while improvement in last kiterations do 3: for P iterations do 4: generate NewSol 5: if Accept(CurSol,NewSol)then CurSol←NewSol 6: if Cost(NewSol)<Cost(BestSol)then BestSol←NewSol 7: end for 8: Tcur =α·Tcur 9: end while 10: return BestSol Procedure 5 Accept(CurSol,NewSol) 1: CurCost←Cost(CurSol) + λCapP(CurSol) 2: NewCost←Cost(NewSol) + λCapP(NewSol) 3: if NewCost <CurCost then return true 4: else return true with probability Pa For every temperature, a number of moves that depends on the size of the system (P, that is the number of cells) is generated. NewSol is obtained by swapping a pair of random tasks and is accepted probabilistically according to Procedure 5. To penalize capacity violations, the cost is calculated as shown in lines 1-2, where λ=Tinit/Tcur is the weight for penalization, that grows in time. This decreases the probability to accept infeasible solutions as the simulation advances. Solutions with better cost are always accepted (line 3), whereas worse-cost solutions are accepted with probability Pa: Pa=e−γ, γ =NewCost CurCost ·1 Tcur ,(6.17) This probability depends on two factors. The former avoids the acceptance of solutions with high cost degradation. The latter increases the probability of hill climbing as the temperature cools down. As in Chapter 5, the initial temperature, Tinit, is calculated so as to obtain a high initial acceptance probability, such as Pa= 0.95. This is done by first evaluating an average ratio of the NewCost and CurCost during Piterations (Pis the number of processors), and then using the obtained value in (6.17) to calculate the temperature for the desired value of Pa. 110 Extremal optimization This section proposes Extremal Optimization (EO) [24] for solving the task mapping problem. The idea of EO was introduced in Section 5.4. As a reminder, EO evolves by selecting against the worst components of the system. For the task mapping problem, EO evaluates the fitness of each task in the mapping configuration. A high fitness value indicates that the task has a comfortable low-cost status in the configuration. EO focuses on improving the status of tasks with low fitness. At each iteration EO selects a pair of tasks to be swapped: an unfavorable task (tu) and a replacement task (tr). Unlike SA, EO uses information about the system cost when selecting the swapped tasks. This results into a faster progress towards the final solution. In addition, EO accepts new solutions unconditionally without depending on any temperature cooling schedule, thus making the algorithm easier to tune. The mapping problem can be considered as a multiobjective optimization problem, since the Pcomp,Pt comm and Pmc comm terms of the cost function (6.1) depend on weakly related voltage level and hop-count values. It was observed in [44] (and proved by our experiments) that the multiobjective EO operates better by interleaving the optimization of individual objectives in time, rather than trying to optimize all of them simultaneously. This suggests to introduce different fitness functions for the optimization of three power components and alternate them at different iterations of the algorithm. The EO algorithm is outlined in procedure 6. After the definition of an initial solution (greedily), the execution is continued until no further improvement is observed during a certain number of iterations. At the beginning of each iteration, local search is performed by sequentially swapping Prandom pairs of tasks and accepting only those that improve the cost. This variant contributed to improve the cost of the final solution and the speed of the algorithm [140]. The core of the algorithm focuses on selecting the pair of tasks that must be swapped. The fitness functions alternate depending on the iteration number. In one case, fitness is oriented to improve the power consumption generated by intertask communication, considering the hop-counts and bandwidth parameters. In the second case, the power of communication with memory controllers is optimized. The last case addresses the power generated by computations. The first task, tu, is selected by using the Φufitness function and sorting the tasks according to the fitness value. The second task, tr, is selected by ranking the task according to the improvement in cost that the swap would produce (Φrfunctions). The power law described by equation (5.6) is used to select the tasks randomly. 111 Procedure 6 ExtremalOptimization 1: CurSol←BestSol←”Some initial solution” 2: while some improvement in the last kiterations do 3: Local search: swap Prandomly selected pairs sequentially and 4: accept only those that improve the cost of CurSol 5: if (iter mod 3) = 0 then /* improve task comm. cost */ 6: sort all tasks in ascending order of Φcomm u,t 7: select tuaccording to equation (5.6) 8: sort all tasks ti6=tuin ascending order of Φcomm r 9: select traccording to equation (5.6) 10: else if (iter mod 3) = 1 then /* improve mc comm. cost */ 11: sort all tasks in ascending order of Φcomm u,mc 12: select tuaccording to equation (5.6) 13: sort all tasks ti6=tuin ascending order of Φcomm r 14: select traccording to equation (5.6) 15: else /* improve comp. cost (iter mod 3 = 2) */ 16: sort all tasks in ascending order of Φcomp u 17: select tuaccording to equation (5.6) 18: sort all tasks ti6=tuin ascending order of Φcomp r 19: select traccording to equation (5.6) 20: swap tasks tuand trin CurSol 21: if Cost(CurSol)<Cost(BestSol)then 22: BestSol←CurSol 23: end while 24: return BestSol Finally the locations of tasks of tuand trare swapped unconditionally and BestSol is updated if the cost is better than any other solution visited so far. Fitness functions To model the fitness for the power consumption generated by the inter-task traffic on the mesh, Φcomm u,t ranks the tasks according to the product of total traffic and the square of hop-count of the involved flows: Φcomm u,t (ti) = −X fsd:(ts=ti)∨(td=ti) Bsd ·(hx sd +hy sd)2. The square of hop-count tries to balance the length of the flows. It penalizes tasks with longer flows, rather than those with high bandwidth, since Bsd is a constant parameter that cannot be changed. The selection of the ranked tasks tends to pick 112 tasks with high communication cost. The negative sign allows to rank the tasks in ascending order of fitness. Similar fitness is used to select unfavorable task timapped to processor pjfor the controller-related term of power: Φcomm u,mc (ti) = −Λ(ti)·McDist(pj)2. Although the fitness functions selected for both terms of communication power look similar, we consider them as individual candidates for multiproduct optimization. The intrinsic difference between the two types of communication is that an inter-task flow depends on mapping of both, source and destination tasks, while the memory controller flow depends on one, either source or destination task. The fitness function for the replacement task tris the same for both types of communication. It aims at selecting a task that, when swapped with tu, would mostly decrease the communication cost and contribute to reduce the violations of maximum bandwidth: Φcomm r(ti) = Cost(NewSol) ·(1 + CapP(NewSol)), where NewSol is the solution obtained by swapping tiand tu. The computation-oriented fitness functions aim at finding power-efficient solutions by smoothing the voltage spillover in the voltage islands. Let us call Vmin i the minimum voltage required to guarantee the throughput of task tiassigned to a processor in some voltage island ιn. Since task is living in the same island with other tasks, it may not be possible to assign Vmin ito it, as other tasks may require a higher voltage. We define the voltage spillover of tias Spilloveri=Vmin i−V, where Vis the average minimal voltage of all tasks allocated in the same voltage island. The dispersion of island ιnis defined as Dispersionn=X ti∈ιn (Spilloveri)2. and measures the voltage imbalance for the island. High dispersions imply less power-efficient solutions, as more processors operate at voltages higher than required. Computational fitnesses aim at decreasing the voltage dispersion of the system. The unfavorable component is selected from the tasks with the high spillover value: Φcomp u(ti) = −Spilloveri. 113 30 35 40 45 50 55 60 0.5 1 1.5 2 2.5 3 3.5 4 Link capacity (Gbps) Power (W) SA EO min capacity = 0.91 Figure 6.6: Impact of link capacity on system power. Although the gap between the EO and SA costs decreases as the capacity approaches to Capmin, EO wins in power for all considered values. This example represents the typical behavior, observed for both metaheuristics, when optimizing a configuration subject to capacity constraints. 6.5 Conclusions This work has addressed the problem of static task mapping for large-scale tiled CMPs with multiple voltage islands, as one of the approaches to reduce design cost and time-to-market. The problem formulation considers task throughput requirements, on-chip and off-chip memory traffic, and bandwidth constraints. Experimental results prove that: •Metaheuristic-driven search efficiently solves the task mapping problem for CMPs with predefined voltage islands. The quality of the search is verified by the ability of metaheuristics to discover optimal solutions for moderate-size examples, for which the optimum is known by solving the MILP. 120 •EO outperforms SA in both, quality of the final solution and execution time. This fact makes EO very competitive in application to the mapping problem, comparing to the widely adopted SA metaheuristic. •The proposed method is scalable, as demonstrated by performing task mapping of application graphs with hundreds of tasks onto large-scale CMPs. The proposed approach has certain limitations. One of them is the requirement for each core to hold at most one task. To eliminate this constraint, the problem of dynamic task mapping or scheduling has to be addressed. The future work in this direction is summarized in Chapter 8. 121 Chapter 7 Link Allocation for NoC Topologies Networks-on-chip lie at the heart of modern on-chip systems, realizing communication between the components of many-core CMPs and ASICs. In order to make NoCs efficient in terms of performance and cost, a complex design process is required. This process demands for the completion of multiple tasks, including topology selection and mapping, physical planning, design of routing algorithms and switching schemes, and other optimization problems. Individual tasks are traditionally addressed within a sequential flow, one after another, often leading to suboptimality of the final solution, due to the difference in optimization criteria. Hence, it is very desirable to develop methods which combine several tasks in one problem and explore the complete solution space in a way that all design constraints are met and the implementation cost is minimized. This chapter proposes a model for simultaneous topology customization and route allocation for networks-on-chip. The presented approach can be applied to both, application-specific SoCs, characterized by the communication graph, and generalpurpose CMPs, modeled with a complete communication graph and uniform traffic requirements. It focuses on the strategy for removing particular links from a complete regular topology [27], which is referred to as the link allocation problem for regular topologies. More precisely, link allocation can be defined as the problem of searching for a subset of links that satisfy the communication requirements of the system and minimizing the design cost. The contribution of this research is a mathematical programming model for simultaneous link allocation and deadlock-free route assignment for on-chip interconnects, published in [98]. This model is capable of finding minimal deadlock-free routes for irregular topologies, which is an important problem for the interconnect power minimization [89]. 123 (a) Full mesh (b) Partial mesh (c) Minimal stronglyconnected mesh Figure 7.1: Different link allocation solutions for a 3x3 mesh. 7.1 Model overview This section gives an overview of the contributions of the work by using a simple example. In this work, we consider communication topologies that can be mapped onto a two-dimensional grid. Every link can connect two adjacent routers and the transit time through each link is constant and known a priori. We also assume that the system has already been floorplanned and each PE is connected to a router. Figure 7.1 shows three different topologies based on an underlying 3x3 mesh. Figure 7.1a depicts a fully-connected mesh in which all possible links have been laid out. This topology can provide a very high performance. Every router can reach any other router in no more than four hops. However, this topology requires a costly implementation in wiring and router area. Every router implements a crossbar that has a quadratic cost on the number of links of the router. On the other hand, Fig. 7.1c shows a mesh with the minimum number of links to preserve strong connectedness, which results in a very area-efficient implementation. However, the diameter of the network doubles since some routes may require eight hops to communicate one PE with another. Additionally, some links may become over-congested if they have to be shared among different routes that carry dense traffic, thus incurring in a significant throughput penalty due to the contention in the network. The designer will probably want to find an intermediate topology that satisfies certain throughput constraints with a reduced implementation cost. Figure 7.1b depicts one of these solutions. The cost has been reduced by removing some of the links of the full mesh. However the diameter has already been increased (some routes require five hops). This may also involve extra congestion in some specific links. The solution space of this type of problems is huge. It becomes even larger when we consider the route assignment problem. Figure 7.2a depicts the communication 124 (a) (b) (c) 1 2 3 4 5 6 1 2 3 4 65 1 2 3 4 5 6 Figure 7.2: (a) Communication graph; (b) and (c) two different link allocation and route assignment solutions. graph for six PEs that need to exchange information. In this particular example, every PE is assumed to be attached to a router. Figure 7.2b shows a solution in which the links have been allocated to provide a minimum hop-count for every communication edge. The routes are represented by the dotted lines. The longest routes are for the pairs (1,4), with the route 1 →2→4, and (3,6), with the route 3→5→6. Let us assume that the traffic through the links 1 →2 and 2 →4 is very congested due to the intensive communication requirements of the PEs attached to those routers. Let us also assume that edge 1 →4 is not critical and has a low priority. Hence, the designer might consider to deviate the traffic 1 →4 through another route, as shown in Fig. 7.2c. This solution implies an extra link in the network, but may contribute to meet the throughput requirements of the system. Note that the route 1 →3→5→6→4 is not using the shortest path. The model presented in this work allows the exploration of non-optimal paths to alleviate the traffic in congested links. Even though this work assumes a 2D grid as the underlying structure, the topology of the network is not limited to regular meshes. Irregular meshes with PEs exceeding the size of one tile can also be considered, thus providing an extra flexibility in the exploration of solutions. Furthermore, the links are not constrained to have equal length. This makes the design flow even more flexible in terms of floorplanning and placement. 125 Sketch of the model To explore the space of solutions, the mathematical model presented in this work introduces a set of constraints for link allocation, route assignment and deadlock avoidance. The set of constraints can be extended to cover other design criteria. One of the most practically important constraints is the limitation of the number of ports in every router. As it will be discussed further, port limitation highly reduces the complexity of the router, thus saving area and power resources of the system. The traditional link capacity constraint is also supported. These two types of constraints are associated to physical requirements of the design. To guarantee a sufficient performance in the system, a set of delay constraints are defined. These constraints are modeled as a maximum hop-count (structural latency) for each net1. The communication demands are defined by the bandwidth requirement between each pair of PEs. An essential property of route assignment is deadlock and livelock freedom. The incorporation of turn prohibition constraints guarantees the absence of any deadlock and livelock in the explored solutions. The mathematical model includes four optimization objectives in the cost function: the minimization of the number of links in the grid, the maximum hop-count over all nets, the total net delay (sum of all net delays) and the uniform traffic distribution. The first objective is related to the area optimization, whereas the other three objectives guide the search toward increasing the performance of the system. The constraints of the model can be represented as linear inequalities with integer and real variables. In this way, the problem can be specified with a mixed-integer linear programming (MILP) or mixed-integer quadratic programming (MIQP) model, depending on the cost function. The term mixed-integer programming (MIP) will be used to refer to both problems interchangeably. Even though these are NP-complete problems, the experimental results show that optimal solutions can often be found with moderate computational cost. Section 7.3 will present results obtained from different benchmarks. 7.2 The integer programming model This section presents the MIP model for link allocation and route assignment problem. Table 7.1 summarizes the input parameters for a quick reference. We introduce several types of variables and set notations to formulate the problem. The summary of the MIP notations can be found in Table 7.2. 1We refer to a net as a logical connection between two PEs, represented as an edge in the communication graph. 126 Table 7.1: Input parameters of the problem. Input Description (x, y) Grid size nNumber of nets BkRequired bandwidth for net Nk DkMaximum hop-count for net Nk CjCapacity of link Lj Pi,in Maximum number of input ports for router Ri Pi,out Maximum number of output ports for router Ri Table 7.2: Notation for the MIP problem. Notation Type Description LjLink presence in the solution Lk jBinary variable Link usage by net Nk TpProhibition of turn Tp Dmax Real variable Maximum net delay I(Ri)Set Incoming links of router Ri O(Ri) Outgoing links of router Ri Parameters and variables of the problem The problem consists of defining a set of routes in a 2-dimensional grid structure that satisfies a set of physical and performance constraints. The routes must support the communication among the PEs of the system. The grid structure with size (x, y) is represented as a directed graph G(R,L). The vertices of the grid define a set of routers R={R0, .., Rr−1}, where the total number of routers is r=x·y. The edges of the grid define a set of uni-directional links L={L0, .., Ll−1}, where the total number of links for a grid with size (x, y) is calculated as l= 2 (x(y−1) + (x−1)y). A global assumption about the grid is that every pair of neighboring routers may have up to two uni-directional links to send data in both directions. Each link Lj has a maximum capacity parameter Cj(flits/cycle). It limits the amount of data that can be transmitted over the link in one cycle. Another input of the problem is the underlying communication graph GC(PE,N) that represents the logical connectivity of the network. Every vertex represents a 127 processing element and every edge represents a logical connection between a pair of processing elements. Every edge in the set N={N0, .., Nn−1}is a net of the system. Each net Nkhas two associated parameters: the required bandwidth Bk (flits/cycle) and a maximum delay constraint Dk(hops) for the packet transmission from source to destination. The additional parameters Pi,in and Pi,out specify constraints on the number of input and output ports for router Ri, respectively. Path selection constraints We focus on the deterministic routing path selection, without considering path diversity mechanisms. The latter would allow multiple paths for a pair of communicating processors. On the contrary, we assume there is only one path to send data packets for each communicating pair. Path diversity is an option for the routing path selection task. Our assumption for considering only one path eliminates the need to perform packet ordering at the destination router. We start the constraint set description with introducing the basic mechanism for path selection and link representation in the model. Any configuration for link allocation contains a subset of links from the full grid. The presence of each link in a configuration is represented by the set of variables Lj2, i.e., Lj= 1 iff link Ljis present in the configuration. The routing paths for every net are represented by another set of binary variables Lk j, specifying the fact net Nkuses link Ljin its routing path. As we show below, this provides high flexibility for the solution space as every net may be routed through any arbitrary subset of links. To reduce the potentially large number of Lk jvariables (n·l), it is possible to introduce rules that bound a routing region for a net. For example, we may not be interested in having long routing paths for the short nets with source and destination routers located at the neighboring grid vertices. In this case we may limit search region to be within few hops. An example is presented in Fig. 7.3. Net Nkis connecting two neighboring nodes, located in the corner of the grid. By limiting the maximum path length to 5 hops, only 10 links are eligible for selection in the route (marked with dashed lines). The max-hop constraints contribute to significantly reduce the number of link variables. The sets of variables Ljand Lk jare both related to the selection of link Lj. The Lk jvariable defines the relationship between a link and a particular net Nk, while Ljdefines whether there is at least one net Nk0∈ N such that Lk0 j= 1. In other words, ∀k:Lk j⇒Lj. Assuming both sets Ljand Lk jconsist of binary variables and 2For the sake of notation simplicity we use Ljto denote both the variable and the link. 128 k N Figure 7.3: Path region limitation for Nkwith 5 hops. nis the total number of nets, we can write the following relations for each Lj: Lj≤X N Lk j, X N Lk j≤n·Lj.(7.1) These two constraints guarantee the consistency of the variables from both sets in the MIP model. We now formulate the set of routing constraints that allow one and only one path selection for each net. Let us denote the set of incoming links to the router Rias I(Ri) and the set of outgoing links as O(Ri). For each net Nkwith source at router Rs, destination at router Rdand any intermediate router Ri∈ R\{Rs, Rd}, the following constraints are defined: for Rs:X I(Rs) Lk j= 0,X O(Rs) Lk j= 1 for Rd:X I(Rd) Lk j= 1,X O(Rd) Lk j= 0 (7.2) for Ri:X I(Ri) Lk j=X O(Ri) Lk j. The first two equations in (7.2) represent the boundary conditions on the path for the source and destination routers, while the last one can be treated as a path maintenance constraint for the intermediate routers. Indeed, the source router Rsis the one that injects the Nkpackets into the network, thus there should be no input links to this router. The number of output links, carrying the Nkpackets from Rs should be equal to one, as we allow only one path for each net. The inverse situation 129 constraints for particular nets may still be incorporated). The introduction of a new variable to represent the maximum delay, Dmax, is required: X L Lk j≤Dmax.(7.11) and the cost function is simply: min Dmax.(7.12) Total net delay The minimization of the total delay over all nets (that is equivalent to minimizing the average net delay) can be regarded as another performance metric. The cost function in this case is obtained by summing all the net-related variables Lk jfor all nets from N: min X NX L Lk j.(7.13) Uniform traffic distribution this cost function aims at assigning a uniformly distributed traffic over all the links of the network. The distribution tends to decrease the contention delays in the network and, hence, increase the overall network performance by improving the throughput and the average packet delay. This cost function introduces quadratic terms, so the problem becomes an IQP problem. A more uniform distribution is obtained by minimizing the sum of the squares of the link traffics: min X L X N Bk·Lk j!2 .(7.14) Problem formulation Having discussed the set of the constraints and the cost functions, we are now ready to present the formulation of the MIP problem for link allocation and route assignment: Find the optimal value for a cost function obtained as a linear combination of (7.10), (7.12), (7.13) and (7.14) 136 subject to physical constraints (7.7), application-specific communication constraints (7.8), performance constraints (7.9), deadlock-avoidance constraints (7.4), (7.5), (7.6) and additional model constraints (7.1), (7.2), (7.3), (7.11). Note that the user is free to select a subset of constraints if certain features are not required for the design. The cost function can also be extended with small effort due to the flexibility of the model. 7.3 Experimental results This section presents the experimental results to demonstrate the functionality and the quality of the proposed MIP model. We define the trade-offs and discuss the results for several design problems with various constraint sets and optimization objectives. We use CPLEX [3] to solve the MIP model and an accurate flit-level C++ simulator with a variety of routing schemes to obtain the network parameters. Different testcases are used throughout the experiments: we start with artificial configurations and we next consider a testcase with typical server workloads from the SPEC2006 benchmarks. Three types of the experiments are introduced. First, the area-performance tradeoff is analyzed. Second, the application of the model for performance optimization by means of the routing paths redistribution is considered. Finally, the use of port limitation constraints for design exploration and tuning is presented. Area-performance trade-off One of the optimization tasks in the design of multiprocessor interconnection network is the minimization of the number of links. Given a set of constraints, the goal is to find the minimal number of links that satisfy the constraints, determine the link allocation and assign the traffic routes. This optimization contributes to decrease area and leakage power. However, the average hop-count delay may increase as the number of the links decreases and the packets have to follow longer roundabout paths. For this reason, the dynamic power may also increase. Note, that the variation in power will be defined by the relation between leakage and dynamic power. 137 (a) Minimal link number (b) Minimal hop-count Figure 7.8: Link allocation solutions for a 4x3 network. (a) Minimal link number (b) Minimal hop-count Figure 7.9: Deadlock-free link allocation for a 4x3 network. This set of experiments demonstrates the ability of the model to explore the areaperformance trade-offs by link reallocation. Given the communication graph, we first search for the minimal number of links to enable the connectedness of all routers and estimate the maximum net delay value. Additionally, we investigate minimal link solutions subject to the limitation on the maximum net delay. In order to find the minimal link allocation, we solve the problem with the cost function in form (7.10). We apply the constraints (7.9) to limit the net delay and (7.4)-(7.6) to guarantee the deadlock freedom. We show the area-performance trade-off for a 4x3 network with a complete communication graph, i.e. with net between every pair of processing elements. The minimal number of links required to connect all routers is 12 and forms the unidirectional ring topology, that is depicted in Figure 7.8a. For this allocation the packet delivery will take up to 11 hops for some nets. However, the diameter of the network can be reduced to 5 hops. The solution obtained with this delay limitation is presented in Fig. 7.8b. It incorporates 20 links, but the delay for any net is now guaranteed not to exceed 5 hops. Obviously, there is a trade-off between these two cases. We explore it by varying the delay constraint value in the specified range. The set of solution points is displayed in Fig. 7.10 (“Minimal”). Based on this dependency, one can determine the minimal number of links to guarantee a particular network diameter (for example, 14 links are required for the 8-hop network). 138 10 12 14 16 18 20 22 24 26 28 4 5 6 7 8 9 10 11 12 Minimum number of links Maximum net delay (hops) Minimal Deadlock-free Figure 7.10: Area-performance trade-off points in terms of the link number and net delay for a 4x3 network. Another important property is deadlock freedom. We provide a similar function after incorporating the turn prohibition constraints into the problem. Due to the extra limitations in routing paths, deadlock-free solutions tend to include more links for the same hop-count limit. Thus, the minimal number of links to provide full connectivity is 22 (Fig. 7.9a) and the solution with minimal delay of 5 hops has 26 links (Fig. 7.9b). This trade-off is also depicted in Fig. 7.10 (“Deadlock-free”). Finally, we note that even the “Minimal” solutions can be designed to be deadlock-free by choosing a suitable architecture. For example, the solution shown in Fig. 7.8a can be realized in practice by using a token-ring architecture [47] or virtual channels and dateline scheme [39]. Our model is also capable of discovering well-known structures, such as the bi-directional ring, that is seen in the variety of cell processors [90]. This proves that the class of the generated solutions is actually used in practice. The area-performance trade-offs discussed in this section demonstrate the suitability of the model for design exploration and optimization. By incorporating additional application constraints, the user is allowed to perform more accurate, application-specific optimizations. 139 0 15141312 10 11 123 7654 8 9 Figure 7.11: Underlying mesh for a typical server workload testcase. Performance optimization by route reassignment Another application of the model is related to the optimization of the network delay by routing path redistribution. In this experiment we assume the communication requirements of the network, including the nets and their bandwidths, are specified. The objective is to minimize the average packet delay of the network. The average optimal hop-count delay can be obtained with the cost function (7.13), but the contention affects the delay value significantly once the network enters the saturation region. However, the contention delays can be alleviated by distributing the traffic uniformly over the network. For this purpose, we are using the cost function (7.14) to select routing paths that distribute the traffic more uniformly. The quality of the solution is estimated by simulation and compared to that of the XY and odd-even routing algorithms. Using the example of a typical server workload, we demonstrate that the obtained solutions improve the network delay as compared to the classical routing algorithms for a wide range of injection rates. Furthermore, the throughput increases as the saturation occurs at higher injection rates. In this experiment we are considering the typical server workload traffic pattern collected using the SPEC2006 benchmarks. A 16-core application is assumed to be mapped onto a 4x4 full mesh, with all links present (Fig. 7.11). The cores connected to the routers 1 and 2 are the memory controllers that receive high traffic from the other cores. The traffic injected by each core is assumed to have Poisson distribution. In Fig. 7.12, the comparison for the average delay estimation at different traffic rates is shown. We draw the packet delay as a function of the total injection rate to the network (in packets/cycle), for each of the three mentioned routing algorithms: XY, odd-even and the one using routing tables, based on the MIP solution. The timeout for the MIP solution was set to 1000 seconds. Simulation shows that the average packet delay, obtained with the MIP routing, is better than the delays of XY or OE schemes in the large range of injection rates. The XY-routing is only winning slightly the MIP configuration when the injection rates are small, as contention is low and the XY scheme results into the most uniform solution. However, as soon as 140 0 10 20 30 40 50 60 70 80 90 100 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Average packet delay (cycles) Total injection rate (pkt/cycle) XY OE MIP Figure 7.12: Average delay depending on the injection rate. contention effects start to contribute significantly to the delay value (injection rates ≥0.3 pkt/cycle), the MIP routing improves the average packet delay, as compared to both XY and odd-even schemes. It can be also seen from the graph that the saturation occurs at higher rates, hence, the network throughput is increased. Design optimization by port limitation Port limitation is another feature introduced by the model in order to extend the user design flexibility. The ability to limit the number of ports provides the means to account for the router design complexity at the network planning stage. Typical routers with 5-in and 5-out ports (Fig. 7.7) have complex designs and are not capable of running the full bandwidth. Hence, a mismatch between the network floorplanning stage and the router functionality appears, resulting in a potential loss of performance. By limiting the maximum number of ports of the routers, the use of complex routers during the network planning is avoided. This limitation also allows the optimization of area and leakage power. We use a simple intuitive model to measure the area variation of the components in the network. We assume that the major network components are the links and the routers. The total link area is proportional to the number of links that is obtained from the MIP solution. The area of the router can be approximated by the 141 complexity of the crossbar and buffer area [48]. The crossbar area has a quadratic dependency on the number of ports, while the buffer area dependency is linear. We assume that the leakage power is proportional to the network area. In order to estimate the variation of the delay and the dynamic power of the solution, we use a simulator with the incorporated Orion power model [129]. The same typical server workload example of the system, mapped to the 4x4 network, will be used to demonstrate the port limitation functionality. We perform a set of experiments, aimed at finding the optimal route assignment and link allocation, subject to additional limitations on the maximum number of input and output ports of the routers. Further we estimate the network parameters and make comparison to the results obtained for the full mesh solution with XY-routing. In these experiments, the number of ports includes the local connections to PEs (see discussion of (7.7)). In the full mesh solution, there are no limitations on the number of router ports. The largest routers with 5 input and 5 output ports appear in locations 5, 6, 9 and 10 (Fig. 7.11). Table 7.3 shows the results of solving the route assignment and link allocation problem with the number of input, output or both types of ports limited to 4. Each row is related to a different experiment with a particular port limitation. The first two columns of the table represent the maximum number of ports that a router may have. The values in the following columns are normalized to those obtained for the full-mesh solution with XY-routing. Thus, the ratio of the total link, crossbar and buffer area is reported in columns from third to fifth. The average packet delay and dynamic power are reported in the last two columns. An example of the network layout for the experiment with 4-input and 4-output port limitation (4th experiment in Table 7.3) is depicted in Fig. 7.13. This layout contains 42 links instead of the 48 links in the full-mesh solution. The total area of links, crossbars and buffers in the presented solution has been decreased by 12.5%, 13.7% and 6.4%, respectively. One can observe the average packet delay increase by 9.9% as well as the dynamic power increase by 6.4%. The increase of average delay, unless the contention is high, is caused by the removal of links, since the minimal path for the neighboring routers rises to 3 hops. However, the increasing delay Table 7.3: Port limitation results for server workload testcase. Port limit Area Average Dynamic in out link xbar buffer delay power 5 5 1.000 1.000 1.000 1.003 1.001 5 4 0.916 0.928 0.969 1.037 1.027 4 5 0.916 0.928 0.969 1.040 1.037 4 4 0.875 0.863 0.936 1.099 1.064 142 Figure 7.13: Network layout with 4 input and 4 output port limitation. Links connecting routers with the co-located PEs are not shown. may be an acceptable solution if certain nets are not critical (see discussion of the example in Fig. 7.2). Otherwise, a designer is allowed to put a limiting hop-count constraint for the critical nets. The variation in power should be calculated together with the leakage power decrease, that is correlated with the network area. The total power estimation is technology dependent, but due to the growing importance of the leakage power resulting from the technology downscale [76], the variation in power may be negligible as compared to the area savings. This example demonstrates the potential introduced by the port limitation mechanism. Its applicability can be combined with other design constraints. This provides a designer with a vast spectrum of possibilities for exploration and tuning. Computational time The computational complexity of the IP model depends significantly on the number of binary variables of the model that determines the span of the branch-and-bound search. For a square mesh of Pprocessing elements, the number of variables is about 4P3. Still, efficient ILP solvers can handle this model for problems with moderate size. Table 7.4 shows the CPU time for solving the model with the link minimization cost function (7.10), that is the most time consuming linear cost function. The third column shows the time to find the minimal number of links that guarantee network connectedness. The last two columns report the CPU times for finding deadlock-free solutions, which are larger due to the introduction of the turn prohibition constraints. When an optimal solution is hard to find, a feasible solution close to the optimal might be also sufficient. The column “Feasible” reports the time required by the solver to find the optimal solution, while the rest of the time was spent to prove the non-existence of a better solution. The solution for the 4x4 network was obtained 143 Table 7.4: CPU time for link minimization. Number of Network Minimal link Deadlock-free (sec) cores size count (sec) Feasible Optimal 8 4x2 0.21 0.70 1.98 9 3x3 0.81 5.31 31.74 10 5x2 0.55 4.40 23.60 12 4x3 7.86 49.90 4031.25 16 4x4 147.96 2117.89 Timeout by defining a CPU timeout of three hours. The reported solution is the last one obtained within the timeout, without knowing whether it was optimal or not. Given the behavior for the other cases, we conjecture that this solution is very close to the optimal. The results show that optimal solutions can be obtained for moderate size networks. The model is also useful to partially explore the search space with CPU time limits, still obtaining high-quality solutions. 7.4 Conclusions The results of this work can be summarized as follows: •This research states the link allocation problem for regular topologies explicitly and proposes an approach for solving this problem simultaneously with the route assignment task. •This work is the first one to formulate an integer programming model for deadlock-free routing by turn prohibition. •A variety of constraints and cost functions is analyzed and applied for design space exploration of the on-chip systems. The model is capable of discovering well-known structures, such as the bi-directional ring, that is seen in commercial implementations [90]. This proves that the class of the generated solutions is actually used in practice. It has to be mentioned that the proposed model has a high computational complexity, as the majority of integer programming models. To improve the scalability of the approach, relaxation techniques for mixed-integer models can be considered. Future work for this problem is summarized in Chapter 8. 144 Chapter 8 Conclusions and Future Work The objective of this chapter is to conclude the work and to outline the directions in which the research could be continued. This work presents a number of contributions in the field of architectural design and deployment of many-core chip multiprocessors. First, the problem of efficient architectural design space exploration is addressed. Efficiency is obtained through the usage of analytical models and intelligent search strategies, instead of simulationbased exhaustive exploration. An important effect of the closed CMP system is demonstrated, which is the cyclic dependency between the latency and traffic of requests to the memory subsystem. This dependency is crucial to accurately estimate the interconnect contention, when evaluating the CMP performance analytically. Several numerical methods for resolving this dependency are presented and further used to build an analytical model of a complete CMP. The efficiency of the model is demonstrated by its ability to estimate the performance of a CMP with 700 components (including cores, memories and on-chip routers) in one second. The developed model is applied as a rapid and accurate performance estimator in a framework for architectural exploration. This framework encompasses many architectural parameters, including the core count, cache sizes, number of levels of the memory hierarchy, interconnect topologies, core architectures and others. Metaheuristic-based search is proposed to efficiently navigate through a large design space and discover optimal (or nearly-optimal) configurations, demonstrating orders of magnitude savings in run time, when compared to simulation-based methods. The search method is also shown to outperform simple exploration strategies both in CPU time and quality. An example of applying the framework to power-performance exploration of CMPs is given. Another contribution of this work is in the field of analytical modeling for on-chip interconnects. It is shown that the classical Markovian models provide pessimistic 145