Mapping workload into circuit unit in computing device via reinforcement learning

Through the new assembly language and reinforcement learning technology, the scheduling problem of traditional compilation tools when running programs in coarse-grained reconfigurable arrays is solved, and performance and resource utilization are optimized, and the programming process is simplified.

CN119032364APending Publication Date: 2024-11-26MICRON TECHNOLOGY INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202380030234.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-16
Filing Date
2023-03-21
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Traditional compilation tools are difficult to effectively schedule instructions to optimize performance when running programs in new architectures such as coarse-grained reconfigurable arrays, especially with challenges in data flow synchronization and hardware details programming.

Method used

Using a new assembly language to describe data flow, convert high-level programming language programs through parsers to execute configurations suitable for coarse-grained reconfigurable arrays, train schedulers with reinforcement learning to optimize instruction placement and schedules, reducing direct hardware details Programming complexity.

Benefits of technology

It improves the execution efficiency and performance of programs on coarse-grained reconfigurable arrays, simplifies the programming process, reduces the complexity and error rate of scheduling instructions, and achieves more efficient resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119032364A_ABST
    Figure CN119032364A_ABST
Patent Text Reader

Abstract

The artificial neural network is trained through reinforcement learning; the processor is configured to receive first data representing an execution dependency condition of an instruction of the program. Second data representing a schedule of a first portion of the instructions of the program for execution in a device having a plurality of circuit units capable of parallel operation and third data identifying a next instruction selected from a second portion of the instructions of the program, the second portion is still to be scheduled for execution in the apparatus. The artificial neural network selects a placement of the next instruction in one of the circuit units from a plurality of possible placement of the next instruction in the device. Performance of placement of instructions tested when searching for an effective schedule for running the program in the device can be measured to produce samples to train the artificial neural network via reinforcement learning.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Related Applications

[0002] This application claims priority to U.S. Patent Application No. 63 / 323,949 filed on March 25, 2022 and U.S. Patent Application No. 18 / 185,031 filed on March 16, 2023, the entire disclosures of which are hereby incorporated by reference herein. Technical Field

[0003] At least some embodiments disclosed herein relate generally to scheduling instructions of a computer program for execution in a computing device and more particularly, but not limited to, scheduling instructions for parallel execution in multiple circuit tiles of a computing device. Background Art

[0004] Conventionally, assembly language programming is based on specifying operations to be performed on data stored in registers. A typical opcode is specified to identify the operation to be performed on data stored in one or more registers identified for the opcode; and the result of the operation is to be stored in the register identified for the opcode.

[0005] To execute this traditional assembly language program, the virtual registers referenced in the program are mapped to physical registers in the processor for executing the program. When there are fewer physical registers than virtual registers referenced in the program, values ​​are shifted back and forth among the physical registers to implement register reuse and satisfy the virtual register usage in the program.

[0006] An artificial neural network (ANN) uses a network of neurons to process inputs to the network and produce outputs for the network.

[0007] Reinforcement learning (RL) is a machine learning technique designed to train a computer agent to determine desired actions by trial and error. For example, the agent can be implemented as a policy model to select actions from candidates based on input according to an artificial neural network (ANN). Actions in response to the input can generate rewards; and the rewards can be used to train the agent to maximize the cumulative reward. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings in which like reference numerals indicate similar elements.

[0009] Figure 1 The structure of an assembly language program for execution in a coarse-grained reconfigurable array according to one embodiment is described.

[0010] Figure 2 Description According to one embodiment, an assembly language program is generated using a compiler.

[0011] Figure 3 A coarse-grained reconfigurable array is described in which an assembly language program according to one embodiment may be configured to specify operations.

[0012] Figure 4 Dispatching interface information of an assembly language program according to one embodiment is described.

[0013] Figure 5 Memory interface information of an assembly language program according to one embodiment is described.

[0014] Figure 6 The block memory information of an assembly language program according to one embodiment is described.

[0015] Figure 7 A method of specifying operations in a coarse-grained reconfigurable array according to one embodiment is presented.

[0016] Figure 8 An instruction execution schedule generated from an assembly language program according to one embodiment is described.

[0017] Fig. 9 A memory image for implementing an assembly language program in a coarse-grained reconfigurable array according to one embodiment is described.

[0018] Fig.10 An execution configuration of a coarse-grained reconfigurable array for running an assembly language program according to one embodiment is described.

[0019] Fig.11 A method for identifying a configuration of a coarse-grained reconfigurable array to run an assembly language program is presented according to one embodiment.

[0020] Fig.12 The segmentation of instructions of a data stream into groups is shown according to one embodiment.

[0021] Fig.13 Instruction slots on a tile that may be used to schedule instructions for execution in the tile are illustrated according to one embodiment.

[0022] Fig.14 Operations to schedule instructions are shown according to one embodiment.

[0023] Fig.15 A method to schedule instructions of an assembly language program for execution on a coarse-grained reconfigurable array is presented according to one embodiment.

[0024] Fig.16 The configuration of inputs to a scheduler trained via reinforcement learning according to one embodiment is described.

[0025] Fig.17

[0013] The description generates samples to train a scheduler via reinforcement learning according to one embodiment.

[0026] Fig.18 Reinforcement learning for a scheduler according to one embodiment is described.

[0027] Fig.19 An instruction placement method according to one embodiment is shown.

[0028] Fig. 20 A block diagram showing an example computer system in which embodiments of the present disclosure may operate. DETAILED DESCRIPTION

[0029] At least some embodiments disclosed herein provide techniques for configuring a coarse-grained reconfigurable array to run an assembly language program that specifies data flow through memory locations represented by memory variables.

[0030] A near memory computing (CNM) architecture can be used to exploit the tremendous opportunities provided by high performance communication protocols such as the Compute Express Link (CXL) protocol. This near memory computing (CNM) architecture can incorporate heterogeneous computing elements into a memory / storage subsystem to accelerate various near data computing tasks. An example of such a computing element is a streaming engine (SE) implemented via a coarse-grained reconfigurable array (CGRA) having interconnected computing tiles. The tiles are interconnected with both a synchronous fabric (SF) and an asynchronous fabric (AF). The synchronous fabric (SF) can be configured to connect each tile to an adjacent tile separated by one or two clock cycles. The synchronous fabric (SF) interconnects elements within each tile, such as tile memories, multiplexers, and single instruction multiple data (SIMD) units, etc. The tiles can be pipelined by the synchronous fabric (SF) to form a synchronous data flow (SDF) through a single instruction multiple data (SIMD) unit for operations such as multiplication / shift, addition / logical operations, etc. Each slice may have a pipeline time multiplexing processing unit so that a new instruction may be started on each slice at each clock cycle. An asynchronous fabric (AF) connects a slice with other slices, a dispatch interface (DI), and a memory interface (MI). An asynchronous fabric (AF) bridges synchronous data flows (SDF) through asynchronous operations, which include the initiation of synchronous data flows, asynchronous data transfer from one synchronous data flow to another, system memory access, and branch and loop construction. Each slice may have a delay register to save its output to be output in alignment with the execution of instructions using the output. Together, the synchronous fabric (SF) and the asynchronous fabric (AF) allow slices to efficiently execute high-level programming language constructs. Simulation results of a hand-crafted streaming engine (SE) kernel show that the performance-to-power ratio of data-intensive applications is improved by several orders of magnitude compared to existing computing platforms.

[0031] However, it is challenging to apply traditional compilation tools to program operations of new architectures, such as streaming engines (SEs) implemented using coarse-grained reconfigurable arrays (CGRAs). In a dataflow-based coarse-grained reconfigurable array (CGRA), programs work by causing data to flow from one tile to another in a synchronized manner. This requires programming instructions at precise cycles on the correct tiles to avoid corrupting the synchronized flow of operations. At least some embodiments discussed in the present disclosure use a new assembly language with a corresponding parser that is capable of describing a program as a graph group representing a dataflow, rather than deforming the dataflow to pretend it is a sequence of register transfers as in traditional assembly.

[0032] Configuring the streaming engine (SE) requires finding a synchronization schedule for instructions so that streaming can start for a data element and each subsequent instruction is aligned on a valid tile with the correct cycle. The assembly language of at least some embodiments discussed in this disclosure facilitates determining this synchronization schedule. It can be used to describe some configuration details of the hardware and the data flow of the calculation.

[0033] In one embodiment, the assembly language is configured to describe the details of a program for a streaming media engine (SE). For example, a dispatch interface (DI) block of the program may be configured to specify information about a dispatch interface of the streaming media engine (SE); a memory interface (MI) block may be configured to specify information about memory operations implemented via a memory interface of the streaming media engine (SE); a tile memory (TM) block may be configured to specify information about memory variables to be mapped to a tile memory of the streaming media engine (SE); and a stream block may be configured to specify a graph group representing a synchronized data stream.

[0034] Optionally, the user describes the computations to be performed by the streaming engine (SE) according to the configuration details specified using the dispatch interface (DI) block, the memory interface (MI) block, and the tile memory (TM) block, and the program details specified via the stream block. When this assembly language program is run, it can be parsed, mapped, and reduced to the program execution configuration of the streaming engine by software tools.

[0035] Optionally, a compiler may be used to automatically convert a computer program written in a high-level programming language into an assembly language program according to the present disclosure.

[0036] The disclosed assembly language program technology has multiple advantages. For example, representing configuration and data flow allows the assembly to reflect the state of the device. For example, programming the data flow allows the programmer to work according to the way data moves between operations, rather than scheduling hardware details between tiles. For example, decomposing the code into separate synchronization streams allows the programmer to explicitly define the asynchronous message transmission that occurs between synchronization elements. For example, programming the device with the abstract representation of the assembly language is much faster than working with the low-level details of specifying the operation of multiplexers and tile connections. For example, the parser can provide more friendly error message transmission for typos and inconsistent logic, rather than debugging why the device simulation is not terminated or providing incorrect answers. For example, defining the assembly language opens the possibility of using mainstream compiler tools to compile high-level code down to this more abstract description of the device in the future. For example, since the program is an instruction list, high-level and low-level knobs can be provided to the programmer through the instruction representation. For example, low-level types of instructions allow programmers to specify individual fields / operation codes that end in instructions; or, high-level formats based on operations rather than fields can be used.

[0037] An assembly language program describing a data flow may be mapped for execution on a specific coarse-grained reconfigurable array (CGRA). A coarse-grained reconfigurable array (CGRA) may have a specific structure (e.g., a number of tiles and a memory interface) and a specific interconnectivity of a synchronous fabric (SF) and / or an asynchronous fabric (AF) among the tiles. This specific structure may be specific to the coarse-grained reconfigurable array (CGRA) to be used in the execution of the program and therefore is not reflected in the assembly language program. On the other hand, an assembly language program is not affected by such details and therefore may be mapped for execution on a different coarse-grained reconfigurable array (CGRA) having different structural details.

[0038] The scheduler may map instructions of an assembly language program for execution in a tile of a coarse-grained reconfigurable array (CGRA). Since each tile may have a pipeline time-multiplexed processing unit, a new instruction may be started on each tile at each clock cycle. Therefore, the scheduler may generate a schedule that specifies which instruction is programmed on which tile for execution at which clock cycle. The scheduler may determine the tiles and clock cycles of the mapped instructions in the correct combination so that the data flow in the coarse-grained reconfigurable array (CGRA) propagates in the proper timing. For example, the output of the tile is generated at the proper clock cycle so as to be provided as input in time through a synchronous fabric (SF) and / or an asynchronous fabric (AF) for further processing in the tile. When instructions are mapped to tiles, memory variables used by the instructions are also mapped to the memory in the tile.

[0039] Based on the schedule for instructions executed in the tile, a software tool (e.g., a downgrade program) may be configured to generate an execution configuration of a coarse-grained reconfigurable array for running an assembly language program. The software tool may determine the details of how each connection between tiles is configured. The software tool may determine the low-level details of partitioning the tile memory into regions to implement the memory variables mapped to the tile. The software tool may determine the setting of the correct multiplexer bits in the tile to ensure that data flows correctly within the tile at the correct clock cycle. Even if there is one missing bit, the entire program may be interrupted / corrupted. The details determined by the software tool may be specified in the execution configuration to control the execution of the assembly language program in the coarse-grained reconfigurable array (CGRA).

[0040] For example, based on an assembly language program and a timeline, a software tool can traverse a data flow graph to track which operations will be the masters of subsequent operations. As the software tool traces the graph, it can set outgoing controls for the current tile operation; and as the software tool traverses to a child level, it can set incoming control information on the cycle it arrives at. Control settings can also be determined and set for data passing through tiles and routes used on delay registers.

[0041] The software tools may also use the dispatch interface information and memory interface information provided in the assembly language program to configure the operation of the dispatch interface and memory interface of the coarse-grained reconfigurable array (CGRA). The assembly language program specifies high-level details about the messaging generated by the dispatch interface and memory interface. Using the schedule, the software tools may identify messaging according to physical hardware locations in the coarse-grained reconfigurable array (CGRA).

[0042] Software tools have various advantages. Manually generating execution configurations for coarse-grained reconfigurable arrays (CGRAs) is a tedious, laborious, error-prone process that can take tens of man-hours even for simple problems. Software tools automate the work to allow easy verification of hardware constraints. If hardware timing details change, the software tool can be rerun with parameter changes to generate a new execution configuration. The design of this software tool, which is configured to receive a schedule generated by a scheduler as input, allows many hardware details to be offloaded from the scheduler so that implementations of different mapping strategies for the scheduler can focus on instruction placement.

[0043] To schedule instructions for execution on tiles of a coarse-grained reconfigurable array (CGRA), a brute force approach can be used to explore all possible choices for instruction placement and scheduling, and then select the best execution schedule. However, due to the combinatorial explosion of choices, there are a large number of possible choices in the search space.

[0044] For example, a delay register of a tile may be used to implement a selected number of delays to synchronize output timing with input timing. Thus, the delay register introduces several possible choices, which may be multiplied with other choices to increase the possible choices. For example, a tile may have multiple tile memories that may be used to implement a memory variable; and the memory variable may be implemented in one of the tiles of a coarse-grained reconfigurable array (CGRA). Thus, there are many possible choices for the implementation of one memory variable; and as the number of memory variables increases, the possible implementations of the number of memory variables may increase significantly. The combination of implementing which variables on which portion of which tile memory of which tiles and scheduling which instruction on which clock cycle for execution on which tile may result in a huge search space.

[0045] In one embodiment, the search space to be explored by the brute force method is reduced by performing a selection prior to the search. The selection reduces the search space and improves the efficiency of obtaining a valid schedule.

[0046] For example, the scheduler may be configured to determine the distribution of memory variables to tile memories according to some constraints before starting a brute force search. The distribution represents the allocation of memory variables of the program to tiles for implementation using the tile memories of the corresponding tiles. For example, this distribution may be performed with the goal of balancing the number of instructions / variables per tile. In addition, certain hardware details may be taken into account when determining the distribution (e.g., placing adjacent data in a data stream on tiles close to each other). Determining the distribution before scheduling instructions may reduce the number of combinations of choices to be explored by the brute force search.

[0047] For example, instructions may be placed in tiles in which memory variables used by the instructions are implemented. Thus, determining memory distribution prior to searching may reduce the choices for scheduling instructions; and instructions may be scheduled without having to explore possible choices associated with other tiles.

[0048] A dispatch schedule instruction based on one distribution of memory variables to tile memory may be executed independently of a dispatch schedule instruction based on another distribution. Thus, parallel searches may be performed based on different memory distributions. The resulting schedule with the best score (e.g., based on performance in terms of latency and / or power, etc.) may be used.

[0049] In one embodiment, the effective schedule is used to satisfy certain constraints. For example, instructions that share one or more tile memory variables should be placed on the same tile; instructions that each start a synchronous flow cannot be placed on the same tile; and / or multiple instructions of the same level cannot be placed on the same tile, etc. The scheduler can take these constraints into account when making choices, thereby reducing the choices that are exploited using a brute force approach.

[0050] For example, the scheduler may divide the instructions of the program into a target number of instruction groups. The target number may be equal to or greater than the number of synchronous data streams specified in the program. Each of the instruction groups is selected to be scheduled on the tile; and the instruction groups are selected to satisfy the constraints to be satisfied by the effective schedule.

[0051] Furthermore, partitioning of the instructions of a program into instruction groups may be performed to meet additional requirements. For example, partitioning of the instructions of a program may be performed to balance the instruction groups so that each group has a similar number of instructions, and / or to balance memory usage of the instruction groups so that each group has a similar total tile memory utilization, etc. Furthermore, within each instruction group, tile memory variables are allocated to tile memory regions (several) without exceeding the tile memory region size, without generating tile memory access conflicts for any instruction, etc.

[0052] After partitioning the instructions of a program into groups, a scheduler may schedule the instructions of each group and their corresponding tile memories on tiles of a coarse-grained reconfigurable array (CGRA) to generate a schedule.

[0053] In general, a program can be partitioned into different groups of instruction groups in different ways. Different groups of instruction groups can be executed in parallel to generate different schedules. The performance scores of the resulting schedules can be evaluated (e.g., based on latency and / or energy consumption, etc.) to select the best execution schedule as output.

[0054] In some embodiments, a tile of a coarse-grained reconfigurable array (CGRA) may have multiple instruction slots for pipeline execution. To schedule an instruction in a tile, a scheduler determines the slot of the tile to schedule the instruction for execution. The schedule for the instruction is selected to have an effective timing and slot configuration for the instruction, the preceding instructions that have been scheduled before the instruction, and the subsequent instructions that are scheduled after the instruction.

[0055] For example, the scheduler may be configured to recursively perform the operation of scheduling one instruction. For a current instruction selected for scheduling, the scheduler may search the parameters (e.g., slot and / or clock cycle) of the schedule of the current instruction to generate a valid schedule for the combination of the current instruction and the previous instruction that has been scheduled before the current instruction. If the scheduler finds a schedule that is valid in terms of timing and other constraints for the current instruction and the previous instruction that has been scheduled before the current instruction (if any), the scheduler continues to select the next instruction from the remaining instructions to be scheduled, and then processes the next instruction as the current instruction selected for scheduling until there are no remaining instructions to be scheduled.

[0056] However, if the scheduler determines that there is no valid schedule for the current instruction in view of the previous instructions that were scheduled before the current instruction, then the particular schedule of the previous instructions that were scheduled before the current instruction is invalid. The scheduler can then move back to the previous instruction that was scheduled before the current instruction and treat the previous instruction as the current instruction to be rescheduled. The process can continue until a valid schedule is found for the instruction group or it is determined that a valid schedule cannot be found for the instruction group.

[0057] Using the described techniques, the scheduler can generate at least one valid schedule for running a dataflow program in a coarse-grained reconfigurable array (CGRA) in a reasonable amount of time. The core functionality of the scheduler is extremely efficient in terms of time complexity because upon a scheduling failure, the scheduler immediately terminates the call, recovers the previously implemented schedule for a subset of the program's instructions, and continues searching for a new valid schedule for more instructions.

[0058] At least some embodiments disclosed herein include a reinforcement learning technique to train an artificial neural network (ANN) to identify placement of instructions in a computing device having a plurality of parallel circuits for instruction execution. An example of such a computing device is a streaming media engine implemented on a coarse-grained reconfigurable array (CGRA) having a plurality of tiles. A scheduler receives input identifying instructions among instructions of a program, execution dependency conditions of the instructions of the program, and placement of a portion of the instructions of the program in a circuit unit of the computing device.

[0059] The instructions of a typical program have dependencies in execution. For example, the execution results produced by some instructions can be used in the program as inputs for the execution of other instructions in the program. It is effective to allocate instructions to slots of tiles of a coarse-grained reconfigurable array (CGRA) for execution when instructions can be scheduled at appropriate cycles to ensure correct execution and data flow. For example, when instructions executed in slots in tiles are scheduled at certain clock cycles, the inputs required to start the instructions in the slots of the tiles should be available in time to start the execution of the instructions.

[0060] In general, there are different effective ways to schedule instructions for execution in slots of tiles; and different schedules may have different performance levels when running a program in a coarse-grained reconfigurable array (CGRA). For example, the performance level of a schedule may be evaluated based on the number of clock cycles required to run a program according to the schedule in a coarse-grained reconfigurable array (CGRA). Although a brute force algorithm may be used to test all possible schedules to find the best execution schedule, this approach is inefficient.

[0061] In one embodiment, reinforcement learning techniques are used to train an actor model of an artificial neural network (ANN) to determine the placement of instructions of a program in slots of tiles in a computing device. The placement of an instruction is determined based on the placement of one or more other instructions of the program that have been scheduled / placed before the instruction. Since the placement of an instruction corresponds to selecting an option from a set of discrete placement options, the problem can be reduced to a discrete action problem solved by an artificial neural network (ANN) trained via reinforcement learning.

[0062] For example, a neural network model may be trained using techniques from proximal policy optimization (PPO) for reinforcement learning (RL) to place instructions of a program in tiles based on a reward function. The reward function may be configured to model a coarse-grained reconfigurable array (CGRA) and its constraints. To use proximal policy optimization (PPO), samples of rewards and placement actions for training an artificial neural network (ANN) actor model may be collected by running inference on the latest copy of the actor model and obtaining results from the reward function. The samples may be stored in a buffer to be used as training data.

[0063] In one embodiment, the actor model is configured to receive as input a state implemented as a cascade of placement node arrays, the state representing the placement of a portion of instructions of a program in slots of a tile of a coarse-grained reconfigurable array (CGRA). The actor model further receives as input an identification of instructions to be placed next and a representation of a computation graph specifying execution dependency conditions in the program. Based on the received input, the actor model is to generate actions indicating tiles and slots in the tiles for placing instructions for execution.

[0064] The reward for the participant model can be configured based on the number of cycles it takes to execute the instruction. After determining the action to place the instruction in the slot of the tile, the corresponding input of the participant model, the action, and the corresponding reward for the action can be saved as samples in a buffer. Optionally, the samples in the buffer can be selectively selected to retain or discard a certain number of unsuccessful placement samples to balance the number of successful samples and unsuccessful samples for the training phase. In the training phase, the participant model can be trained / adjusted using proximal policy optimization (PPO) to generate actions from sample states, and the evaluator model can be trained / adjusted to match the sampled rewards from the actions generated by the participant using a surrogate loss function. The process of sampling and training can be repeated to improve the ability of the participant model to predict placements to maximize rewards and performance.

[0065] When scheduling instructions of a program, the memory variables of the program operated by the instructions should be implemented on the tile where the instructions are executed. This memory constraint can be captured as part of the computation graph using a memory dependency array. The actor model may include a graph neural network (GNN) that receives as input the computation graph of the instructions to be executed. In the computation graph, each node represents an instruction and contains features as a cascade of a memory dependency array and a position sinusoidal encoding. The graph neural network (GNN) model is configured to produce an embedding combined with the state observation and encoding of the next instruction to be placed as a node. Attention modules are added to the embedding to highlight important information to the actor model and the evaluator model. After placing the instructions, the routing information and configuration for programming each tile can be saved as the final output.

[0066] For example, the actor model may be a feed-forward model or a sequential model, such as a transformer encoder block.

[0067] Actor models trained via reinforcement learning can reduce the usability barriers of coarse-grained reconfigurable arrays (CGRAs). Users do not need to be experts in coarse-grained reconfigurable arrays (CGRAs). Actor models can provide instruction placement suggestions or block configuration labels to assist other tools or programmers in scheduling programs. Actor models can be used to generate instruction execution schedules with similar performance levels faster than brute force methods. Reinforcement learning allows unsupervised learning and optimization to search in a wider search space. Reinforcement learning can learn from a set of placed programs and reuse some data to schedule new programs. Proximal policy optimization with graph embeddings can find better schedules by finding higher rewards than other methods.

[0068] Figure 1 The structure of an assembly language program for execution in a coarse-grained reconfigurable array according to one embodiment is described.

[0069] exist Figure 1 In the example, the assembly language program 101 is configured with dispatch interface information 111 , memory interface information 113 , tile memory information 115 , and flow description 117 .

[0070] The dispatch interface information 111 identifies memory variables to accept arguments to be passed as input to the assembly language program 101 and the data properties of the arguments. The dispatch interface information 111 may further specify the data properties of the return value of the assembly language program 101. The dispatch interface information 111 may be used to configure a dispatch interface of a coarse-grained reconfigurable array (CGRA) 103 for implementing the assembly language program 101. To execute the assembly language program 101, the memory variables identified in the dispatch interface information 111 are mapped to tile memories in the coarse-grained reconfigurable array (CGRA) 103. Thus, the dispatch interface information 111 specifies the operation of the dispatch interface to store input data to the memory location represented by the memory variable.

[0071] The memory interface information 113 identifies memory access operations performed in the flow description 117 to access tile memories in the coarse-grained reconfigurable array (CGRA) 103. The memory access operations may include operations to store data in memory variables used in the flow description 117, and operations to read data from memory variables used in the flow description 117. In order to execute the assembly language program 101, the memory variables identified in the memory interface information are mapped to tile memories in the coarse-grained reconfigurable array (CGRA) 103.

[0072] The tile memory information 115 identifies memory variables used in the flow description 117 and accesses properties of the memory variables. Such memory variables may include memory variables identified in the dispatch interface information 111 to store arguments or inputs to the assembly language program 101, memory variables identified in the memory interface information 113, and other memory variables that may be used in synchronization operations of data flows in the flow description 117.

[0073] The flow description 117 specifies one or more data flow graphs. Each data flow graph identifies the synchronous data flow through the memory variables mapped to the tile memory and the synchronous values ​​mapped to the connections between the tiles; and each data flow graph further identifies the calculations (e.g., addition, multiplication, bitwise shift, etc.) performed on those values ​​on the tile data path. For example, some memory variables may be identified in the dispatch interface information 111, the memory interface information 113, the tile memory information 115 for synchronous use (e.g., FIFO) or asynchronous use (e.g., dispatch / memory interface) of the tile memory, and therefore for mapping to the tile memory in an implementation; additional variables that may or may not be mapped to the tile memory in an implementation may be used in the flow description 117. For example, synchronization values ​​used through FIFOs in the flow description 117 are mapped to tile memory; some variables in the flow description 117 may be mapped to tile memory using FIFOs to meet timing requirements in scheduled instructions for execution on tiles of the coarse-grained reconfigurable array (CGRA) 103; and some variables in the flow description 117 may not necessarily be mapped to tile memory. The data flow graph may include identification of memory access operations specified in the memory interface information 113. The memory access operations specified in the memory interface information 113 are implemented via communications over an asynchronous fabric (AF) in the coarse-grained reconfigurable array (CGRA) 103. In one embodiment, the flow description 117 may have multiple sections, each specifying a data flow. Each data flow may optionally include identification of a set of asynchronous variables specified in the dispatch interface information 111, the memory interface information 113, and the tile memory information 115. Instructions of the data flow may begin execution upon receiving a message indicating that data identified by the set of asynchronous variables are ready. Each data stream may be programmed to send asynchronous messages to another data stream (e.g., to start executing a loop, continue a stream, send a data value, etc.). Each data stream may stop outputting results to one or more instructions in the asynchronous variables specified in the dispatch interface information 111, the memory interface information 113, and the tile memory information 115. New identification of data / variables may be used in each data stream to represent data generated within the data stream. Such new variables used within each data stream are transient because the data represented by the variables are consumed within the data stream and are discarded after the data stream is executed. Therefore, asynchronous variables / data in program 101 refer to data stored in a location / variable for use at an unspecified / unknown time when the data is needed; and there is no hardware-imposed limit on the time period between the arrival of the data and the use of the data; in contrast, synchronous variables / data refer to data generated for use at a time determined by the synchronous connection in the coarse-grained reconfigurable array (CGRA) 103. Instructions in a data stream may not be connected based on the sequence of instructions written in the stream description. Some instructions are related to each other based on data being consumed as input and data being produced as output, which data may be consumed synchronously or propagated asynchronously.

[0074] Combined with the following Figures 3 to 6 Further details are provided regarding the coarse-grained reconfigurable array 103 , the dispatch interface information 111 , the memory interface information 113 , and the tile memory information 115 .

[0075] Figure 2 Description According to one embodiment, an assembly language program is generated using a compiler.

[0076] exist Figure 2 In the embodiment of the present invention, a user may use a high-level language to specify a program 105 of operations to be performed by the coarse-grained reconfigurable array 103. A compiler 107 may read the high-level language program 105 and convert it into Figure 1 Assembly Language Programming 101.

[0077] Alternatively, a user may write assembly language program 101 without using a compiler (eg, 107). For example, a programming / compilation tool may be adapted to receive user input to specify assembly language program 101.

[0078] Figure 3 A coarse-grained reconfigurable array is described in which an assembly language program according to one embodiment may be configured to specify operations.

[0079] For example, you can implement Figure 1 Assembly language program 101 for Figure 3 The coarse-grained reconfigurable array 103 is implemented.

[0080] exist Figure 3 In FIG. 1 , the coarse-grained reconfigurable array 103 has a plurality of tiles 141 , 143 , . . . , 145 that can operate in parallel. The tiles may have the same (or similar) structure.

[0081] A typical tile 141 includes tile memories 131, ..., 133 having a synchronous connection 135 with a computation logic 137. The computation logic 137 may be configurable to execute different instructions. For example, the computation logic 137 may include a single instruction multiple data (SIMD) unit. Upon receiving a single instruction, the single instruction multiple data (SIMD) unit may operate on multiple data items in the tile memories 131, ..., 133. For example, the computation logic 137 may include a pipeline time multiplexing processing unit that may start executing a new instruction at each clock cycle. The execution of the instruction may be completed after a predetermined number of clock cycles. The result of executing the instruction may be propagated from one tile (e.g., 141) to an adjacent tile (e.g., 143) via a synchronous connection 129 within a predetermined number of clock cycles. The result of executing the instruction may also be accessed through a memory interface (e.g., 123, ..., 125 and a dispatch interface 121) via an asynchronous connection 127.

[0082] The coarse-grained reconfigurable array 103 has synchronization connections 129 among some pairs of tiles 141, 143, ..., 145. For example, the synchronization connection 129 provides a direct connection between tile 141 and tile 143, but does not provide a direct connection between tile 143 and tile 145. For example, the synchronization connection 129 can connect adjacent tiles (e.g., 141, 143) to form a chain or pipeline among the tiles 141, 143, ..., 145.

[0083] The coarse-grained reconfigurable array 103 has an asynchronous connection 127 between the tiles 141, 143, ..., 145 and the memory interfaces 123, ..., 125 and the dispatch interface 121. The dispatch interface 121 can act as a memory interface. Each memory interface (e.g., 123 or the dispatch interface 121) can access the tile memory of one or more tiles through the asynchronous connection 127. Each of the tiles 141, 143, ..., 145 can have a delay register that can be controlled to provide the output of the tile to synchronize with the timing of executing the next instruction that uses the output. The dispatch interface 121 can communicate the input and output of the coarse-grained reconfigurable array 103 to and from circuits outside the coarse-grained reconfigurable array 103.

[0084] Figure 1 The assembly language program 101 can be written without information / details of the specific structure of the coarse-grained reconfigurable array 103, such as the number of tiles in the coarse-grained reconfigurable array 103, the availability of specific synchronous connections 129 among certain pairs of tiles 141, 143, ..., 145, the availability of asynchronous connections 127 between specific memory interfaces (e.g., 123) and specific tiles (e.g., 143), etc.

[0085] In the case of coarse-grained reconfigurable array 103, it is possible to map Figure 1 The assembly language program 101 of the coarse-grained reconfigurable array 103 can be executed using tiles 141, 143, ..., 145. The dispatch interface information 111, the memory interface information 113, and the tile memory information 115 can assist in mapping; and the flow description 117 makes it easier to identify the correct schedule for mapping each instruction to the corresponding tile at the correct clock cycle, so that the coarse-grained reconfigurable array 103 correctly executes the operation of the assembly language program 101.

[0086] The operation of the coarse-grained reconfigurable array 103 may be described and / or scheduled as data flow among tile memories (e.g., 131, ..., 133) of tiles (e.g., 141, 143, ..., 145) at various clock cycles through connections 135, 129, and 127 and computation logic 137. Since the flow description 117 describes the data flow required for the operation of the assembly language program 101, the data flow identified by the flow description 117 may be mapped to the data flow in the coarse-grained reconfigurable array 103 for execution.

[0087] Figure 4 Dispatching interface information of an assembly language program according to one embodiment is described.

[0088] For example, Figure 4 The dispatch interface information 111 can be used to Figure 1 In the assembly language program 101.

[0089] Figure 1 The assembly language program 101 may have a plurality of arguments 151, ..., 161 to receive inputs of the assembly language program 101. For each of the arguments 151, ..., 161, the dispatch interface information 111 identifies a memory variable (e.g., 153 or 163) to be mapped into the tile memory (e.g., 131 or 133) and a memory property (e.g., 155 or 165) of the corresponding memory variable (e.g., 153 or 163) (e.g., the property of input data to be received via the corresponding argument). The memory property (e.g., 155 or 165) may identify the data type and / or data size of the input to be received via the corresponding argument (e.g., 151 or 161).

[0090] Storing the input data to the memory locations represented by the memory variables 153 , . . . , 163 may be implemented via operations of the dispatch interface 121 of the coarse-grained reconfigurable array 103 .

[0091] Dispatch interface information 111 may further specify return value properties 159 of assembly language program 101. For example, return value properties 159 may specify a data type and / or data size of a value to be returned by assembly language program 101 when execution of assembly language program 101 is complete.

[0092] Figure 5 Memory interface information of an assembly language program according to one embodiment is described.

[0093] For example, Figure 5 The memory interface information 113 can be used to Figure 1 In the assembly language program 101.

[0094] The memory interface information 113 identifies a plurality of memory access operations 173, ..., 183. Each memory access operation (e.g., 173 or 183) may be an operation to store data in a memory or read data from a memory, wherein a memory location is represented by a memory variable (e.g., 175 or 185) having a corresponding memory property (e.g., 177 or 187) for the data stored or accessed at the memory location. The memory access operation (e.g., 173 or 183) may be implemented via operations of the memory interfaces 123, ..., 125 and / or the dispatch interface 121 of the coarse-grained reconfigurable array 103.

[0095] The memory access operation (e.g., 173 or 183) is associated with the access ID (e.g., 171 or 181) in the memory interface information 113 to indicate the corresponding memory access operation (e.g., 173 or 183). The flow description 117 of the assembly language program 101 may use the access ID (e.g., 171 or 181) to specify the use of the corresponding memory access operation (e.g., 173 or 183) in the data flow graph.

[0096] The memory property (eg, 177 or 187 ) may identify the data type and / or data size of the data to be operated on via the memory access operation (eg, 173 or 183 ).

[0097] Figure 6 The block memory information of an assembly language program according to one embodiment is described.

[0098] For example, Figure 6 The tile memory information 115 can be used to Figure 1 In the assembly language program 101.

[0099] The tile memory information 115 identifies properties (e.g., 157, ..., 167, 179, ..., 189, 193, ...) of corresponding memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) used in the flow description 117 to identify memory locations in tiles of the coarse-grained reconfigurable array 103. To execute the assembly language program 101, the memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) are mapped to tile memories (e.g., 131, ..., 133) of tiles (e.g., 141, 143, ..., 145) of the coarse-grained reconfigurable array 103.

[0100] The properties (e.g., 157, ..., 167, 179, ..., 189, 193, ...) may identify the memory access type, size, etc. of the corresponding memory variable (e.g., 153, ..., 163, 175, ..., 185, 191, ...). Examples of memory access types may include unknown, shared, first-in-first-out (FIFO), etc.

[0101] The memory variables specified in the tile memory information 115 may include memory variables identified in the dispatch interface information 111 (e.g., 153, ..., 163), memory variables identified in the memory interface information 113 (e.g., 175, ..., 185), and other memory variables used to identify memory locations of data flows in the flow description 117. The flow description 117 further identifies operations performed to transform data along the flow.

[0102] Figure 7 A method of specifying operations in a coarse-grained reconfigurable array according to one embodiment is presented.

[0103] For example, Figure 7 The method may be implemented by software and / or hardware in a computing device to generate Figure 1 The assembly language program 101 is executed by a user, a compiler or a compiling / programming tool.

[0104] At block 201 , a user, compiler, and / or compiling / programming tool identifies dispatch interface information 111 representing operations to be performed via a dispatch interface 121 of a coarse-grained reconfigurable array 103 to receive input.

[0105] For example, the coarse-grained reconfigurable array 103 may have a plurality of tiles 141, 143, ..., 145 interconnected via synchronous connections 129 and 135 and asynchronous connection 127. Each of the tiles (e.g., 141) has a tile memory (e.g., 131, ..., 133) and reconfigurable computation logic (e.g., 137). In response to an instruction, the computation logic 137 may be reconfigured to perform the operation of the instruction in a data flow from one memory location to another memory location in the coarse-grained reconfigurable array 103.

[0106] For example, the dispatch interface information 111 may include identification of first memory variables 153, ..., 163 for arguments 161, ..., 161, respectively, to indicate an operation of writing input to the memory location represented by the first memory variables 153, ..., 163 according to the arguments.

[0107] At block 203, a user, compiler, and / or compiling / programming tool identifies memory interface information 113 representing operations to be performed via one or more memory interfaces of a coarse-grained reconfigurable array.

[0108] For example, the memory interface information 113 may include identification of second memory variables 175, ..., 185 associated with memory access operations 173, ..., 183 for storing or retrieving data items to or from memory locations referenced and represented by the second memory variables 175, ..., 185.

[0109] Memory interface information 113 and dispatch interface information 111 may include the type and size of data items identified by memory variables (e.g., 153, 163, 175, 185) and operated in corresponding memory access operations (e.g., 173, 183, or storing input according to arguments 151, ..., 161).

[0110] At box 205, a user, compiler and / or compilation / programming tool identifies tile memory information 115, which is about a set of memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) that reference memory locations to be implemented in a tile memory (e.g., 131, 133) of the coarse-grained reconfigurable array 103.

[0111] The tile memory information 115 may further identify the access type and size of the set of memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) for implementation in the coarse-grained reconfigurable array. The set of memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) may include a first memory variable (e.g., 153, ..., 163) identified in the dispatch interface information 111, a second memory variable (e.g., 175, ..., 185) identified in the memory interface information 113, and at least one third memory variable 191 that references a memory location in one or more synchronous data streams to be implemented via the coarse-grained reconfigurable array 103.

[0112] At block 207, a user, compiler, and / or compile / programming tool identifies one or more simultaneous data flows through memory locations referenced via memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) in the tile memory information 115 to produce results from the inputs. The data may be transformed by executing instructions along the flows; and the data flows may pass through other variables that are not necessarily mapped to tile memory.

[0113] At block 209, a user, compiler, and / or compiling / programming tool generates an assembly language program 101 containing dispatch interface information 111, memory interface information 113, tile memory information 115, and a flow description 117 specifying one or more data flows.

[0114] For example, compiler 107 may be configured to compile computer program 105 written in a high-level language to generate assembly language program 101 .

[0115] Alternatively, the compile / programming tool may be configured to present a user interface to receive user input to identify dispatch interface information 111 , memory interface information 113 , tile memory information 115 , and one or more data flows, etc. Based on the user input, the compile / programming tool may check for errors and generate the assembly language program 101 .

[0116] Optionally, the compiler and / or compilation / programming tool may be further configured to map one or more data flows specified in the assembly language program 101 to data flows in the coarse-grained reconfigurable array 103, including mapping the set of memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) to tile memories (e.g., 131, 133) in the coarse-grained reconfigurable array 103.

[0117] Figure 8 An instruction execution schedule generated from an assembly language program according to one embodiment is described.

[0118] For example, from Figure 1 The assembly language program 101 generates an instruction execution schedule 223 for use in Figure 3 The coarse-grained reconfigurable array 103 is executed using a scheduler 221 implemented as a software tool.

[0119] Figure 1 An assembly language program 101 specifies a data flow through storage locations represented by memory variables. The data flow has instructions that specify operations to be performed on the data in the flow.

[0120] The hardware configuration file 239 may identify high-level structural features of the coarse-grained reconfigurable array 103 to be used to run the assembly language program 101. Such high-level structural features may be specified for the coarse-grained reconfigurable array 103 among possible implementations of the coarse-grained reconfigurable array. For example, the high-level structural features may specify the number of tiles (141, 143, ..., 145) in the coarse-grained reconfigurable array 103, the number of memory interfaces (e.g., 123, ..., 125), the connection topology in the synchronous and asynchronous connections 127, the number of clock cycle delays in the synchronous and asynchronous connections 127, etc.

[0121] Hardware profile 239 has sufficient detail to allow the scheduler to map instructions (e.g., 233, 243) in the data stream of assembly language program 101 into tiles 141, 143, ..., 145 for execution at the appropriate times indicated by the identification of cycles (e.g., 231, 241).

[0122] To achieve optimal performance, the scheduler 221 may map instructions to different tiles 141, 143, ..., 145 for execution. Although all instructions of the assembly language program 101 may be mapped to a single tile (e.g., 143 or 141) for execution, such a schedule is inefficient in that it fails to utilize resources in the remaining tiles (e.g., 145). The scheduler 221 is configured to distribute instructions to different tiles 141, 143, ..., 145 for parallel execution to improve performance and reduce or minimize the number of clock cycles to complete the computation of the assembly language program 101.

[0123] For example, the scheduler 221 may assign instructions of different data streams to different tiles. For example, the scheduler 221 may attempt to place the next instruction to be placed in different tiles and identify the placement that results in the best performance for executing to the next instruction.

[0124] When placing instructions (eg, 233, ..., 243), scheduler 221 also identifies clock cycles (eg, 231, ..., 241) for initiating execution of instructions (eg, 233, ..., 243) in tiles (eg, 141, 143, ..., 145).

[0125] In general, the instruction execution schedule 223 may include an instruction placement sequence for each of the tiles 141, 143, ..., 145. For example, a typical tile 141 is assigned to execute instructions 233, ..., 243 at clock cycles 231, ..., 241, respectively. The scheduler 221 identifies the cycles 231, ..., 241 so that the output of the computation can be used as the input of the subsequent computation in the correct cycle. Thus, data can flow in and among the tiles 141, 143, ..., 145 for synchronous operation.

[0126] In addition, the hardware configuration file 239 allows the scheduler 221 to map memory variables in the assembly language program 101 to the tiles 141, 143, ..., 145 for implementation via the tile memory (e.g., 131, ..., 133), such as Fig. 9 As described in .

[0127] Fig. 9 A memory image for implementing an assembly language program in a coarse-grained reconfigurable array according to one embodiment is described.

[0128] exist Fig. 9 In the example, scheduler 221 identifies a memory image 225 for assembly language program 101 for coarse-grained reconfigurable array 103 having the structural features identified in hardware configuration file 239 .

[0129] For example, in a typical tile 141, memory variables 153, ..., 175 of assembly language program 101 are mapped in memory image 225 for implementation via tile memory 131, ..., 133 of tile 141. Other memory variables of assembly language program 101 are mapped to other tiles (e.g., 143, ..., 145).

[0130] When data stored in a variable (e.g., 153) is mapped to a tile (e.g., 141) for implementation using its tile memory (e.g., 131 or 133), it is often efficient to map instructions that operate on the data to the same tile (e.g., 141) because accessing data via connections between tiles may take longer than accessing data within the tile. Therefore, the generation of the memory image 225 and the generation of the instruction execution schedule 223 may be performed together to identify the high-performance schedule 223.

[0131] Certain hardware details may be excluded from the hardware configuration file 239 to allow the scheduler 221 to focus on the instruction placement operations in the tiles 141, 143, ..., 145. Thus, the scheduler 223 does not determine the low-level details of configuring the coarse-grained reconfigurable array 103 to run the assembly language program 101 according to the schedule 223. Such low-level details may include how the dispatch interface 121 and the memory interfaces 123, ..., 125 are configured for operation of the assembly language program 101, how the memory locations represented by the memory variables (e.g., 153, 175) are implemented via the tile memory (e.g., 131, 133), how the connections (e.g., 135) in the tile (e.g., 141) are configured to facilitate the correct data flow within the tile (e.g., 141, 143, ..., 145), etc. A more detailed hardware configuration file may be used to generate a configuration for executing the assembly language program 101, such as Fig.10 As described in .

[0132] Fig.10 An execution configuration of a coarse-grained reconfigurable array for running an assembly language program according to one embodiment is described.

[0133] exist Fig.10 In the embodiment of the present invention, the hardware configuration file 249 can specify the low-level details of the coarse-grained reconfigurable array 103. The low-level details can no longer be determined by Figure 8 and Fig. 9 The scheduler 221 uses the hardware profile 239.

[0134] Configuration generator 229 may use hardware configuration file 249 to determine execution configuration 227 of assembly language program 101 having memory image 225 and instruction execution schedule 223 .

[0135] Execution configuration 227 has detailed information on how to control and / or use elements of coarse-grained reconfigurable array 103 to run assembly language program 101 .

[0136] For example, memory map 225 specifies which tile (e.g., 141) of coarse-grained reconfigurable array 103 is used to implement the memory represented by memory variable (e.g., 153). Configuration generator 229 may further determine which portion of tile memory (e.g., 131) in the tile (e.g., 141) is used for the memory represented by memory variable (e.g., 153) for executing configuration 227.

[0137] For example, the instruction execution schedule 223 identifies which instruction (e.g., 233) is scheduled to be initiated for execution on which tile (e.g., 141) at which clock cycle (e.g., 231). The configuration generator 229 may further determine the connectivity control 236 for the configuration of the connection 135 in the tile (e.g., 141) to ensure the proper data flow in the tile (e.g., 141) for executing the instruction. For example, the connection 135 in the tile (e.g., 141) may be configured via a control bit for a multiplexer in the connection 135; and the connectivity control 236 may identify the control bit.

[0138] For example, the dispatch interface information 111 of the assembly language program 101 specifies how the dispatch interface 121 stores inputs received as arguments 151, ..., 161. After determining how to use which slice memory (e.g., 131, ..., 133) of which slices (e.g., 141, 143, ..., 145) to implement the memory variables 153, ..., 163 associated with the arguments 151, ..., 161, the configuration generator 229 may further determine the operation control 237 of the dispatch interface 121 to process the inputs.

[0139] Similarly, after determining the tile memory implementation for the memory variables 175, ..., 185 identified in the memory interface information 113 of the assembly language program 101, the configuration generator 229 may further determine the operation control (e.g., 247) of the memory interface (e.g., 123, ..., 125) to process the memory access operations 173, ..., 183 identified in the processing flow description 117 using its access ID 171, ..., 181.

[0140] For example, the configuration generator 229 may trace the data flow specified in the flow description 117 of the assembly language program 101 and implement it according to the instruction execution schedule 223. When the trace detects that data flows into a tile (e.g., 141) at clock cycle 231, the configuration generator 229 identifies an incoming control 235 to be applied to facilitate the flow of data into the tile 141; and when the trace detects that data flows out of the tile 141 at clock cycle 241, the configuration generator 229 identifies an outgoing control 245 to be applied to the tile 141 to facilitate the flow of data out of the tile 141 (e.g., a timing control of a delay register of the tile 141).

[0141] When the coarse-grained reconfigurable array 103 is controlled and / or used according to the execution configuration 227 , the coarse-grained reconfigurable array 103 may execute instructions of the assembly language program 101 according to the instruction execution schedule 223 to perform calculations as specified in the assembly language program 101 .

[0142] Fig.11 A method for identifying a configuration of a coarse-grained reconfigurable array to run an assembly language program is presented according to one embodiment.

[0143] For example, Fig.11 The method can be used in the configuration generator 229 implemented as a downgrade program to generate Fig.10 Execution configuration 227.

[0144] At box 251, the configuration generator 229 receives the assembly language program 101, which identifies a data flow through memory locations represented by memory variables (e.g., 153, ..., 163, 175, ..., 185, 191, ...) and identifies instructions configured to transform data in the data flow (e.g., as specified in the flow description 117).

[0145] At block 253, configuration generator 229 further receives hardware configuration file 249 that identifies details of coarse-grained reconfigurable array 103 having a plurality of tiles 141, 143, ..., 145 that are operable in parallel.

[0146] For example, the coarse-grained reconfigurable array 103 may include a plurality of memory interfaces (e.g., 123). One of the memory interfaces may be configured / used as a dispatch interface 121. The coarse-grained reconfigurable array 103 has a plurality of tiles 141, 143, ..., 145 interconnected via synchronous connections 127 and asynchronous connections 129. Each of the tiles may have a tile memory (e.g., 131, ..., 133) and a reconfigurable computing logic 137.

[0147] At block 255 , configuration generator 229 further receives instruction execution schedule 223 , which identifies the timing of executing instructions of assembly language program 101 in tiles 141 , 143 , . . . , 145 .

[0148] At box 257, the configuration generator 229 identifies memory (e.g., 131, ..., 133) in the tile (e.g., 141, 143, ..., 145) that is configured to implement the memory location represented by the memory variable (e.g., 153, ..., 163, 175, ..., 185, 191, ...).

[0149] At block 259 , configuration generator 229 generates execution configuration 227 that identifies operational controls (eg, 235 , 245 , 236 , 237 , 247 ) to be applied in coarse-grained reconfigurable array 103 during execution of instructions of assembly language program 101 .

[0150] For example, the assembly language program 101 includes dispatch interface information 111 representing an operation executed to store an input into a first memory location represented by a first memory variable (153, ..., 163). After identifying a tile memory to implement the first memory location, the configuration generator 229 may identify an operation control 237 of the dispatch interface 121 of the coarse-grained reconfigurable array 103 based on the dispatch interface information 111 to store the input into the tile memory identified to implement the first memory location.

[0151] For example, the assembly language program 101 includes memory interface information 113 representing an operation executed to store data at or retrieve data from a second memory location represented by a second memory variable (175, ..., 185). After identifying a tile memory used to implement the second memory location, the configuration generator 229 can identify an operation control 247 of a memory interface (e.g., 123 or 125) of the coarse-grained reconfigurable array 103 based on the memory interface information 113 to store data at or retrieve data from the tile memory identified to implement the second memory location.

[0152] For example, assembly language program 101 has a flow description 117 that specifies data flow. Configuration generator 229 can track data flow in conjunction with identifying the timing of executing instructions to identify the timing of controls (e.g., 235, 245, 236, 237, 247) to be applied in the slice during execution of assembly language program 101.

[0153] For example, during tracing of data flow, the configuration generator 229 can detect an instance of data flowing into a first tile (e.g., 141) of the coarse-grained reconfigurable array 103. In response, the configuration generator 229 can identify incoming controls 235 and the timing (e.g., cycles 231) of the incoming controls 235 to be applied to the first tile 141 during execution of the assembly language program 101 in the coarse-grained reconfigurable array 103.

[0154] For example, during tracing of data flow, the configuration generator 229 can detect an instance of data flowing out of the first tile 141 of the coarse-grained reconfigurable array 103. In response, the configuration generator 229 can identify outgoing controls 245 and the timing (e.g., cycles 241) of the outgoing controls to be applied to the first tile 141 during execution of the assembly language program 101 in the coarse-grained reconfigurable array 103.

[0155] For example, during tracking of data flow using tiles, the configuration generator 229 may identify connectivity controls 236 of tiles 141, 143, ..., 145 for data to flow within the tiles according to the instruction execution schedule 223. For example, each respective tile (e.g., 141) among the tiles has internal connections 135 between tile memories 131, ..., 133 and computation logic 137. After determining the tile memories implementing memory variables in the assembly language program 101, the configuration generator 229 may determine connectivity among the tile memories (e.g., 131, ..., 133) and computation logic 137 to facilitate data flow within the tile (e.g., 141). The internal connections 135 may include multiplexers to control data paths; and the connectivity controls 236 may include setting bits to control the multiplexers to implement data flow.

[0156] After determining execution configuration 227, coarse-grained reconfigurable array 103 may be controlled according to the contents of execution configuration 227 during execution of instructions of assembly language program 101 according to instruction execution schedule 223. Use of execution configuration 227 ensures the correct operating configuration for running assembly language program 101. Different schedules (e.g., 223) of assembly language program 101 as input to configuration generator 229 may result in different configurations (e.g., 227).

[0157] Fig.12 The segmentation of instructions of a data stream into groups is shown according to one embodiment.

[0158] For example, according to Fig.12 Will Figure 1 The instructions identified in the flow description 117 of the assembly language program 101 are divided into instruction groups.

[0159] For example, Figure 1The flow description 117 of the assembly language program 101 may list a plurality of data flows 301 , . . . , 303 .

[0160] For example, data flow 301 specifies a synchronized data flow through memory locations represented by memory variable 313. Data flow 301 further specifies instruction 311 that identifies an opcode for an operation to be performed on data flowing between memory locations represented by memory variable 313. Similarly, data flow 303 specifies memory variable 323 and instruction 321.

[0161] exist Fig.12 , instructions 311, ..., 321 and memory variables 313, ..., 323 of data streams 301, ..., 303 are divided 309 into a plurality of groups 305, ..., 307. The number of groups 305, ..., 307 is not less than the number of synchronous data streams 301, ..., 303.

[0162] For example, group 305 is configured to have instructions 233, ..., 243 and memory variables 153, ..., 175 from some of the data streams 301, ..., 303. Group 307 has instructions 331 and memory variables 333 from some of the data streams 301, ..., 303.

[0163] For example, since memory variables 153, ..., 175 are assigned to group 305, instructions 233, ..., 243 that operate on data at memory locations represented by memory variables 153, ..., 175 may also be assigned to group 305. However, instructions that operate on data at memory locations represented by memory variables that are not in group 305 are not assigned to group 305. Some instructions do not operate on memory variables that are mapped to tile memory for implementation and are therefore not restricted in their placement by the memory variable implementation.

[0164] Each of the groups 305 , . . . , 307 is to be implemented on a tile (eg, 141 , 143 , . . . , or 145 ) of the coarse-grained reconfigurable array 103 that is used to run a program having the data flows 301 , . . . , 303 .

[0165] Partition 309 is configured to enforce constraints 315. For example, instructions that share one or more tile memory variables should be placed on the same tile and therefore assigned to one or more groups to be implemented on the same tile. For example, instructions that each start a synchronized stream may not be placed on the same tile and therefore may not be placed in one or more groups to be implemented on the same tile. For example, multiple same-level instructions may not be placed on the same tile and therefore may not be placed in one or more groups to be implemented on the same tile.

[0166] Optionally, constraints 315 may include a requirement to balance instruction groups 305, ..., 307 so that each group has a similar number of instructions.

[0167] Optionally, constraints 315 may include a requirement to balance memory usage of instruction groups 305, ..., 307 so that each group has similar total tile memory utilization.

[0168] Within each instruction group (e.g., 305), tile memory variables (e.g., 153, ..., 175) are selected so that they can be allocated to (several) tile memory regions without exceeding the tile memory region size, without generating tile memory access conflicts for any instructions, etc.

[0169] Additionally, constraints 315 may include hardware considerations to improve performance (eg, placing adjacent data in a data stream in groups to be implemented on tiles close to each other).

[0170] As a result of partitioning 309, a memory map 225 is generated to map memory variables (e.g., 153, 175, ..., 333) to tiles (e.g., 141, 143, ..., 145) of coarse-grained reconfigurable array 103. Memory map 225 reduces the choices explored by the scheduler using a brute force approach when scheduling instructions.

[0171] Fig.12 The data stream 301, ..., 303 is illustrated as being partitioned 309 according to a constraint on a set of instruction groups 305, ..., 307. In general, the same constraint 315 may allow multiple sets of instruction groups of the data stream 301, ..., 303 to be partitioned in different ways.

[0172] Each of the different groups of instruction groups represents a different portion of the search space of possible choices for the scheduler 101. Therefore, the scheduler 221 can use each different group to search for an effective schedule for running the program instructions in the coarse-grained reconfigurable array 103. The parallel search can be performed based on the different groups of instruction programs respectively. After finding multiple effective schedules using the different groups of instruction groups, the best execution schedule can be selected to run the program 101.

[0173] Fig.13 Instruction slots on a tile that may be used to schedule instructions for execution in the tile are illustrated according to one embodiment.

[0174] exist Fig.13, a tile 141 of the coarse-grained reconfigurable array 103 may execute multiple instructions in parallel in different pipeline stages of the computational logic 137 of the tile 141. Instruction slots 351, 353, ..., 355 are configured to accept different instructions for pipeline execution. The tile 141 may execute a start 341 of executing an instruction in the slot 351 at a clock cycle 361 in the initial stage of the pipeline. In the next clock cycle 363, the execution 343 of the instruction in the slot 351 is executed in the next stage of the pipeline; and the initial stage may be used to execute the start 341 of the instruction in the next slot 353. Therefore, through pipeline operation, the tile may execute the instructions of the slots 351, 353, ..., 355 in parallel.

[0175] For example, at clock cycles 361, 363, ..., 365, the slice 141 performs launches 341 of instructions in slots 351, 353, ..., 355, respectively. At clock cycle 367, the slice 141 performs parallel execution 343 of the instructions in slots 351, 353, ..., 355, respectively, in different pipeline stages of the computational logic 137 of the slice 141. At clock cycle 369, completion 345 of execution is reached for the instruction in slot 351, and the slice 141 performs parallel execution 343 of the instructions in slots 353, ..., 355, respectively. After clock cycle 369, the instruction slot 351 may accept another instruction.

[0176] Thus, instructions assigned to tile 141 have multiple options for their execution. For example, the instruction may be placed in one of slots 351, 353, ..., 355 and scheduled for execution at an allowed clock cycle. For example, if an instruction is scheduled in slot 351 for execution at cycle 361, then the next instruction may be scheduled in slot 353 for execution at or after cycle 363, or the next instruction may be scheduled in slot 355 for execution at or after cycle 365, or the next instruction may be scheduled in slot 351 for execution after cycle 369.

[0177] For a selected option of scheduling an instruction in a slot (e.g., 351, 353, ..., or 355) for execution at a clock cycle (e.g., 361, 363, ..., 365, 367, ..., or 369), scheduler 221 may determine whether a timing requirement for connecting an output to an input is met for at least a combination of the current instruction and a previous instruction that has been scheduled before the current instruction. After finding a valid option for the current instruction, scheduler 221 may select the next instruction for scheduling, such as Fig.14 Like in.

[0178] Fig.14 Operations to schedule instructions are shown according to one embodiment.

[0179] exist Fig.14 , the scheduler 221 may select 371 the next instruction from the remaining instructions that have not yet been scheduled. For example, the scheduler 221 may select the next instruction according to the sequence of instructions in the data stream (e.g., 301 or 303). For example, the scheduler 221 may randomly select the next instruction.

[0180] If it is determined 373 that there is a next instruction to be scheduled, the scheduler 221 may continue to schedule the selected instruction. Otherwise, the scheduler 221 completes 387 the generation of the instruction execution schedule 223.

[0181] After selecting an instruction for scheduling, scheduler 221 may determine 375 an available location for placing the instruction.

[0182] For example, based on a memory image 225 that maps memory variables used by instructions (e.g., as described by Fig.12 The scheduler 221 may identify the tile in which the memory variable is implemented, based on the partition 309 in the memory, and then schedule the instruction for execution in the tile.

[0183] like Fig.13 As illustrated in , the scheduler 221 may further place the instruction in one of the instruction slots of the tile 141 .

[0184] If it is determined 377 that an available location (eg, slot) is found, the scheduler 221 may further determine 379 a valid schedule for the instruction.

[0185] For example, if an instruction is to be placed in an instruction slot, scheduler 221 may search for a clock cycle that satisfies the timing requirement for tile 141 to receive the instruction's input from a memory location that may receive output from the execution of other instructions.

[0186] If the scheduler 221 determines 381 that a valid schedule is found for the instruction, the scheduler 221 may further select 371 the next instruction for scheduling.

[0187] However, if the scheduler 221 determines 381 that a valid schedule is found for the current instruction being scheduled, then the scheduler 221 may determine 375 an alternative location for scheduling of the current instruction. If a suitable location cannot be found for the instruction, then the scheduler 221 may identify 383 the schedule of the previous instruction as invalid. Therefore, the previous instruction is selected for rescheduling. The scheduler 221 moves 385 to the previous instruction as the instruction for scheduling.

[0188] In determining 375 available locations and determining 379 a valid schedule, the scheduler 221 excludes options that have been previously identified 383 as invalid and / or previously evaluated.

[0189] The scheduler 221 may continue as follows Fig.14 The loop shown in is continued until the instructions of the instruction groups 305, ..., 307 have been scheduled or it is determined that the instruction groups 305, ..., 307 cannot be properly scheduled.

[0190] Fig.15 A method is presented for scheduling instructions of an assembly language program for execution on a coarse-grained reconfigurable array according to one embodiment.

[0191] For example, you can use Figure 12 to Figure 14 The technology in Figure 8 and Fig. 9 The scheduler 221 is configured Fig.15 method to provide Figure 8 Instruction execution schedule 223.

[0192] At block 271 , scheduler 221 receives assembly language program 101 that identifies a data flow 301 , . . . , 303 through memory locations represented by memory variables 313 , . . . , 323 and identifies instructions 311 , . . . , 321 configured to transform data in the data flow 301 , . . . , 303 .

[0193] At block 273, the scheduler 221 receives a hardware profile 239 that identifies characteristics of a coarse-grained reconfigurable array 103 having a plurality of tiles 141, 143, ..., 145 that may operate in parallel.

[0194] At box 275, the scheduler 221 generates a memory image 225 that identifies, for each corresponding memory variable (e.g., 153 or 175) in the assembly language program 101, one of the memory locations in the tile (e.g., 141) that contains the memory location represented by the corresponding memory variable (e.g., 153 or 175).

[0195] For example, scheduler 221 may be configured to generate memory image 225 by partitioning 309 memory variables 313, ..., 323 and instructions 311, ..., 321 of program 101 into a plurality of groups 305, ..., 307. Each of groups 305, ..., 307 is configured to be implemented on one of tiles 141, 143, ..., 145. Groups 305, ..., 307 as partitioned to be implemented on tiles 141, 143, ..., 145 satisfy constraints and / or requirements.

[0196] For example, instructions that share one or more tile memory variables are placed in one or more groups to be executed on the same tile.

[0197] For example, instructions that each start a synchronous stream are not placed in one or more groups to be executed on the same tile.

[0198] For example, multiple same-level instructions are not placed in one or more groups to be executed on the same tile, etc.

[0199] For example, partitioning 309 may be performed to balance the number of instructions implemented per tile, balance the number of memory variables implemented per tile, and / or balance the amount of memory usage implemented per tile, among other things.

[0200] At block 277 , the scheduler 221 assigns the instructions 311 , . . . , 321 to the tiles 141 , 143 , . . . , 145 for execution based on the memory image 225 .

[0201] For example, each respective instruction (eg, 233) among instructions 311, ..., 321 is assigned to a slice containing memory variables (eg, 153, 175) having data to be operated on by the respective instruction (eg, 233).

[0202] At block 279 , the scheduler 221 provides as output an instruction execution schedule 223 identifying the timing of executing the instructions 311 , . . . , 321 in the tile.

[0203] For example, the timing for executing instructions 311, ..., 321 may be determined by: selecting 371 a current instruction (e.g., 233) for scheduling; determining 375 an available location by identifying a slot (e.g., 353) in a first tile (e.g., 141) containing memory variables (e.g., 153, 175) used by the current instruction (e.g., 233); and determining 379 a valid schedule for the current instruction (233) by searching for a clock cycle (e.g., 231) for executing the current instruction (e.g., 233) in the slot (e.g., 353).

[0204] In response to determining 381 that a valid spoke RAM slot is found for executing the current instruction (eg, for execution at an active clock cycle 231 ), the scheduler 221 may select 371 a next instruction for scheduling.

[0205] In response to determining 381 that a valid spoke RAM slot for executing the current instruction (e.g., 233) in the slot (e.g., 353) is not found, the scheduler 221 is configured to search for an available slot in the first tile. In response to finding this available slot, the scheduler 221 can search for a clock cycle for executing the current instruction in the available slot.

[0206] However, in response to determining 375 that no available slot was found, the scheduler 221 is configured to: determine a prior instruction scheduled before the current instruction; identify 383 a first schedule previously determined for the prior instruction as invalid; and begin determining / searching a second valid schedule for the prior instruction.

[0207] Different memory images (e.g., 225) may be generated for the same assembly language program 101; and the operations in blocks 277 and 279 may be performed in parallel based on the different memory images to generate different instruction execution schedules (e.g., 223). Scheduler 221 may then evaluate the performance level (e.g., based on latency, energy consumption, etc.) of the instruction execution schedules (e.g., 223). The best execution schedule may be selected for running assembly language program 101 on coarse-grained reconfigurable array 103.

[0208] Fig.16 The configuration of inputs to a scheduler trained via reinforcement learning according to one embodiment is described.

[0209] exist Fig.16 , scheduler 221 has an artificial neural network 417 trained via reinforcement learning (eg, using proximal policy optimization) to select placement 419 of instructions 405 of program 101 for execution in a computing device having multiple circuit units operable in parallel.

[0210] For example, a scheduler 221 having an artificial neural network 417 may be used to Figure 1 The instructions 311, ..., 321 of the assembly language program 101 are placed in Figure 2 The coarse-grained reconfigurable array 103 includes tiles 141 , 143 , . . . , 145 .

[0211] For a given program 101 having instructions 311, ..., 321, the scheduler 221 may generate a computation graph to represent execution dependency conditions 415 in the program 101. For example, the execution dependency conditions 415 may include dependencies of some instructions producing outputs that are inputs to other instructions. For example, the execution dependency conditions 415 may include memory dependencies of instructions implemented on a tile depending on memory variables implemented in the tile.

[0212] To execute instructions 311, ..., 321 on the coarse-grained reconfigurable array 103, the scheduler 221 is configured to determine the placement of the instructions 311, ..., 321 in the tiles 141, 143, ..., 145 and / or in the instruction slots (e.g., 351, 353, ..., 355) of the tiles of the coarse-grained reconfigurable array 103.

[0213] The scheduler 221 may be configured to identify placement 419 of one instruction (eg, 405 ) at a time in view of a prior instruction 401 that has been placed before the next instruction 405 .

[0214] exist Fig.16 , after a schedule 413 of preceding instructions 401 has been generated to specify which of the instructions 401 are to be placed in which tiles for execution, a selector 407 selects the next instruction 405 from the remaining instructions 403 to be placed / scheduled. For example, the next instruction 405 may be selected from the remaining instructions 403 according to the topological ordering of the instructions in the dependency graph, according to the order of the instructions in the data stream (e.g., 301 or 303), or according to a random selection.

[0215] Data representing a schedule 413 of scheduled instructions 401, execution dependency conditions 415, and a next instruction 405 may be provided as input 411 to an artificial neural network 417 to generate a placement 419 of the next instruction 405. The placement 419 may include a tile ID 421 and a slot ID 423 identifying a tile (e.g., 141) and a slot (e.g., 351 or 353) in the tile (e.g., 141) for executing the next placed instruction 405.

[0216] After determining the placement 419 of the next instruction 405, the next instruction 405 may be added to the group of scheduled instructions 401 with the updated schedule 413. Further instructions 403 may be selected from the remaining instructions; and the artificial neural network 417 may again be used to generate the placement of the further instructions. The operations may be repeated until no remaining instructions remain to be scheduled.

[0217] Optionally, a mask may be applied to the output of the scheduler 221 to filter out invalid placements. This ensures the generation of valid node placements. For example, placement 419 is selected from the possibilities limited to placements that comply with the constraints of the streaming engine, depending on the nature of the instruction 405 to be placed in input 411.

[0218] In general, the scheduler 221 with the artificial neural network 417 can be used in conjunction with other types of schedulers 221.

[0219] For example, some instructions (eg, 405 ) may be selected to be placed by a scheduler 221 having an artificial neural network 417 ; and other instructions (eg, 401 ) may be scheduled by another scheduler 221 .

[0220] The artificial neural network 417 is trained as an actor via reinforcement learning to determine the action of placing 419 in response to the input 411, such as Fig.17 and Fig.18 As described in .

[0221] Fig.17

[0013] The description generates samples to train a scheduler via reinforcement learning according to one embodiment.

[0222] exist Fig.17 4, for an input 411 to be provided to an artificial neural network 417 to generate a placement 419, a test placement 418 is selected from a set of possible placements. The performance of the selected placement 418 is evaluated to generate samples 431; and the set of samples (e.g., 431) can be used to train the artificial neural network 417 to generate placements 419 to improve / maximize reward / performance. Optionally, the test placement 418 can be identified by the artificial neural network 417 in response to the input 411.

[0223] The performance evaluator 409 is configured to determine a cycle count 425 to execute the scheduled instruction 401 and the next instruction 405 according to the schedule 413 and the test placement 418. The cycle count 425 represents the latency to produce the output of the scheduled instruction 401 and the next instruction 405 executed according to the schedule 413 and the test placement 418. Therefore, the performance 435 of selecting the test placement 418 in response to the input 411 can be ranked / scored based on the cycle count 425.

[0224] Sample 431 includes input 411, test output 433 with test placement 418, and performance 435 of generating test output 433 based on input 411. Performance 435 can be used to represent the reward for artificial neural network 417 for making the selection of test placement 418.

[0225] Different test placements (e.g., 418) may result in different performance (e.g., 435). Fig.18 In , reinforcement learning (e.g., using proximal policy optimization (PPO)) can be used to train the artificial neural network 417 to improve its ability to select high-performance placements.

[0226] Optionally, some or all of the test placements may be selected or generated using the current version of the artificial neural network 417 of the scheduler 221 (e.g., 418) before further training the artificial neural network 417. Optionally, another scheduler 221 (e.g., using Fig.14 method) to select some test placements (e.g., 418).

[0227] After generating samples 431 to place the next instruction 405 after generating the schedule 413 for the scheduled instructions 401, the next sample may be generated to place further instructions selected from the remaining instructions 403 in view of the combined placement of the scheduled instruction 401 and the next instruction 405. Such operations may be repeated to generate samples for placing the next instruction (e.g., 405) in view of different amounts of scheduled instructions 401 (e.g., 401) of the program 101, including the case where the next instruction (e.g., 405) is the last instruction to be placed / scheduled.

[0228] Fig.18 Reinforcement learning for a scheduler according to one embodiment is described.

[0229] exist Fig.18 In the example, the sample 431 (e.g., Fig.17 ) to train an evaluator 443 having an artificial neural network 447 and a scheduler 221 having another artificial neural network 417 as participants.

[0230] Evaluator 443 is configured to predict the performance (e.g., 435) of the placement selected by the scheduler in response to the input (e.g., 411). The artificial neural network 447 of evaluator 443 is adjusted during training to match the predicted performance produced by the artificial neural network 447 of evaluator 443 and the corresponding performance (e.g., 435) specified in sample 431 and produced by performance evaluator 409.

[0231] Trained evaluator 443 is used to guide scheduler 221 in making placements to improve / maximize performance.

[0232] Optionally, the set of samples 431 used in reinforcement learning 441 may be tailored / selected to balance a portion of the samples that reach a final solution for all instructions of scheduler 101 and another portion of the samples that do not reach a final solution.

[0233] In one embodiment, the artificial neural network 417 of the scheduler 221 and the artificial neural network 447 of the evaluator 443 are trained based on the samples 431 to minimize the cost based on the cost function.

[0234] For example, a cost function may be constructed to assess costs based on the losses associated with the actions placed by the artificial neural network 417 of the scheduler 221 and the losses associated with the reward assessments made by the artificial neural network 447 of the evaluator 443.

[0235] The loss associated with the placed action generated by the artificial neural network 417 of the scheduler 221 may be evaluated based on selecting the smaller one from the loss candidates evaluated according to the advantage weighted by a ratio. For example, the ratio may be an exponential function of the logarithmic function of the probability ratio, which is equal to the probability of the action from training divided by the probability of the action in the sample; and the advantage may be the difference between the reward / performance from the sample and the corresponding reward / performance predicted by the evaluator 443. The loss associated with the reward evaluation performed by the artificial neural network 447 of the evaluator 443 may be based on the mean squared error between the reward / performance from the sample and the corresponding reward / performance predicted by the evaluator 443.

[0236] The total loss to be minimized in reinforcement learning 441 can be based on a combination of the loss caused by the artificial neural network 447 of the evaluator 443 predicting a reward / performance different from the sample 431 and the loss caused by the artificial neural network 417 of the scheduler 221 selecting an action placed differently from the sample 431.

[0237] By adjusting the artificial neural network 447 of the evaluator 443 and the artificial neural network 417 of the scheduler 221 to minimize the total loss, the artificial neural network 447 of the evaluator 443 is trained to predict the reward / performance based on the sample 431; and the artificial neural network 417 of the scheduler 221 is trained to select the placement that maximizes the reward / performance at the same time.

[0238] Reinforcement learning 441 and artificial neural network 417 may be used together with other scheduling techniques to generate instruction execution scheduler 223 for assembly language program 101 .

[0239] For example, artificial neural network 417 can be used to improve Fig.14 Brute force search technique. Fig.14 The brute force search technique of may find the first encountered valid placement schedule as a search result. However, there may be other valid schedules that have better performance in terms of latency (eg, the number of cycles required to complete the calculation of the assembly language program 101).

[0240] Artificial neural network 417 may be used to select a placement schedule that is likely to be the best execution schedule, rather than Fig.14 The scheduler 221 may search for the next instruction's schedule as in the placement schedule selected by the artificial neural network 417 to have an improved chance of reaching an instruction execution schedule 223 for better execution.

[0241] In addition, when the scheduler 221 uses Fig.14When the brute force search technique is used to test placement options to reach the effective instruction execution schedule 223, the performance evaluator 409 can be used to determine the cycle count 425 of the tested / checked placement to generate the sample 431. The sample 431 can be used to perform the following steps: Fig.18 Reinforcement learning 441 in the artificial neural network 417 is used to improve the ability of the artificial neural network 417 to select placements with better performance. Fig.14 A brute force search can be performed to find a schedule that improves performance and samples 431 to further train the artificial neural network 417. After training via reinforcement learning 441, the process starting from the placement suggested by the artificial neural network 41 can be performed again. Fig.14 A brute force search is performed to search for a further improved instruction execution schedule 223.

[0242] Fig.19 An instruction placement method according to one embodiment is shown.

[0243] For example, Fig.19 The method may be performed by a scheduler 221 implemented via software and / or hardware in a computing device to utilize Figure 16 to Figure 18 The described reinforcement learning technique determines an instruction placement among multiple possible placements.

[0244] At block 291 , the scheduler 221 receives first data representing execution dependency conditions 415 of instructions 401 and 405 of the program 101 .

[0245] For example, program 101 may be an assembly language program 101 having a flow description 117 identifying a data flow 301 , . . . , 303 through memory locations represented by memory variables 313 , . . . , 323 and identifying instructions 311 , . . . , 321 configured to transform data in the data flow 301 , .

[0246] For example, the first data may include data identifying a dependency of execution of the first instruction upon receiving as input an output produced from execution of a second instruction.

[0247] For example, the first data may include further data identifying a dependency of a third instruction scheduled to execute in the same respective tile when accessing data at a memory location represented by a memory variable implemented in the respective tile.

[0248] At block 293 , the scheduler 221 further receives second data representing a schedule 413 of a first portion of the instructions of the program (eg, 401 ) for execution in a device having a plurality of circuit units operable in parallel.

[0249] For example, the device may include a coarse-grained reconfigurable array 103 having a plurality of tiles 141, 143, ..., 145 that can respectively operate in parallel as a plurality of circuit units. Each of the tiles (e.g., 141) may have a plurality of instruction slots 351, 353, ..., 355 for pipeline execution. The schedule 413 may have a placement of each respective instruction among the instructions 401; and the placement of the respective instructions may include an identification of a tile (e.g., 141) among the tiles 141, 143, ..., 145 and a slot (e.g., 351 or 353) among the instruction slots in the tile (e.g., 141) for executing the respective instruction. Although the reinforcement learning (RL) technique is discussed in conjunction with the scheduler 221 of the coarse-grained reconfigurable array (103), the reinforcement learning (RL) technique for placement may also be used to schedule chip placement tasks.

[0250] At block 295, the scheduler 221 further receives third data identifying a next instruction 405 selected from a second portion of the instructions (eg, 403) of the program 101 that remain to be scheduled for execution in the device.

[0251] For example, the next instruction 405 may be selected from the remaining instructions 403 to be scheduled via random selection, incremental selection, or selection based on topological sorting.

[0252] At box 297 , the scheduler 221 applies the first data, the second data, and the third data as input 411 to the first artificial neural network 417 .

[0253] At block 299 , the scheduler 221 uses the first artificial neural network 417 to select a placement 419 of the next instruction 405 in one of the circuit cells from a plurality of possible placements of the next instruction 405 in the device.

[0254] For example, placement 419 may include tile ID 421 and slot ID 423 indicating that the next instruction 405 is scheduled for execution in the slot represented by slot ID 423 (eg, 351 or 353) in the tile represented by tile ID 421 (eg, 141).

[0255] The scheduler 221 may have a second artificial neural network 447 trained to generate, in response to the input 411, a performance measure of the first artificial neural network 417 in selecting a placement 419 for the next instruction 405 from a plurality of possible placements.

[0256] In order to train the first artificial neural network 417 as a participant and the second artificial neural network 447 as an evaluator via reinforcement learning 441, a plurality of samples 431 may be generated. Each respective sample among the samples 431 is generated to include / specify: a respective input (e.g., 411) of the first artificial neural network 417, a respective placement 418 of a respective instruction as a possible output of the artificial neural network 417, and a respective performance measure (e.g., performance 435) of the respective placement 418 as a reward for the participant's action of selecting the respective placement 418. The respective input (e.g., 411) may identify a respective schedule (e.g., 413) of a respective portion of the instructions (e.g., 401) of the program 101. The respective input (e.g., 411) may identify a respective instruction to be scheduled in addition to scheduling the instruction 401 according to the respective schedule 413. A respective performance metric (eg, performance 435 ) may be determined based on a cycle count 425 of executing scheduled instructions (eg, 401 ) and respective instructions (eg, 405 ) according to a respective schedule (eg, 413 ) and respective placement (eg, 418 ).

[0257] The first artificial neural network 417 and the second artificial neural network 447 may be trained using samples 431 and a technique of proximal policy optimization (PPO) of reinforcement learning to minimize a loss function.

[0258] For example, the loss function is based on evaluating: a first loss that represents a reduction in a performance measure that results from the first artificial neural network selecting a placement that is different from a corresponding placement in the sample; and a second loss that results from the second artificial neural network producing a performance measure that is different from the corresponding performance measure in the sample.

[0259] For example, a first loss (e.g., a participant loss) may be based on a difference between a performance measure generated by the second artificial neural network in response to an input specified in the sample and a corresponding performance measure specified in the sample, wherein the difference is weighted according to an exponential function of a logarithmic function of a probability ratio, wherein the probability ratio is equal to the ratio between: the probability of a placement selected by the first artificial neural network in response to the input specified in the sample; and the probability of the corresponding placement specified in the sample.

[0260] For example, the second loss (eg, evaluator loss) may be based on the mean squared error between a performance measure generated by the second artificial neural network in response to an input specified in the sample and a corresponding performance measure specified in the sample.

[0261] The generation of samples 431 and the application of reinforcement learning 441 may be performed in iterations.

[0262] For example, different placement options may be tested when searching for effective combinations of instruction placements for different parts of the program 101. The performance of the tested placements may be evaluated to generate a plurality of samples 431 for use in training the first artificial neural network 417 and the second artificial neural network 447. Some of the tested placements may be selected using the first artificial neural network 417 as previously trained. Further training performed using the samples 431 may cause the first artificial neural network 417 to improve in making selections.

[0263] Fig. 20 An example machine of a computer system is illustrated within which a set of instructions may be executed for causing the machine to perform any one or more of the methodologies discussed herein.

[0264] Fig. 20 The computer system of the present invention can be used to perform the operation of the scheduler 503 to generate an instruction execution schedule 223 to run the reference program on the coarse-grained reconfigurable array (CGRA) 103 by executing instructions configured to perform the operation corresponding to the scheduler 221. Figures 1 to 19 An assembly language program 101 is discussed.

[0265] In some embodiments, the machine may be connected (e.g., using a network) to other machines in a Local Area Network (LAN), an Intranet, an Extranet, and / or the Internet. The machine may operate in the capacity of a server or a client user machine in a client-server network environment, as a peer machine in a peer-to-peer (or distributed) network environment, or as a server or a client user machine in a cloud computing infrastructure or environment.

[0266] For example, the machine may be configured as a personal computer (PC), a tablet PC, a set-top box (STB), a personal digital assistant (PDA), a cellular phone, a network appliance, a server, a network router, a switch or a bridge, or any machine capable of executing a set of instructions (sequential or otherwise) that specify actions to be taken by that machine. Furthermore, while a single machine is described, the term "machine" shall also be taken to include any collection of machines that individually or jointly execute a set (or multiple sets) of instructions to perform any one or more of the methodologies discussed herein.

[0267] Fig. 20The example computer system illustrated in 504 includes a processing device 502, a main memory 504, and a data storage system 518 that communicate with each other via a bus 530. For example, the processing device 502 may include one or more microprocessors; the main memory may include a read-only memory (ROM), a flash memory, a dynamic random access memory (DRAM) (such as synchronous DRAM (SDRAM) or Rambus DRAM (RDRAM)), a static random access memory (SRAM), etc. The bus 530 may include, or be replaced by, multiple buses.

[0268] Fig. 20 The processing device 502 in illustrative embodiments represents one or more general-purpose processing devices, such as a microprocessor, a central processing unit, or the like. More specifically, the processing device may be a complex instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, or a processor that implements other instruction sets, or a processor that implements a combination of instruction sets. The processing device 502 may also be one or more special-purpose processing devices, such as an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), a network processor, or the like.

[0269] Fig. 20 The computer system may further include a network interface device 508 for communicating via a computer network 520 .

[0270] The data storage system 518 may include a machine-readable medium 524 (also referred to as a computer-readable medium) having stored thereon one or more sets of instructions 526 or software embodying any one or more of the methodologies or functionality described herein. The instructions 526 may also reside, completely or at least partially, within the main memory 504 and / or the processing device 502 during execution by the computer system, the main memory 504 and the processing device 502 also constituting machine-readable storage media.

[0271] In one embodiment, the instructions 526 include instructions for implementing a method corresponding to the scheduler 503 (eg, referring to Figures 1 to 19 The functional instructions of the scheduler 221 of the assembly language program 101 described in the embodiment. Although the machine-readable medium 524 is shown as a single medium in the example embodiment, the term "machine-readable storage medium" should be considered to include a single medium or multiple media storing one or more sets of instructions. The term "machine-readable storage medium" should also be considered to include any medium capable of storing or encoding a set of instructions for machine execution and causing the machine to perform any one or more methodologies of the present disclosure. Therefore, the term "machine-readable storage medium" should be considered to include, but not limited to, solid-state memory, optical media, and magnetic media.

[0272] The present disclosure includes the methods described above and apparatuses that perform the methods, including data processing systems that perform these methods and computer-readable media containing instructions that, when executed on a data processing system, cause the system to perform these methods.

[0273] A typical data processing system may include an interconnect (eg, a bus and system core logic) that interconnects microprocessor(s) and memory. A microprocessor is typically coupled to a cache memory.

[0274] The interconnect interconnects the microprocessor(s) and memory together and also interconnects them to I / O device(s) via input / output controller(s). The I / O devices may include display devices and / or peripheral devices such as a mouse, keyboard, modem, network interface, printer, scanner, camera, and other devices known in the art. In one embodiment, when the data processing system is a server system, some I / O devices such as a printer, scanner, mouse, and / or keyboard are optional.

[0275] The interconnect may include one or more buses connected to each other through various bridges, controllers, and / or adapters. In one embodiment, the I / O controller includes a USB adapter for controlling a Universal Serial Bus (USB) peripheral device, and / or an IEEE-2394 bus adapter for controlling an IEEE-2394 peripheral device.

[0276] The memory may include one or more of: read-only memory (ROM), volatile random access memory (RAM), and non-volatile memory such as a hard drive, flash memory, and the like.

[0277] Volatile RAM is typically implemented as dynamic RAM (DRAM), which continuously requires power in order to refresh or maintain the data in the memory. Nonvolatile memory is typically a magnetic hard drive, magneto-optical drive, optical drive (e.g., DVDRAM), or other types of memory systems that maintain data even after power is removed from the system. Nonvolatile memory can also be random access memory.

[0278] The non-volatile memory may be a local device directly coupled to the rest of the components in the data processing system. Non-volatile memory that is remote from the system may also be used, such as a network storage device coupled to the data processing system through a network interface (such as a modem or Ethernet interface).

[0279] In the present disclosure, in order to simplify the description, some functions and operations are described as being performed or caused by software codes. However, such expressions are also used to specify functions resulting from the execution of codes / instructions by a processor (eg, a microprocessor).

[0280] Alternatively or in combination, the functions and operations as described herein may be implemented using dedicated circuitry, such as using an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA), with or without software instructions. Embodiments may be implemented using hardwired circuitry, either without software instructions or in combination with software instructions. Thus, the techniques are not limited to any specific combination of hardware circuitry and software, nor to any particular source for the instructions executed by a data processing system.

[0281] While one embodiment may be implemented on fully functional computers and computer systems, various embodiments are capable of being distributed as a computing product in a variety of forms and can be applied regardless of the specific type of machine or computer readable media used to actually implement the distribution.

[0282] At least some aspects disclosed may be embodied at least in part in software. That is, the techniques may be implemented in a computer system or other data processing system in response to its processor (e.g., microprocessor) executing sequences of instructions contained in a memory (e.g., ROM, volatile RAM, non-volatile memory, cache, or remote storage device).

[0283] The routines executed to implement the embodiments may be implemented as part of an operating system or a specific application, component, program, object, module or sequence of instructions (referred to as a "computer program"). A computer program is typically contained in various memories and storage devices that are located in the computer at different times and that, when read and executed by one or more processors in the computer, causes the computer to perform one or more instructions necessary to implement the elements involved in the various aspects.

[0284] Machine-readable media can be used to store software and data that cause the system to perform various methods when executed by a data processing system. Executable software and data can be stored in various places, including, for example, ROM, volatile RAM, non-volatile memory and / or cache. Parts of this software and / or data can be stored in any of these storage devices. In addition, data and instructions can be obtained from a centralized server or a peer-to-peer network. Different parts of data and instructions can be obtained from different centralized servers and / or peer-to-peer networks at different times and in different communication sessions or in the same communication session. Data and instructions can be obtained as a whole before executing the application. Alternatively, parts of data and instructions can be obtained dynamically and in a timely manner when execution is required. Therefore, it is not required that data and instructions be located as a whole on machine-readable media at a specific time.

[0285] Examples of computer-readable media include, but are not limited to, non-transitory, recordable and non-recordable media such as volatile and non-volatile memory devices, read-only memory (ROM), random access memory (RAM), flash memory devices, floppy disks and other removable disks, magnetic disk storage media, optical storage media (e.g., compact disk read-only memory (CDROM), digital versatile disks (DVD), etc.), etc. Computer-readable media may store instructions.

[0286] The instructions may also be embodied in digital and analog communication links using electrical, optical, acoustic or other forms of propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.). However, propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.) are not tangible machine-readable media and are not configured to store instructions.

[0287] Generally speaking, a machine-readable medium includes any mechanism that provides (ie, stores and / or transmits) information in a form accessible by a machine (eg, a computer, a network device, a personal digital assistant, a manufacturing tool, any device with a set of one or more processors, etc.).

[0288] In various embodiments, hardwired circuitry may be used in combination with software instructions to implement the techniques. Thus, the techniques are not limited to any specific combination of hardware circuitry and software, nor to any specific source of instructions executed by a data processing system.

[0289] The above description and drawings are illustrative and should not be construed as limiting. Numerous specific details are described to provide a thorough understanding. However, in some instances, well-known or conventional details are not described in order to avoid obscuring the description. References to one or an embodiment in the present disclosure are not necessarily references to the same embodiment; and such references represent at least one.

[0290] In the foregoing specification, the present disclosure has been described with reference to specific exemplary embodiments thereof. It will be apparent that various modifications may be made thereto without departing from the broader spirit and scope as set forth in the appended claims. Accordingly, the specification and drawings should be regarded in an illustrative rather than a restrictive sense.

Claims

1. A method comprising: receiving first data, the first data representing execution dependency conditions of instructions of a program; receiving second data representing a schedule of a first portion of the instructions of the program for execution in a device having a plurality of circuit units capable of operating in parallel; receiving third data identifying a next instruction selected from a second portion of the instructions of the program, the second portion scheduled for execution in the device; Applying the first data, the second data and the third data as input to a first artificial neural network; and A placement of the next instruction in one of the circuit cells is selected from a plurality of possible placements of the next instruction in the device using the first artificial neural network.

2. The method of claim 1, wherein the program is an assembly language program that identifies a data flow through memory locations represented by memory variables and identifies instructions configured to transform data in the data flow.

3. The method according to claim 2, wherein the device comprises a coarse-grained reconfigurable array having a plurality of tiles capable of operating in parallel as the plurality of circuit units, respectively; wherein each of the tiles has a plurality of instruction slots for pipeline execution; and The placement of the next instruction includes identification of a tile among the tiles and a slot among instruction slots in the tile for executing the next instruction.

4. The method of claim 3, wherein the first data identifies a dependency of execution of the first instruction upon receiving as input an output produced from execution of the second instruction; and Wherein the first data further identifies a dependency of a third instruction scheduled to execute in the respective tile when accessing data at a memory location represented by a memory variable implemented in the respective tile.

5. The method according to claim 4, further comprising: generating, using a second artificial neural network, a performance measure for selecting the placement of the next instruction from the plurality of possible placements; Generate a plurality of samples, each respective sample among the samples specifying: a corresponding input to the first artificial neural network, the corresponding input identifying: the corresponding timetable for the corresponding parts of the instructions of the procedure; and corresponding instructions to be scheduled in addition to the corresponding schedule; the corresponding placement of said corresponding instructions; and The corresponding performance metrics of the corresponding placements.

6. The method according to claim 5, further comprising: determining a cycle count to complete the respective portion of the instructions of the program and execution of the respective instructions based on the respective schedule and the respective placement; and The corresponding performance metric is calculated based on the cycle count.

7. The method according to claim 6, further comprising: Training the first artificial neural network and the second artificial neural network using the samples and a proximal policy optimization (PPO) technique of reinforcement learning to minimize a loss function; wherein the loss function is based on evaluating: a first loss representing a reduction in a performance measure resulting from the first artificial neural network selecting a placement that is different from a corresponding placement in the sample; and a second loss resulting from the second artificial neural network producing a performance measure that is different from a corresponding performance measure in the sample; and wherein the second loss is based on a mean squared error between a performance metric generated by the second artificial neural network in response to an input specified in the sample and a corresponding performance metric specified in the sample; and the first loss is based on a difference between a performance metric generated by the second artificial neural network and a corresponding performance metric in the sample, the difference being weighted by an exponential function of a logarithmic function of a probability ratio, the probability ratio being equal to the ratio between: a probability of a placement selected by the first artificial neural network in response to an input specified in the sample; and The probability of the corresponding placement specified in the sample.

8. The method according to claim 7, further comprising: testing placement options to search for a valid schedule for at least a portion of said instructions of said program; wherein the plurality of samples are generated from the tested placement options to search for the valid schedule; and Before the first artificial neural network and the second artificial neural network are trained using the proximal policy optimization (PPO) technique of the samples and the reinforcement learning, at least one of the tested placement options is selected by the first artificial neural network.

9. A computing device, comprising: Memory; and a microprocessor coupled to the memory and configured to: receiving first data representing execution dependency conditions of instructions of an assembly language program identifying a data flow through a memory location represented by a memory variable, the assembly language program further identifying instructions configured to transform data in the data flow; receiving second data representing a schedule of a first portion of the instructions of the program for execution in a coarse-grained reconfigurable array having a plurality of tiles capable of operating in parallel, each of the tiles having a plurality of instruction slots for pipelined execution; receiving third data identifying a next instruction selected from a second portion of the instructions of the program, the second portion scheduled for execution in the device; and A first artificial neural network that receives as input the first data, the second data, and the third data selects placement of the next instruction in one of the circuit units from a plurality of possible placements of the next instruction in the device, the placement of the next instruction comprising identification of a slot among instruction slots in a tile among the tiles for executing the next instruction.

10. The computing device of claim 9, wherein the first data identifies: a dependency of execution of the first instruction upon receiving as input an output produced from execution of the second instruction; and A dependency of a third instruction scheduled to execute in the respective tile in accessing data at a memory location represented by a memory variable implemented in the respective tile.

11. The computing device of claim 9, wherein the microprocessor is further configured to: Generate a plurality of samples, each respective sample among the samples specifying: a corresponding input to the first artificial neural network, the corresponding input identifying: the corresponding timetable for the corresponding parts of the instructions of the procedure; and corresponding instructions to be scheduled in addition to the corresponding schedule; the corresponding placement of said corresponding instructions; and a corresponding performance metric of the corresponding placement; and Training the first artificial neural network and the second artificial neural network using the samples and a proximal policy optimization (PPO) technique of reinforcement learning to minimize a loss function; The loss function is based on: a first loss representing a reduction in a performance measure resulting from the first artificial neural network selecting a placement different from a corresponding placement in the sample, and A second loss is caused by the second artificial neural network generating a performance measure that is different from a corresponding performance measure in the sample.

12. The computing device of claim 11, wherein the microprocessor is further configured to: testing placement options to search for a valid schedule for at least a portion of said instructions of said program; wherein the plurality of samples are generated from the tested placement options to search for the valid schedule; and Before the first artificial neural network and the second artificial neural network are trained using the proximal policy optimization (PPO) technique of the samples and the reinforcement learning, at least one of the tested placement options is selected by the first artificial neural network.

13. A non-transitory computer storage medium storing instructions that, when executed by a computing device, cause the computing device to perform a method comprising: receiving first data representing execution dependency conditions of instructions of an assembly language program identifying a data flow through a memory location represented by a memory variable, the assembly language program further identifying instructions configured to transform data in the data flow; receiving second data representing a schedule of a first portion of the instructions of the program for execution in a coarse-grained reconfigurable array having a plurality of tiles capable of operating in parallel, each of the tiles having a plurality of instruction slots for pipelined execution; receiving third data identifying a next instruction selected from a second portion of the instructions of the program, the second portion scheduled for execution in the device; Applying the first data, the second data and the third data as input to a first artificial neural network; and A placement of the next instruction in one of the circuit cells is selected from a plurality of possible placements of the next instruction in the device using the first artificial neural network.

14. The non-transitory computer storage medium of claim 13, wherein the first data identifies: a dependency of execution of the first instruction upon receiving as input an output produced from execution of the second instruction; and A dependency of a third instruction scheduled to execute in the respective tile in accessing data at a memory location represented by a memory variable implemented in the respective tile.

15. The non-transitory computer storage medium of claim 14, wherein the method further comprises: Generate a plurality of samples, each respective sample among the samples specifying: a corresponding input to the first artificial neural network, the corresponding input identifying: the corresponding timetable for the corresponding parts of the instructions of the procedure; and corresponding instructions to be scheduled in addition to the corresponding schedule; the corresponding placement of said corresponding instructions; and a corresponding performance metric of the corresponding placement; and Training the first artificial neural network and the second artificial neural network using the samples and a proximal policy optimization (PPO) technique of reinforcement learning to minimize a loss function; The loss function is based on: a first loss representing a reduction in a performance measure resulting from the first artificial neural network selecting a placement different from a corresponding placement in the sample, and A second loss is caused by the second artificial neural network generating a performance measure that is different from a corresponding performance measure in the sample.

Citation Information

Patent Citations

  • Mapping Workloads to Circuit Units in a Computing Device via Reinforcement Learning

    US20230306272A1