Method and apparatus for handling memory accesses of a TCF-aware processor
By introducing a flexible delay processing unit into the processor to dynamically determine the memory access delay, it solves the resource waste and high overhead problems of the existing processor architecture when processing parallel threads, improves performance and programmability, and achieves more efficient memory access.
Patent Information
- Application Number
- CN201980089503.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-12-21
- Filing Date
- 2019-12-20
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2039-12-20
AI Technical Summary
Existing processor architectures have problems of resource waste and high overhead when processing a large number of parallel threads. Especially in MIMD and SIMD architectures, the number of hardware threads is fixed and cannot efficiently execute processes with controlled parallelism and heterogeneity among threads. Code, cache coherence and synchronization of shared memory architectures are expensive to maintain and impact performance.
A flexible delay processing unit is used, including local memory and control logic, to dynamically determine the shared data memory access delay. By sending a request and continuing to execute instructions after receiving a reply, a flexible memory access method is implemented, which is suitable for TCF-aware processors.
Improves processor performance and programmability, reduces energy usage, simplifies partitioning of processors into sub-machines, and provides better cost-effectiveness and flexibility to accommodate different types of code access needs.
Smart Images

Figure CN113348446B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates generally to computer technology. In particular, the present invention relates to memory access of a processor. Background Art
[0002] In relation to software involving multithreaded computation, the organization of efficient cooperation between a large number of parallel threads has been a fundamental problem due to the limitations of current models. The concept of parallel thick control flows (TCF) is introduced as a solution in V. Leppanen, M. Forsell, and JM. Makela, "Thick Control Flows: Introduction and Prospects", Proceedings of the 2011 International Conference on Parallel and Distributed Processing Technologies and Applications (PDPTA'11), Las Vegas, USA, pp. 540–546, 2011. When thick control flows (fibers are similar to threads in terms of the number of fibers) execute statements or expressions of a program, all fibers are considered to execute the same program element synchronously and in parallel. The concept of thick control flows allows the programmer to focus on the cooperation of a few parallel thick control flows instead of a large number of parallel threads.
[0003] Programmers can use the concepts of TCF to their advantage, and at least some implementation choices of TCF suggest that an alternative to the traditional concept of thread may be useful for processor cores because it allows flexibility in theoretical models, eliminates software and hardware redundancy, and simplifies the instruction storage system.
[0004] Previously reported in M. Forsell, J. Roivainen and V. "Outline of a Thick Control Flow Architecture", Proceedings of the 2016 SBAC-PADW Symposium, Los Angeles, CA, 2016, pp. 1-6. A Thick Control Flow Processor Architecture (TPA) is proposed for executing programs written for the TCF model.
[0005] Typically, most processor architectures utilize a multiple instruction stream multiple data stream (MIMD) model, where P instructions from different instruction streams are executed in P processing elements. This can waste resources for code containing self-similarity. A more optimized solution for such code is to use a single instruction stream multiple data stream (SIMD), where the same instruction for P data elements is executed in P processing units. Although SIMD is more cost-effective, easier to program, and its implementation has lower power consumption, it cannot efficiently execute code with controlled parallelism and heterogeneity between threads. The following fact raises another dimension of the problem: in the implementation of MIMD and SIMD architectures, the number of hardware threads is fixed, and the overhead increases when the number of software threads exceeds the supported number.
[0006] In order to accommodate code sections with different characteristics in terms of homogeneity, heterogeneity, number of threads and to be able to execute them efficiently, the TCF model is introduced - where homogeneous threads (or "fibers" as they can be called in relation to TCF to distinguish them from the more independent "threads" of conventional parallel programming) that pass through the same control path are combined into an entity called TCF - making it possible to exploit SIMD-style optimizations and retain the possibility of having multiple flows of the MIMD model when necessary. The TCF model does not provide a fixed number of threads, but rather some control flows with a certain thickness that can vary according to the needs of the application.
[0007] Another set of issues that affect parallel computing is related to devices that communicate with each other. In a shared memory architecture (SMA), data and program partitioning is usually performed by placing data that needs to be processed by multiple threads into shared memory and splitting the program more independently to the processors, making it easier to program compared to a message passing (MPA) architecture, where processing always occurs locally and the programmer is responsible for moving data around accordingly. Most SMAs use a distributed shared memory architecture consisting of multiple interconnected processor-cache pairs, which makes cache coherence (and therefore latency tolerance) and synchronization very expensive to maintain. This may even destroy their performance in communication-intensive problems.
[0008] To address issues such as the above, simulated shared memory (ESM) or shared memory emulation architectures have been introduced. They incorporate a group of multithreaded processors connected to a common, uniformly and synchronously accessible shared memory through a high-throughput intercommunication network. The memory system latency is hidden by superimposing ongoing memory references, and a special low-cost synchronization mechanism is established to ensure synchronization at the machine instruction level. ESM systems provide users with the perception of an ideal shared memory - even if the actual hardware architecture includes physically distributed memory. From a theoretical point of view, these architectures attempt to emulate an abstract parallel random access machine (PRAM), which is often used as a model for describing and analyzing the inherent parallelism of computational problems and the performance and cost of executing parallel algorithms due to its simplicity and expressiveness. The PRAM model usually refers to a group of processors working at the same clock and a uniform, single-step accessible shared memory connected to the group of processors.
[0009] Therefore, ESM is a viable technology to solve the programmability and performance scalability problems of chip multiprocessors (CMPs) because it produces implicit synchronization in the execution of machine instructions, efficient latency hiding, and sufficient bandwidth to route all memory references - even in the case of workloads with large random and concurrent accesses. Synchronous execution is considered to make programming easier because programmers do not need to explicitly synchronize the execution of threads after each global memory access, but can rely on the hardware to handle it automatically, while in MPA, for example, programmers are responsible for explicitly defining communication, synchronizing subtasks, and describing data and program partitions between threads, which makes MPA difficult to program. Latency hiding applied in shared memory emulation exploits a high-throughput computing scheme in which other threads are executed while one thread references the global shared memory. Because this throughput computing scheme uses parallel slack extracted from the available thread-level parallelism, it is considered to provide enhanced scalability compared to traditional symmetric multiprocessor and non-uniform memory access (NUMA) systems that rely on snooping or directory-based cache coherence mechanisms and therefore suffer from limited bandwidth or directory access latency and large amounts of coherence maintenance traffic.
[0010] The TCF model can be linked to the ESM and to an implementing processor architecture, ie a TCF aware processor, such as a TPA. The solutions required for this are outlined at a high level in the prior art, but the low level details of the implementation are not described.
[0011] For shared memory latency compensation, the prior art features a memory reply wait pipeline segment. This solution has a fixed segment length that works for a variety of workloads. The segment length is chosen at design time based on a close to worst case scenario. This solution can slow down execution—especially in low memory activity, partitioned, or locally optimized modes. Summary of the invention
[0012] An object of the present invention is to alleviate at least some of the problems associated with the known prior art. The object of the present invention can be achieved by the features of the independent claims. One embodiment of the present invention provides an apparatus for handling shared data memory access of a TCF-aware processor. The apparatus comprises at least a flexible delay processing unit, the flexible delay processing unit comprising a local memory and associated control logic, the local memory being provided for storing shared data memory access related data. The apparatus is configured to receive at least one TCF comprising at least one instruction, the at least one instruction being associated with at least one shred, wherein the flexible delay processing unit is configured to: determine whether the at least one instruction requires a shared data memory access; if a shared data memory access is required, send a shared data memory access request; observe, by the flexible delay processing unit, substantially continuously whether a reply to the shared data memory access request is received; suspend the continued execution of the instruction until a reply is received; and continue the execution of the instruction after receiving the reply, such that the delay associated with the shared data memory access is dynamically determined by the actually required shared data memory access delay.
[0013] A method according to independent claim 14 is also provided.
[0014] In view of the utility of various embodiments of the present invention, an apparatus and method for shared memory access (such as memory read operations) for a TCF-aware processor can provide a useful portion of a TCF-aware processor that can provide better performance, simpler programmability, and better cost-effectiveness than current alternatives.
[0015] The flexible delay processing unit may be considered as a functional entity comprising a local memory and a control logic. The local memory and the control logic may be implemented as separate physical entities that may reside at different locations, or they may be implemented as a common physical entity.
[0016] The local memory of the flexible delay processing unit may include a data memory that can be used at least logically by the flexible delay processing unit, wherein the local memory can store data about a plurality of instructions. The local memory may be a dedicated memory, or it may be integrated into some other element that can be used to execute control logic, such as hardware, e.g., a chip.
[0017] An apparatus according to an embodiment of the present invention may receive at least one instruction, wherein a determination as to whether shared data memory access is required may be performed by identification via one or more identifiers, operands, instruction words and / or operation codes, or some other suitable manner with which a person skilled in the art may be familiar.
[0018] The flexible delay processing unit may also be referred to herein as a flexible delay compensation unit (FLCU). The term TCF-aware processor refers to a processor that implements the TCF model and its special cases (including but not limited to ESM, configurable ESM (CESM) and vector / SIMD) (as described in the publications M. Forsell and V. "An Extended PRAM-NUMA Model of Computation for TCF Programming", International Journal of Networking and Computing 3, 1 (2013), 98-115) and all processors using similar delay compensation mechanisms. Therefore, in other words, the present invention can provide a method for processing memory access, which is also used for ESM, configurable ESM and vector / SIMD processors, which are covered by the term TCF-aware processor.
[0019] In some embodiments, the FLCU can be implemented to include a first-in, first-out (FIFO) style local memory controlled by pipeline logic. Here, FIFO style buffering can be used, which may bring some advantages (compared to other buffering techniques), such as ease of implementation and / or having smaller requirements related to silicon surface area, while still achieving high performance. In the case of using other buffering techniques (such as buffering techniques that can read memory reference results in any order), the buffering may be more complex, where address tables (e.g., there may be two layers) are used, which should be used in order to be able to find the correct buffered data. Other buffer types should also be used to implement more complex logic, which will take into account all unlisted rules when the received memory references can or cannot be executed in an order different from the order in which the corresponding memory reference requests were sent. On the other hand, the use of FIFO buffering can naturally be advantageous because it can maintain the sequence of fibers during the remainder of the pipeline.
[0020] However, in certain other implementations and use case scenarios, some other buffering techniques besides FIFO may be used. In alternative implementations, non-FIFO style buffers may provide some advantages, such as achieving even higher performance - for example, through even faster execution.
[0021] Depending on the latency of completed memory references, many advantages can be achieved by reading from the FLCU local memory (here, the local memory is also referred to as a buffer). If the instruction does not contain a shared memory read sub-instruction, there is no need to wait for the completed shared memory reference, and execution can be continued by the next stage of the pipeline by reading the FLCU local memory substantially continuously (preferably at each clock cycle). Therefore, the overall performance can be improved.
[0022] In an embodiment of the present invention, when instructions arrive at the memory unit / FLCU, the instructions may send their possible references to the shared data memory system. After this, the instructions (data defining the instructions) and related data (such as possible completed shared data memory references) can be written to the FLCU local memory (which may also be called FLCU buffer or FLCU FIFO buffer in the case of FIFO style buffering). On the other side of the FLCU local memory, the top-level instructions and data available from the FLCU local memory can be read in the following two cases:
[0023] 1. The required reply from the shared data storage system has arrived.
[0024] 2. No reply is required from the shared data storage system.
[0025] Compared with the existing fixed memory reply waiting pipeline stage, the present invention can allow immediate continuous execution when the above conditions allow without specifically waiting for a predefined delay.
[0026] Related to the above, an embodiment of the apparatus may include a flexible latency processing unit (FLCU) including a local memory for storing shared data memory access related data. The apparatus may also be configured to store data related to at least one received instruction in the local memory. The stored data about the at least one instruction may include data defining the instruction and / or data referenced by the instruction that may be obtained through the shared data memory access.
[0027] In an embodiment, the apparatus may be configured to store the shreds in local memory. As previously described, the data defining the instruction may be stored in local memory after sending a possible reference to the shared data memory system ("written to FLCU local memory"), and the data may also be stored to the memory reference being sent simultaneously or before sending the memory reference. The completed memory reference may be stored in local memory at the same time as the data defining the instruction is stored or at a different time.
[0028] By means of embodiments of the present invention, steps may be executed with dynamically varying lengths (related to the execution of instructions, preferably related to multiple fibers).
[0029] Because it can maintain low latency for low activity and locally optimized access patterns, the present invention potentially improves performance and simplifies the partitioning of processors into sub-machines.
[0030] In cases where partitioning may be affected, the child machines may be smaller, thus increasing flexibility.
[0031] Compared with the existing fixed memory reply waiting pipeline stage, the present invention allows execution to continue immediately when conditions permit without specifically waiting for a predefined delay.
[0032] By implementing the memory access method and apparatus through the present invention, a memory unit with flexible / variable latency or delay can be provided, wherein, however, the instruction sequence remains unchanged.
[0033] By the implementation of the present invention, the shreds executing instructions can be performed in the pipeline immediately or at least in the next clock cycle when receiving the memory reference. In the case of no reference from the shared memory, the delay or delay waiting for the memory reference to arrive can also be basically absent.
[0034] The present invention may therefore result in faster execution and potentially reduced energy usage.
[0035] In one embodiment, the apparatus may consist of a flexible delay processing unit, while in other embodiments, the apparatus may also include other entities. For example, the apparatus may include one or more processors, processor cores, caches, registers, pipeline structures, and / or ALUs (arithmetic logic units), which may be logically located before or after the flexible delay processing unit.
[0036] In one embodiment, the device may be implemented as a memory unit that may be included in a processor or may be implemented as a separate unit. For example, in some cases, the device may be organized on the same integrated chip as the processor.
[0037] The exemplary embodiments presented herein should not be interpreted as limiting the applicability of the appended claims. The verb "comprise" is used herein as an open limitation that does not exclude the presence of unmentioned features. Unless explicitly stated otherwise, the features recited in the dependent claims can be freely combined with each other.
[0038] The novel features which are believed to be characteristic of the invention are particularly set forth in the appended claims.The invention itself, however, will be best understood from the following description of specific exemplary embodiments, both as to its construction and its method of operation, together with further objects and advantages thereof, when read in connection with the accompanying drawings.
[0039] As will be appreciated by a person skilled in the art, the considerations previously presented in relation to the various embodiments of the apparatus may flexibly be applied to the embodiments of the method mutatis mutandis, and vice versa. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The invention will now be described in more detail with reference to exemplary embodiments according to the accompanying drawings, in which:
[0041] Figure 1 Demonstrates a feasible scalable architecture for emulating shared memory on silicon platforms,
[0042] Figure 2 is another representation of a feasible ESM architecture, which is essentially a CMP ESM architecture.
[0043] Figure 3 An example of using TCF to perform functions is shown.
[0044] Figure 4 shows the overall structure of TPA,
[0045] Figure 5 A method for retrieving data from a memory is shown,
[0046] Figure 6 A preferred method of retrieving data from a memory according to an embodiment of the present invention is shown, and
[0047] Figure 7 Another exemplary view of a method for retrieving data from a memory according to one embodiment of the present invention is given. DETAILED DESCRIPTION
[0048] First, the ESM framework will be reviewed. Figure 1In FIG. 1 , a high-level illustration of a scalable architecture for emulating shared memory on a silicon platform is shown. It includes a set of processors (cores) P1, P2, P3, ..., Pp 102 connected to physically distributed but logically shared (data) memories M1, M2, M3, ..., Mp 112 via a physically scalable high-bandwidth interconnect network 108. An active memory unit 110 associated with the data memory 112 can be considered as a memory control logic unit for handling memory references. The active memory unit 110 is arranged to manage computations related to the following situations: where, for example, during a multi-(-prefix) operation, multiple memory references are directed to the same memory location. Instruction memory modules I1, I2, I3, ..., Ip 104 are configured to carry program code for each processor 102. In order to efficiently emulate shared memory through a distributed memory-based implementation, the processors 102 are multi-threaded, utilizing a Tp-level loop, interleaved thread-to-thread pipeline (Tp ≥ average latency of the network). The PRAM model is tied to the architecture so that a complete cycle in the pipeline typically corresponds to a single PRAM step. In one step of multithreaded execution (in terms of the entire pipeline, i.e., all pipeline stages including the actual execution stage), each thread of each processor of the CMP executes an instruction that includes at most one shared memory reference sub-instruction. Thus, one step lasts multiple, at least Tp+1 clock cycles.
[0049] In the depicted architecture, step caches are typically associative storage buffers where data remains valid only at the end of an ongoing step of multithreaded execution. The main contribution of step caches to concurrent access is that they progressively filter out all but the first reference to each referenced memory location. This reduces the number of requests per location from Tp to P, allowing them to be processed sequentially on a single port memory module assuming Tp ≥ P. Scratchpads are addressable storage buffers used to store memory access data to limit the associativity of the step cache when implementing multi-operations with the help of the step cache and minimal in-core and out-of-core ALUs (arithmetic logic units) that handle the actual intra-processor and inter-processor calculations for the multi-operations. Scratchpads can be coupled with step caches to establish so-called scratchpad step cache units S1, S2, S3, …, Sp 106.
[0050] A basic idea of the solution described is actually to assign a set of threads to each processor core 102 that execute efficiently in an interleaved manner and hide network delays. When a thread makes a memory reference, the executed thread changes, and the next thread can make a memory request, and so on. If the reply to the thread's memory reference arrives at the processor core before the thread is re-executed, no memory delay will occur. This requires that the bandwidth of the network is high enough and hot spots in the pipeline memory access traffic can be avoided. For example, synchronization between consecutive instructions can be ensured by using elastic synchronization waves between steps.
[0051] Figure 2 At 200, a diagram of an ESM CMP architecture is shown that incorporates, for example, the aforementioned active memory unit 112B (with ALU and receiver) associated with a data memory module 112 and a scratchpad 206B. The network 108 may be a mesh interconnect network used as a high bandwidth pipelined memory system with switches 108B. When threads reference uniformly accessible distributed shared memory through the network 108, memory access latency is hidden by executing other threads. Congestion of references and hot spots in communication may be avoided using an efficient deadlock-free intercommunication architecture characterized by high bandwidth (halved BW ≥ P / 4) and random hashing of memory locations on the distributed memory modules. Execution of instructions occurs in steps corresponding to a single PRAM step, during which each thread executes a single instruction.
[0052] Next, we turn to the concept of TCF. The TCF model can package computational elements that contain similarities together to expose the natural synchronization of parallel execution, and provide a simple explicit mechanism to dynamically adjust the number of elements executed in parallel.
[0053] The TCF model is a programming model that combines homogeneous computations with the same control flow into a data-parallel entity controlled by a single control, rather than maintaining separate controls for each computation. The resulting entity is called a TCF, and its components are called fibers. The number of fibers in a TCF is called its thickness.
[0054] When a thick control flow (in terms of the number of fibers) executes statements or expressions of a program, all fibers are considered to execute the same program element in parallel. More precisely, we consider that certain program variables can be replicated per fiber - conceptually, this means that there are unique fiber-wise instances of variables. Expressions based on the use of replicated variables are also conceptually replicated - meaning that they need to be evaluated separately for each fiber. Similarly, statements can also be replicated. However, all expressions or statements executed by the thick control flow do not need to be replicated - naturally such non-replicated (ordinary) program elements only need to be evaluated / executed once by the thick control flow, rather than fiber by fiber. Therefore, as the thick flow proceeds on the program fragment, some expressions / statements are converted to single instructions, while replicated expressions / statements are converted to sets of instructions.
[0055] Consider a method call. When a control flow with thickness t calls a method, it does not call the method separately with each fiber. Instead, the control flow calls the method only once with t fibers. The call stack is not associated with each fiber, but with each parallel control flow. Therefore, the concept of a fiber as a thread is only implicit here. Thick fiber-mode variables are array-like constructs with fiber-mode actual values. Executing a branch statement can mean temporarily splitting the thick control flow into several other flows.
[0056] A TCF executes only one instruction at a time. The time it takes for all fibers of a TCF to execute an instruction is called a step. TCF execution is similar to SIMD execution, but multiple TCFs can be executed simultaneously and their thickness can vary arbitrarily. The TCF model ensures synchronization and strict memory consistency between consecutive instructions, making it sure that all shared memory actions initiated by previously copied instructions are completed before the operation of the current instruction occurs. This can reduce the cost of synchronization with respect to the ESM, because synchronization occurs once at each step defined by software rather than hardware. If there are multiple TCFs, their mutual execution order is not strictly defined, but the programmer can instruct them to follow a certain order through explicit inter-TCF synchronization.
[0057] Since the thickness of the TCF can be defined indefinitely by the programmer, it is easy to express the intrinsic parallelism of various computational problems without having to worry about running out of threads or having to match software parallelism to hardware parallelism with loops or explicit threads. In addition to reducing loop counts, the model can also simplify programming by eliminating thread-dependent index calculations.
[0058] Initially, programs are considered to have flows with a thickness of one (conceptually measured in terms of the number of parallel implicit threads). Methods can be considered to have a thickness that is related to the thickness of the calling flow. To dynamically change the thickness of a flow, we have thick block statements that set a new thickness for a block or thickness statements that set the thickness of a statement to be executed. For the former, nested thick block statements and ordinary block statements are supported. Consider a case where the thickness is T 外 Thick block B 外 Including thickness T 内 Internal thick block B 内 Nested blocks are not executed as fibers but as streams, so the stream that executes the inner thick block has a thickness of T, considering the stream thickness. 内 (Instead of T 外 ×T 内 ). In the case where the statement sets the thickness of the statements to be executed, the thickness of each code section is explicitly specified.
[0059] Executing control statements (if, switch, ...) can temporarily mean splitting the thick control flow into several other flows, such as Figure 3 As shown. The first block 302 with a thickness of one including two consecutive instructions can be further split into a second block 304 with a thickness of 23 and 8 consecutive instructions. The second block 304 can then be split into two parallel third blocks 306 and fourth blocks 308, where the third block 306 has an inner block with a thickness of 15, has a branch statement after 3 instructions, and is thereafter split into two other inner blocks, resulting in parallel branches with thicknesses of 12 and 3. The parallel blocks can be combined again after splitting.
[0060] The potential non-contiguous fiber subgroupings (non-contiguous indexes of implicit threads) generated by the splitting of thick control flows may be considered to be quite expensive to implement. Therefore, each parallel branch can be considered as a nested thick block, whose thickness is determined by the number of implicit threads that "select" the branch. The implicit threads of the surrounding blocks will not continue in the block determined by the branch statement. Since the above is equivalent to the parallel execution of multiple paths with a given thickness, it may be necessary for the entire flow to select exactly one path through the control statement. If the programmer wants to execute multiple paths in parallel, he should give a parallel statement, create multiple control flows accordingly and set the thickness for them. In addition to splitting the current flow into multiple parallel flows, the parallel statement can also implicitly combine the flow back to the calling flow at the end of the statement. It can be seen that all fibers of the control flow are synchronously passed through the common program code as in the dynamic SIMD model. When the flow is split into separate streams, the forward speed of the split flow cannot be assumed-that is, in this sense, the parallel flows are asynchronous relative to each other. However, if the programming language designer wishes, he can synchronize the execution at the machine instruction level.
[0061] The TCF model can be programmed essentially like other parallel programming models, but the nature of the model opens up the possibility for new conventions that have significant impacts on the notation, behavior, and / or interpretation of computations. These can include synchronous parallel programming, loop reduction of parallel statements, easy control of parallelism during execution, and shorter program code.
[0062] The ESM, CESM and vector / SIMD systems that are more extensively reviewed in prior art publications can then be considered as simple versions of the TCF system. In the case of ESM and configurable ESM, the thickness of the TCF will be one, and they can also be called threads, while for the case of vector / SIMD, the TCF can be called a vector, and fibers are called vector elements.
[0063] TCF functions can be executed faster in a true TCF-aware architecture than the same functions in a SIMD architecture - assuming the former supports TCF's superposition calculations.
[0064] Figure 4 The overall exemplary structure of a thick control flow processor architecture (TPA) is shown at 400, which is an architecture that natively implements the TCF programming model. Shown in the figure are an instruction memory (IM) 402, a processor front end (FE) 404, a local memory (LM) 406, a TCF buffer (TB) 408, a processor back end unit (BE) 410, a replicated register block (RR) 412, and a shared memory module (SM) 416. The TPA chip multiprocessor may include: F (super) scalar processor front ends 404, which are attached to the instruction memory module 402, the local memory 406, and the TCF buffer 408 organized as a conventional memory system for a multi-core processor; and B parallel processor back ends 410, which are attached to the replicated register block 412 and to the shared memory module 416 through a communication network 418.
[0065] The processor front end 404 can support fast switching between multiple TCFs, their management, and the execution of other common parts of control and code. Architecturally, they can be similar to multi-threaded superscalar processors instead of threads, with TCFs with their own register sets stored in TCF buffers. Following the terminology used for multi-threaded processors, this can be called multi-TCFing. The memory system of the front end 404 can include an instruction memory 402 and a local data memory 406, which are optionally interconnected through such a network that utilizes a symmetric multiprocessor (SMP) or non-uniform memory access (NUMA) convention and optional cache consistency maintenance. This shows that current multi-core processors can be used as front ends 404 with relatively minor modifications.
[0066] The processor backend 410 can support a streamlined shared memory system with fiber-style data and execute isomorphic parallel parts of the code. Their structure can be similar to that of an emulated shared memory (ESM) pipeline with dynamic fiber execution capabilities. Like ESM processors, they can use scalable latency hiding through multi-fiberization, reduce fundamental synchronization costs through wave synchronization, and improve low-level parallelism exploitation through the linking of basic units (FUs) such as arithmetic logic units (ALUs) to provide high performance in parallel execution.
[0067] The sending of information from the front end 404 to the back end 410 (and vice versa) may be managed by a work propagation network and a return channel 420. The work propagation network 420 may attach the front end 404 of the TCF-aware processor to the back end 410. Its primary purpose is to pass the operation codes of the back end functional units and selected data / operands. The return channel 420 may be responsible for sending the selected back end data to the front end 404 controlling the back end unit 410. Since there are typically multiple back end units 410 controlled by a single front end 406, the return channel 420 may pass multiple data values or alternatively be reduced to obtain a single value.
[0068] The idea of multi-fiberization is to execute other fibers while references to fibers are in progress in the memory system. If the number of fibers is large enough and the intercommunication network is not congested, the reply can arrive before the fiber needs it. The first synchronization method exploits the fact that fibers are independent within an execution step and synchronization actions can be performed only once per step. The second synchronization method allows synchronization to be superimposed with memory references. Together, these define a low-cost synchronization wave mechanism where the amortized overhead caused by synchronization drops to 1 / thickness. The idea of low-level parallel development is to connect FUs as chains so that units can use the results of their predecessors as operands, rather than connecting units that need independent operations in parallel. This can improve the utilization of FUs by allowing the pipeline to execute related sub-instructions.
[0069] The interaction between the front end 404 and the back end 410 can occur by distributing TCFs to a single front end 404 and multiple front ends 404 in an overlay manner. This single-mode dual-use operation can avoid the dual-mode operation and the switching overhead between them that exist in the ESM architecture. Support for infinite thickness can be achieved by dynamically generating shreds (or copy instructions) on the pipeline and saving shred-mode data to special copied register blocks, which overflow their contents to the external memory system if necessary.
[0070] The execution of instructions in a TPA architecture is somewhat different from the execution of instructions in a NUMA or ESM architecture. While a Fn-FU NUMA core executes at most Fn independent (sub)instructions in parallel, and a Fe-FU ESM executes instructions with at most Fe sub-instructions in an interleaved manner for a fixed number of threads per step, a TPA can execute sequences of front-end instructions and parallel back-end instructions in an interleaved manner for a variable number of TCFs with non-constant thickness. More specifically, the execution of a single TCF assigned to the front-end and multiple back-end units in a TPA can be performed as follows:
[0071] The front end 404, which is responsible for managing TCFs, can switch the next TCF from its TCF buffer and make it current if requested by the previous instruction. Otherwise it will continue to use the current TCF. The front end 404 can then execute a sequence of scalar instructions defined by the program counter and instruction memory. When it encounters an instruction containing a back end operation, it can attempt to send the operation and its operands to the associated back end unit 410 via the work propagation network 420. If the network is busy, the front end 404 can wait until there is room for a TCF and then continue until there is an explicit TCF switch request.
[0072] Execution in each relevant backend unit 410 may start by checking whether the unit is idle. In the affirmative case, the parallel operations on the head element of the work propagation network 420, their operands and necessary TCF information may be fetched to all relevant backend units 410 for execution. In the negative case, the instructions in the work propagation network 420 wait for the parallel units to become idle.
[0073] • The TCF can then be split as evenly as possible between the relevant backend units 410, and the backends start generating and processing fibers in parallel until they are exhausted.
[0074] During fiber generation, each fiber can obtain its operands, fiber identifier, and instructions for the FU from the data sent by the front end, while obtaining fiber-mode intermediate results from the replicated register block 412.
[0075] The fiber can then propagate through the pipeline and execute the sub-instructions in the back-end functional units.
[0076] More specifically, it can be specified that TPA instructions can be executed in three front-end stages and three back-end stages:
[0077] For each active frontend 404, the stages may include:
[0078] F1. If requested by the previous instruction, select the next TCF from the TCF buffer 408.
[0079] F2. Fetch one or more (sub)instructions pointed to by the PC of the current TCF from the NUMA memory system.
[0080] F3. Execute the sub-instruction in the functional unit specified by one or more (sub-)instructions. Memory sub-instructions are usually targeted at SMP / NUMA memory systems. If the instruction contains a back-end part, operands are selected and sent through the work propagation network 420 together with the part of the back-end 410 allocated to the front-end 404. The data of the current TCF is stored in the TCF buffer 408, and switched to the next TCF when the corresponding sub-instruction requests it.
[0081] For each backend 410, the stages may include:
[0082] B1. If the backend 410 does not execute the previous instruction any more, the next instruction is obtained from the work propagation network 420 and the fiber to be executed in the backend is determined. Otherwise, the previous instruction is continued to be executed.
[0083] B2. Generate the fibers of the TCF to be pipelined according to the allocation scheme determined in B1.
[0084] B3. For each fiber, you can perform the following operations:
[0085] B3.1 Select operands from the received front-end data and the copied register block 412.
[0086] B3.2 executes the backend subcommand. The memory subcommand targets the shared memory system.
[0087] B3.3 writes back the replicated register block and sends optional reply data back to the front end 404 via the return channel built into the work propagation network 420.
[0088] After all active TCFs of the front end 404 have executed for a single instruction, the TPA may issue a special synchronization TCF of thickness one per back end that sends and receives synchronizations to / from the shared memory system.
[0089] Figure 5A method for retrieving data from a shared memory is shown, which method can be implemented in a TCF architecture of a back-end unit, which method substantially corresponds to those methods that have been implemented in prior art solutions. For example, an ESM memory unit has been proposed before, in which a reply wait queue is adopted. The vertical lines can represent individual fibers that can be executed in a processor pipeline, wherein pipeline segment 1 represents the pipeline portion before the memory access processing, and pipeline segment 2 represents the pipeline portion that is at least logically located after the memory access processing, wherein the memory access processing refers to the memory access level of accessing the shared memory unit. If a reply from the shared memory unit is required, the sending logic 502 can send a request to the shared memory unit. The memory access operation can enter a pipeline having L wait stages LCR1...LCR L The delay compensation register transmission line (LCRTL) of the ESM system basically corresponds in its operation to the reply waiting queue of the known ESM system.
[0090] The LCRTL has L levels of delay compensation so that L can be a fixed segment length. The segment length L for various workloads is fixed, corresponding to, for example, the reply wait queue of an ESM memory unit. The segment length can be selected during the design of the MU based on a scenario that is close to the worst case. For example, if it is concluded that receiving a reply requires at most a certain number of clock cycles, then a number of clock cycles slightly less than that number can be chosen as a fixed reply wait time / segment length. Therefore, all types of memory references wait for the same predetermined time, which may be unnecessary because some memory references will be completed before that time. If the shared memory is busy, the entire back-end pipeline will be frozen until the memory access command pipeline can be resumed. Memory references are made in the pipeline, and a minimum of L levels is the latency required for all workloads. The receiving logic 504 observes the LCR L Whether a possible reply has been received, if not, freeze the pipeline.
[0091] Figure 6 A preferred method for retrieving data from a shared memory is given, which can be implemented in a TCF architecture according to an embodiment of the present invention, wherein a flexible delay compensation unit (FLCU) 601 can be employed. The FLCU 601 may include: a local memory 602, referred to herein as an L-element FLCU buffer 602; and control logic. L here refers to the depth of the local memory buffer 602, i.e., how many memory reference requests it can accommodate. L can be chosen arbitrarily, but in practice it may be beneficial to determine L so that it is greater than the maximum delay of a memory read request, preferably for situations where there is no communication traffic.
[0092] The control logic may include a transmit logic 604 functionally located before the local memory 602 and a receive logic 606 functionally located after the local memory 602 .
[0093] If at least one fiber is executing (thickness TCF ≥ 1), the TCF model advantageously allows synchronous operation of steps so that a shared memory reference generated by a previous step is completed before the current step begins. In an embodiment, the FLCU 601 can make the results of the shared memory reference available to all fibers in the TCF during the current step.
[0094] The length of the steps and / or execution of the instructions may vary dynamically depending on the actual required latency of the shared memory references.
[0095] At least in terms of fibers, shared memory access can be implemented using a first-in, first-out principle in one embodiment. That is, completed shared memory references can be used in the order in which they are called according to the sequence of instructions in the fiber.
[0096] The send logic 604 can observe whether the shared memory is busy, and if so, freeze the pipeline until the send logic 604. If the FCLU buffer 602 is being read when it is full (already holding L requests), then in the same clock cycle, new data can be written into the space freed by the read operation. If the send logic observes that the FCLU buffer 602 is full, and if the FLCU read unit is not frozen, the pipeline can then also be frozen until the send logic. It should be noted that buffers that cannot write and read data during a single clock cycle can also be used as a multi-buffer cluster, where one buffer is written and another buffer is read.
[0097] In particular when FIFO style buffering is used, a memory reference may be accessed at the FLCU memory unit 602 and the receive logic 606 may observe (advantageously at each clock cycle) whether the memory reference is complete. If no possible reply is received, the FLCU buffer read may be frozen / paused until a reply is received. This pause time may also be referred to as a delay or latency and may therefore be flexible, i.e. variable depending on the time it takes to receive the required memory reference. If no memory reference is required, the latency may also be substantially zero.
[0098] By embodiments of the present invention, the latency associated with a shared data memory access can then be dynamically determined by the actual required shared data memory access latency, which can provide advantages over, for example, a memory reply wait pipeline stage or a predetermined delay register transfer line, e.g. Figure 5 LCRTL.
[0099] Figure 7 Another exemplary view of a method for retrieving data from memory according to the present invention is given, which has FIFO buffering (and FLCU 601 includes local memory, so it is referred to as FLCU FIFO buffer 602 herein) and exemplary components of pipeline segments. When the TCF starts execution, the operand selection logic 702 can retrieve the required operands associated with each fiber from the replicated register block 412. One or more pre-memory ALUs 704 can be logically located before the memory access stage, and an ALU 706 located after the memory access can also be used in addition. The write-back logic 708 can then write to the replicated register block 412.
[0100] exist Figure 7 In an embodiment, the send logic 604 may observe whether the shared memory is busy or the FLCU FIFO buffer 602 is full, and in either case freeze the pipeline until the send logic 604.
[0101] The memory reference may then be accessed at the FLCU FIFO buffer 602 and the receive logic 606 may observe (advantageously at each clock cycle) whether the memory reference is completed. If a possible reply is not received, the FLCU FIFO buffer read may be frozen / paused until a reply is received.
[0102] In an embodiment of the present invention, TCF - even in its simpler implementation in combination with, for example, ESM, CESM or vector / SIMD - is able to provide flexible (i.e., dynamically delayed) memory units, at least where the receiving unit of the memory handles at least some functions independently and does not rely on, for example, fixed predetermined delay register transfer line / memory reply wait pipeline stages.
[0103] In some implementations, the present invention may be used with non-TCF processors where waiting for a memory reference would, without the present invention, use a register transfer line with a fixed delay.
[0104] The invention has been explained above with reference to the aforementioned embodiments and several advantages of the invention have been demonstrated. Obviously, the invention is not limited to these embodiments, but includes all possible embodiments within the spirit and scope of the inventive concept and the following patent claims.
[0105] Unless explicitly stated otherwise, the features recited in the dependent claims may be freely combined with each other.
Claims
1. An apparatus for processing shared data memory access of a TCF-aware processor, the TCF-aware processor supporting TCF of arbitrary thickness, the apparatus comprising at least a flexible delay processing unit (601), the flexible delay processing unit comprising a local memory (602) and associated control logic, the local memory being provided for storing data related to the shared data memory access, wherein the apparatus is configured to receive at least one TCF comprising at least one instruction, the at least one instruction being associated with at least one shred, wherein the flexible delay processing unit is configured to: determining whether the at least one instruction requires the shared data memory access, If the shared data memory access is required, a shared data memory access request is sent, substantially continuously observing, by the flexible delay processing unit, whether a reply to the shared data memory access request is received, suspending the execution of the instruction until a shared data memory reference associated with the instruction is received, and Continue to execute the instruction after receiving the shared data memory reference, so that the delay associated with the shared data memory access is dynamically determined in units of clock cycles by the actually required shared data memory access delay, and the delay associated with the shared data memory access corresponds to at least one clock cycle, so that the shared data memory reference generated by the previous step is completed before the next step starts.
2. The apparatus of claim 1, wherein the shared data memory access is implemented using a first-in-first-out principle.
3. The apparatus of claim 2, wherein the apparatus is configured to store data regarding a plurality of instructions in the local memory and to continue executing each instruction after receiving the shared data memory reference, the instructions being executed according to the first-in, first-out principle taking into account the order in which the instructions were received.
4. The apparatus of claim 1 , wherein the apparatus is further configured to store data about the at least one instruction in the local memory, the data about the at least one instruction comprising data defining the instruction and / or data referenced by the instruction to be accessed through the shared data memory. The apparatus of claim 1 , wherein the observing is performed once per clock cycle.
6. The apparatus of claim 1 , wherein the TCF comprises a plurality of fibers and each fiber comprises a plurality of instructions, wherein the shared data memory access request is sent through the flexible delay processing unit, and execution of the instruction sequence is suspended for all fibers that are executing a similar sequence until all shared data memory references related to all fibers of the corresponding instruction are received.
7. The apparatus of any one of claims 1 to 6, wherein the control logic comprises send logic (604) functionally located before the local memory, wherein the send logic is configured to stall at least a portion of a processor pipeline if the shared data memory is busy and / or if the local memory is full.
8. The apparatus of claim 7, wherein the processor pipeline is stalled until the send logic.
9. The apparatus of claim 7, wherein the control logic comprises receive logic (606) functionally located after the local memory, wherein the receive logic is configured to stall at least a portion of the processor pipeline until the reply is received.
10. The device of claim 9, wherein: A fetch unit associated with the processor pipeline following the flexible delay processing unit and / or the receive logic is stalled.
11. The apparatus of claim 1, wherein the apparatus is configured to receive data from one or more arithmetic logic units (ALUs) logically located before the flexible delay processing unit.
12. The apparatus of claim 1, wherein the apparatus is configured to send data to one or more arithmetic logic units (ALUs) logically located after the flexible delay processing unit.
13. Apparatus as claimed in claim 11 or 12, wherein two or more ALUs are linked to pass data between them.
14. A method for handling shared data memory access in a TCF-aware processor, the TCF-aware processor supporting TCF of arbitrary thickness, the method comprising: receiving at least one instruction, the at least one instruction being associated with at least one fiber, determining whether the at least one instruction requires the shared data memory access, If the shared data memory access is required, a shared data memory access request is sent, By means of the flexible delay processing unit (601), substantially continuously observing whether a reply to the shared data memory access request is received, suspending the execution of the instruction until a shared data memory reference associated with the instruction is received, and Continue to execute the instruction after receiving the shared data memory reference, so that the delay associated with the shared data memory access is dynamically determined in units of clock cycles by the actually required shared data memory access delay, and the delay associated with the shared data memory access corresponds to at least one clock cycle, so that the shared data memory reference generated by the previous step is completed before the next step starts.
