Compiler device, arithmetic processing device, instruction generation method, program, compilation method, and compiler program

JP2023063815A5Active Publication Date: 2024-10-02PREFERRED NETWORKS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2021173842
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2024-10-02
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

Existing compilers fail to efficiently generate instructions for processors specialized for deep learning, leading to suboptimal performance due to architectural differences between general-purpose GPUs and deep learning-specific processors.

Method used

A compiler device that groups and combines instructions to be executed by an arithmetic processing unit, optimizing instruction sequences for parallel execution on processors with hierarchical architectures, thereby reducing resource conflicts and improving processing performance.

Benefits of technology

The solution enables parallel execution of multiple instructions, shortening calculation time and enhancing the processing performance of deep learning tasks on specialized processors.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

To improve a processing performance of an arithmetic processing device by assembling instructions to be executed by the arithmetic processing unit.SOLUTION: A compiler device for generating an instruction sequence to be executed by an arithmetic processing device is configured to: receive a first instruction sequence for a first process and a second instruction sequence for a second process to be executed after the first process; generate third instructions by assembling a first instruction and a second instruction which can be executed in parallel, out of the first instructions being included in the first instruction sequence and the second instructions being included in the second instruction sequence; and generate a third instruction sequence by concatenating the third instructions, and first and second instructions excluding the first instruction and the second instruction assembled into the third instructions.SELECTED DRAWING: Figure 7
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a compiler device, an instruction generation method, a program, a compilation method, and a compiler program.

Background Art

[0002] Generally, deep learning is executed using a processor incorporating a large number of cores such as a GPU (Graphics Processing Unit). Recently, in order to improve the calculation speed in deep learning, a processor (accelerator) specialized for deep learning has been developed.

[0003] The architecture of a processor specialized for deep learning (the number of arithmetic units, the number of blocks including arithmetic units, the number of block hierarchies, instructions, etc.) may be different from the architecture of general-purpose products such as GPUs. Therefore, in order to efficiently operate a processor specialized for deep learning, a compiler device that appropriately generates instructions to be executed by the processor is important.

Summary of the Invention

Problems to be Solved by the Invention

[0004] In the present disclosure, by grouping instructions to be executed by an arithmetic processing unit, the processing performance of the arithmetic processing unit is improved.

Means for Solving the Problems

[0005] A compiler device according to an embodiment of the present invention is a compiler device that generates an instruction sequence to be executed by an arithmetic processing unit, and receives a first instruction sequence that executes a first process and a second instruction sequence that executes a second process to be executed after the first process, and among a plurality of first instructions included in the first instruction sequence and a plurality of second instructions included in the second instruction sequence, first instructions and second instructions that can be executed in parallel are grouped to generate a third instruction, and the third instruction and first instructions and second instructions excluding the first instructions and second instructions grouped into the third instruction are concatenated to generate a third instruction sequence. [Brief explanation of the drawing]

[0006] [Figure 1] This is a functional block diagram showing an example of a compiler device in one embodiment of the present invention. [Figure 2] A block diagram showing an example of a processing unit that executes a program generated by the compiler device shown in Figure 1. [Figure 3] Figure 2 is a block diagram showing an example of a system including a processor and host equipped with the arithmetic processing unit shown in Figure 2. [Figure 4] Figure 2 is an explanatory diagram showing an example of the operation of the arithmetic processing unit. [Figure 5] Figure 2 is an explanatory diagram illustrating another example of the operation of the arithmetic processing unit. [Figure 6] This is an explanatory diagram illustrating examples of processing by the instruction code generated by the compiler device, with and without the instruction merging section shown in Figure 1 being activated. [Figure 7] This is an explanatory diagram showing an example of merging instructions using the instruction merging unit in Figure 1. [Figure 8] This is an explanatory diagram illustrating an example of merging two instructions. [Figure 9] This is an explanatory diagram showing another example of merging two instructions. [Figure 10] This is an explanatory diagram illustrating an example where instructions cannot be merged due to data dependencies. [Figure 11] This is an explanatory diagram illustrating an example where instructions cannot be merged due to insufficient memory. [Figure 12] This is an explanatory diagram illustrating an example of merging two instructions in a compiler device of another embodiment. [Figure 13] Figure 1 is a block diagram showing an example of the hardware configuration of a compiler device. [Modes for carrying out the invention]

[0007] Embodiments of the present invention will be described in detail below with reference to the drawings.

[0008] Figure 1 is a functional block diagram showing an example of a compiler device in one embodiment of the present invention. For example, the compiler device 10 shown in Figure 1 is realized by a processor such as a CPU (Central Processing Unit) built into an information processing device (computer) such as a server executing a compiler program. The compiler device 10 then generates instruction codes to be executed by the arithmetic processing device 100 shown in Figure 2 by executing the compiler program. The compiler device 10 includes a computation graph generation unit 11, a first instruction code generation unit 12, an computation graph generation unit 13, a second instruction code generation unit 14, an instruction merging unit 15, and a finalization unit 16.

[0009] The computation graph generation unit 11 generates a computation graph based on a learning model (e.g., source code) generated using, for example, a general-purpose library (framework) for deep learning. A computation graph represents the dependencies between computations when a learning model is represented as a combination of computational processes commonly used in deep learning, such as convolution, batch normalization, and activation function operations (e.g., which computation's input is provided by which computation's output or the overall input of the model). The first instruction code generation unit 12 generates abstraction-level instruction code using the computation graph generated by the computation graph generation unit 11. Here, the abstraction-level instruction code may be written in, for example, a high-level language that cannot be executed by the processor installed in the computer.

[0010] The first instruction code generation unit 12 does not convert the computation graph based on the learning model into a single instruction code sequence including abstraction-level instruction codes, but rather determines the execution order of processing at the level of basic operations and generates an instruction code for each basic operation. Here, basic operations include, for example, processing of layers such as convolutional layers or pooling layers, processing of ReLU (Rectified Linear Unit) functions, or processing of data transfer.

[0011] The arithmetic graph generation unit 13 generates an arithmetic graph based on the instruction code generated by the first instruction code generation unit 12. An arithmetic graph represents the dependencies between operations when the computational processing of the computation graph is represented by combinations of operations that the arithmetic processing unit 100 can directly execute (for example, matrix multiplication operations, addition operations). The second instruction code generation unit 14 generates machine code level instruction codes based on the arithmetic graph generated by the arithmetic graph generation unit 13. For example, the second instruction code generation unit 14 generates an instruction code sequence containing multiple instruction codes for each layer of the deep neural network. When generating instruction codes, the second instruction code generation unit 14 may perform instruction scheduling to determine the execution order of the instruction codes and memory allocation to determine the allocation of memory areas used for executing the instruction codes.

[0012] The instruction merging unit 15 searches for instructions that can be executed multiple times among the multiple instruction code sequences generated by the second instruction code generation unit 14, and performs a merge process to merge the instructions that can be executed multiple times. The instruction merging unit 15 merges some of the instructions included in the multiple instruction code sequences generated by the second instruction code generation unit 14 to generate a single instruction code sequence at the machine code level.

[0013] The finalization unit 16 finalizes the instruction code sequence generated by the instruction merging unit 15 and outputs a machine code instruction code sequence that can be directly executed by the processor. The finalized instruction code sequence is, for example, a deep learning program that is executed by the processor. In the following description, instruction code is also referred to as an instruction, and instruction code sequence is also referred to as an instruction sequence.

[0014] Figure 2 is a block diagram showing an example of a processing unit that executes a program generated by the compiler device 10 in Figure 1. For example, the processing unit 100 shown in Figure 1 may function as an accelerator that performs deep learning. The processing unit 100 may be in the form of a chip or in the form of a package such as a CSP (Chip Size Package).

[0015] The arithmetic processing unit 100 has a plurality of hierarchical arithmetic units and a plurality of memories. For example, the arithmetic processing unit 100 has a predetermined number of second-level blocks BLK2. Each second-level block BLK2 has a plurality of first-level blocks BLK1 and a memory MEM2 shared by the plurality of first-level blocks BLK1. Each first-level block BLK1 has a plurality of arithmetic units OPU and a memory MEM1 shared by the plurality of arithmetic units OPU. Each of the thus-hierarchical arithmetic unit OPU, first-level block BLK1, and second-level block BLK2 is an example of a processing unit that executes processing based on issued instructions. The arithmetic processing unit 100 can efficiently execute data transfer between hierarchical blocks by executing various data transfer instructions.

[0016] In the example shown in FIG. 2, the arithmetic processing unit 100 has four second-level blocks BLK2. Each second-level block BLK2 has eight first-level blocks BLK1. The first-level block BLK1 has sixteen arithmetic units OPU. However, the number of second-level blocks BLK2 in the arithmetic processing unit 100, the number of first-level blocks BLK1 mounted in each second-level block BLK2, and the number of arithmetic units OPU mounted in each first-level block BLK1 are not limited to FIG. 1. However, the number of second-level blocks BLK2 mounted in the arithmetic processing unit 100, the number of first-level blocks BLK1 mounted in each second-level block BLK2, and the number of arithmetic units OPU mounted in each first-level block BLK1 are each preferably a power of 2 (n is an integer of 1 or more).

[0017] The arithmetic unit OPU has memory MEM0 as the 0th layer memory. The first layer block BLK1 has memory MEM1 as the 1st layer memory, and the second layer block BLK2 has memory MEM2 as the 2nd layer memory. The types of memory MEM1 and MEM2 are not particularly limited and may be appropriately selected according to the performance required of the arithmetic processing unit 100. For example, in this embodiment, a first data transfer instruction is provided to transfer data between memory MEM0 and memory MEM1 within the arithmetic unit OPU, and a second data transfer instruction is provided to transfer data between memory MEM1 and memory MEM2. That is, data transfer instructions are provided between two adjacent layers of memory MEM2. In addition, a third data transfer instruction is provided to transfer data between memory MEM2 and memory MEM3 (a memory outside the arithmetic processing unit 100), which is shown in Figure 3 as the 3rd layer memory. That is, a data transfer instruction is provided between the arithmetic processing unit 100 and memory MEM3 outside the arithmetic processing unit 100. In this way, the arithmetic processing unit 100 can execute data transfer instructions for each of two adjacent memory layers.

[0018] For example, the arithmetic processing unit 100, upon execution of a first data transfer instruction, transfers data between memory MEM0 and memory MEM1 in each of the first-level blocks BLK1 within the arithmetic processing unit 100. The arithmetic processing unit 100, upon execution of a second data transfer instruction, transfers data between memory MEM1 and MEM2 in each of the second-level blocks BLK2 within the arithmetic processing unit 100. The arithmetic processing unit 100, upon execution of a third data transfer instruction, transfers data between memory MEM2 and memory MEM3 (Figure 3) in each of the second-level blocks BLK2 within the arithmetic processing unit 100.

[0019] Each data transfer instruction is a SIMD (Single Instruction Multiple Data) instruction that performs multiple data transfers with a single instruction. Furthermore, to prevent the loss of data that should not be overwritten, the arithmetic processing unit 100 may have a function to mask data transfers between certain elements.

[0020] Each arithmetic unit OPU has an arithmetic unit EX (FIG. 3) that executes various arithmetic operations. The arithmetic unit EX may include, for example, a plurality of arithmetic elements that perform different types of arithmetic operations (e.g., matrix multiplication operations and addition operations) respectively.

[0021] The various arithmetic operation instructions executed by the arithmetic processing unit 100 are SIMD instructions that execute a plurality of arithmetic operations by one instruction. And in this embodiment, the arithmetic processing unit 100 can cause all the arithmetic units EX in the arithmetic processing unit 100 to execute arithmetic operations in parallel (including simultaneously) based on one arithmetic operation instruction.

[0022] Here, the degree of parallelism of SIMD operations executed by a normal SIMD processor depends on the number of registers assigned to the SIMD register. On the other hand, the degree of parallelism of SIMD operations by the arithmetic processing unit 100 depends on the number of arithmetic units EX in the arithmetic processing unit 100. Therefore, the arithmetic processing unit 100 can operate as a huge SIMD processor.

[0023] Different-level data transfer instructions and arithmetic operation instructions can be executed in parallel when resources do not conflict. For this reason, the compiler device 10 in FIG. 1 can generate an instruction group including a plurality of instructions whose resources do not conflict. The instruction group generated by the compiler device 10 will be described in FIGS. 6 to 11.

[0024] FIG. 3 is a block diagram showing an example of a system including a processor and a host on which the arithmetic processing unit 100 in FIG. 2 is mounted. The processor 200 shown in FIG. 3 has a plurality of arithmetic processing units 100 and a memory MEM3 connected to each other. For example, the processor 200 may have the form of an electronic circuit board on which a plurality of arithmetic processing units 100 and a memory MEM3 are mounted. The plurality of arithmetic processing units 100 may be mounted on a multi-chip package. The type of the memory MEM3 is not particularly limited, and may be appropriately selected according to the performance required for the arithmetic processing unit 100.

[0025] In Figure 3, the processor 200 has four arithmetic processing units 100, but the number of arithmetic processing units 100 is not limited to four; it can be one or more. Memory MEM3 may be provided corresponding to each arithmetic processing unit 100. A processor 200 having multiple arithmetic processing units 100 operates as a single arithmetic processing unit.

[0026] In each arithmetic processing unit 100, the memory MEM2 of each second-level block BLK2 is connected to the memory MEM3 and the memory MEM1 of each first-level block BLK1 within the second-level block BLK2, enabling data transfer between them.

[0027] Each first-level block BLK1 has a memory MEM1 connected to a memory MEM0 in each arithmetic unit OPU within the first-level block BLK1, allowing data to be transferred between them. Data transfer instructions and arithmetic instructions may be transferred from each memory MEM1 to memory MEM0. The arithmetic unit EX in the arithmetic unit OPU performs various calculations using the memory MEM0 within that arithmetic unit OPU.

[0028] The host memory HOSTM and memory MEM3 may transmit and receive data and instruction information via, for example, a PCIe (Peripheral Component Interconnect express) interface. Alternatively, the transfer of information between the host memory HOSTM and memory MEM3 may be performed using DMA (Direct Memory Access).

[0029] Each arithmetic processing unit 100 executes arithmetic processing based on arithmetic instructions received from the host 300, and executes data transfer processing based on data transfer instructions received from the host 300. The program, which includes various instruction codes sent from the host 300 to the arithmetic processing unit 100, is generated by the compiler device 10 in Figure 1 and stored in the host memory HOSTM within the host 300.

[0030] Figures 4 and 5 are explanatory diagrams illustrating an example of the operation of the arithmetic processing unit 100 shown in Figure 2. The operation shown in Figures 4 and 5 is achieved by the arithmetic processing unit 100 executing multiple data transfer instructions and arithmetic instructions in parallel. In Figures 4 and 5, elements shown in bold indicate resources used for data transfer or arithmetic execution. The arrows connecting the elements shown in bold indicate the direction of data transfer.

[0031] The number of cycles required for data transfer between memory MEM2 and memory MEM3 is greater than the number of cycles required for data transfer between memory MEM1 and memory MEM2, and the number of cycles required for data transfer between memory MEM1 and memory MEM0 in the arithmetic unit OPU. Also, the execution cycles for various calculations by the arithmetic unit EX may differ. However, in the following explanation, if at least some of the execution cycles for data transfer processing and calculation processing overlap, the processing will be assumed to be executed in parallel (including simultaneously).

[0032] In Figure 4(A), the arithmetic unit EX executes arithmetic instructions that perform calculations in parallel using data held in multiple memories MEM0. The arithmetic processing unit 100 also executes data transfer instructions to transfer data from memory MEM3 to memory MEM2 in parallel with the arithmetic instructions.

[0033] In Figure 4(A), arithmetic instructions and data transfer instructions that use different resources can be executed in parallel. As shown in Figure 4(A), if the compiler unit 10 determines that there is no resource conflict, it generates a single set of instructions that can execute arithmetic instructions and data transfer instructions in parallel.

[0034] In Figure 4(B), the arithmetic unit EX executes arithmetic instructions that perform calculations in parallel using data held in multiple memory locations MEM0. The arithmetic processing unit 100 also executes data transfer instructions in parallel with the arithmetic instructions, transferring (writing) data from memory MEM1 to each of the memory locations MEM0 within the arithmetic unit OPU, which includes the arithmetic unit EX that performs the calculations. Here, it is assumed that the units (resources) involved in the above calculations and data transfers in each memory location MEM0 do not conflict with each other.

[0035] In Figure 4(B), the units involved in calculations and the units involved in data transfer do not conflict, so calculation instructions and data transfer instructions can be executed in parallel. On the other hand, if the units involved in calculations and the units involved in data transfer conflict, the calculation instructions and data transfer instructions cannot be executed in parallel and are executed sequentially.

[0036] As shown in Figure 4(B), the compiler unit 10 generates a single instruction set that can execute arithmetic instructions and data transfer instructions in parallel if it determines that there is no resource conflict. On the other hand, if the compiler unit 10 determines that there is a resource conflict, it generates two instruction sets that execute arithmetic instructions and data transfer instructions sequentially.

[0037] In Figure 4(C), the arithmetic unit EX executes arithmetic instructions that perform calculations in parallel using data held in multiple memory locations MEM0. The arithmetic processing unit 100 also executes data transfer instructions in parallel with the arithmetic instructions, transferring data in parallel from memory MEM0 to different areas in memory MEM1 within the arithmetic unit OPU, which includes the arithmetic unit EX that performs the calculations. Here, it is assumed that the units (resources) involved in the above calculations and data transfers in each memory location MEM0 do not conflict with each other. Furthermore, the arithmetic processing unit 100 executes data transfer instructions in parallel with the arithmetic instructions, transferring data from memory MEM2 to memory MEM3.

[0038] In Figure 4(C), since the resources used for calculations in the arithmetic unit EX and the two data transfers do not conflict, the compiler unit 10 generates a single instruction set that can execute one arithmetic instruction and two data transfer instructions in parallel. On the other hand, if the resources involved in calculations and the resources involved in data transfer to memory MEM1 conflict, the compiler unit 10 generates a single arithmetic instruction and a single instruction set that can execute two data transfer instructions in parallel.

[0039] In Figure 5(D), the arithmetic processing unit 100 executes a data transfer instruction to transfer data from multiple memories MEM0 within the arithmetic unit OPU to memory MEM1. The arithmetic processing unit 100 also executes a data transfer instruction to transfer data from memory MEM2 to memory MEM3 in parallel with the data transfer instruction from memory MEM0 to memory MEM1.

[0040] In Figure 5(D), the two data transfers do not conflict and can therefore be executed in parallel. For this reason, the compiler device 10 generates a single instruction set that allows the two data transfer instructions to be executed in parallel. Whether or not the two data transfers conflict depends on the architecture of the arithmetic processing unit 100, and the compiler device 10 may determine whether or not the two data transfers conflict by taking this architecture into consideration. In this embodiment, the compiler device 10 determines that the data transfers conflict if the data destinations of multiple data transfer instructions are the same.

[0041] In Figure 5(E), the first and second arithmetic elements of the arithmetic unit EX execute arithmetic instructions that perform the first and second operations in parallel using data held in multiple memory MEM0s. Here, it is assumed that the units (resources) involved in the first and second operations in each memory MEM0 and the arithmetic unit EX do not conflict with each other.

[0042] In Figure 5(E), the resources involved in the first and second operations do not conflict. Therefore, the compiler unit 10 generates a single instruction set that allows the first and second operations in the first and second operation elements to be executed in parallel. The compiler unit 10 can also include data transfers between memory MEM1 and memory MEM2, or between memory MEM2 and memory MEM3, in the instruction set. In Figure 5(E), if the compiler unit 10 determines that memory MEM0 is in conflict, it does not generate an instruction set, but instead sequentially generates two operation instructions that execute the first and second operations in the first and second operation elements, respectively.

[0043] In Figure 5(F), the arithmetic unit EX executes an arithmetic instruction that performs calculations using the data held in memory MEM0. The arithmetic processing unit 100 also executes a data transfer instruction in parallel with the arithmetic instruction, within the arithmetic unit EX that performs the calculations, to transfer data from memory MEM1 to memory MEM0. Here, it is assumed that the units (resources) involved in the above calculations and data transfers in each memory MEM0 do not conflict with each other. Furthermore, the arithmetic processing unit 100 executes a data transfer instruction in parallel with the above arithmetic instruction and data transfer instruction to transfer data from memory MEM3 to memory MEM2.

[0044] In Figure 5(F), since the resources used for the calculation by the arithmetic unit EX and the two data transfers do not conflict, the compiler unit 10 generates a single instruction set that can execute one arithmetic instruction and two data transfer instructions in parallel. The method for generating an instruction set when the compiler unit 10 determines a resource conflict is the same as described in Figure 4(C).

[0045] Figures 6 to 11 below illustrate an example of the instruction merging process performed by the instruction merging unit 15. For example, the processes shown in Figures 6 to 11 show an example of processing by a compiler program executed by the compiler device 10 and an example of processing by a compilation method executed by the compiler device 10. The method by which the compiler device 10 generates instructions using the processes shown in Figures 6 to 11 is an example of an instruction generation method.

[0046] Figure 6 is an explanatory diagram showing examples of processing by the instruction code generated by the compiler device 10, with and without the instruction merge unit 15 in Figure 1 being activated. The method by which the compiler device 10 generates instruction code by activating the instruction merge unit 15 is one example of an instruction generation method. Download DL (DL1, DL2), upload UL, convolution operation Conv (Conv1, Conv2, Conv3), batch normalization BN, and ReLU functions are examples of basic operations. The rectangles showing the frequency of arithmetic instructions and data transfer instructions indicate that the darker the shaded color, the higher the frequency of instruction execution.

[0047] In the example shown in Figure 6, the arithmetic processing unit 100 downloads data DL1 from memory MEM3 to memory MEM0 and performs a convolution operation Conv1 using the downloaded data (Figures 6(a) and (b)). The DL1 download operation is performed using data transfer instructions. The Conv1 convolution operation is performed mainly using arithmetic instructions.

[0048] Next, the arithmetic processing unit 100 uploads, for example, the data obtained by the convolution operation Conv1 from memory MEM0 to memory MEM3 (Figure 6(c)). The upload UL process is performed using a data transfer instruction.

[0049] Furthermore, the arithmetic processing unit 100 sequentially performs batch normalization BN processing and ReLU function processing on the data obtained by the convolution operation Conv1 (Figures 6(d), (e)). The batch normalization BN processing and ReLU function processing are mainly performed using arithmetic instructions. Next, the arithmetic processing unit 100 performs convolution operation Conv2 (Figure 6(f)).

[0050] Furthermore, the arithmetic processing unit 100 downloads data from memory MEM3 to memory MEM0 (Figure 6(g)). Then, the arithmetic processing unit 100 uses the downloaded data to perform a convolution operation Conv3 (Figure 6(h)). In this way, when the instruction merging unit 15 is not operated, the arithmetic processing unit 100 sequentially executes the processing of the deep neural network.

[0051] On the other hand, when the instruction merging unit 15 is activated, it generates a single instruction set containing multiple instructions that do not conflict with each other's resources, thereby enabling the parallel execution of multiple basic operations. This, for example, can reduce the computation time required to train a deep neural network and improve the processing performance of the arithmetic processing unit 100.

[0052] For example, the upload UL1 process is an example of the first process, and the batch normalization BN process and the ReLU function process are examples of the second process executed after the first process. In this case, the instruction sequence containing the instruction to execute the upload UL1 process is an example of the first instruction sequence containing the first instruction. The instruction sequence containing the instruction to execute the batch normalization BN process and the instruction to execute the ReLU function process are examples of the second instruction sequence containing the second instruction.

[0053] Furthermore, the processing of the ReLU function and the Conv2 convolution operation are examples of the first type of processing, and the DL2 download operation is an example of the second type of processing. In this case, the instruction sequence containing the instructions to perform the ReLU function and the Conv2 convolution operation is an example of the first instruction sequence containing the first instruction. The instruction sequence containing the instructions to perform the DL2 download operation is an example of the second instruction sequence containing the second instruction.

[0054] For example, the instruction merging unit 15 combines at least one instruction group from among the arithmetic instructions used in the processing of batch normalization BN and ReLU functions and the data transfer instructions used in the processing of upload UL, where the resources do not conflict (Figure 6(i)). In addition, the instruction merging unit 15 combines at least one instruction group from among the arithmetic instructions used in the processing of the ReLU function and convolution operation Conv2 and the data transfer instructions used in the processing of download DL2, where the resources do not conflict (Figure 6(j)).

[0055] A group of instructions that combines multiple instructions is an example of a third instruction. The instruction merging unit 15 combines the group of instructions with the instructions excluding those grouped together to generate the instruction sequence (third instruction sequence) shown by the dashed box in Figure 6. By combining instructions, for example, the execution frequency of data transfer instructions can be increased, thereby improving data transfer efficiency. As a result, the processing performance of the arithmetic processing unit 100 can be improved.

[0056] The resource that conflicts between arithmetic instructions and data transfer instructions is memory MEM0. Therefore, the instruction merging unit 15 can generate a set of instructions by combining arithmetic instructions and data transfer instructions if there is no conflict in the memory MEM0 resources. Resource conflicts between arithmetic instructions and data transfer instructions occur less frequently than resource conflicts between arithmetic instructions themselves. Therefore, by combining arithmetic instructions and data transfer instructions, the efficiency of instruction compression can be improved compared to combining arithmetic instructions alone, and the processing performance of the arithmetic processing unit 100 can be improved.

[0057] Furthermore, the instruction merging unit 15 does not merge instructions if doing so would change the processing result of a basic operation. In other words, the instruction merging unit 15 determines whether the processing result of the merged instruction sequence is equivalent to the processing result of the instruction sequence before merging. If the processing results are equivalent, the instruction merging unit 15 merges the instructions to generate a set of instructions. This prevents malfunctions in the arithmetic processing unit 100 that execute the merged instruction sequence.

[0058] For example, changes in the processing results of basic operations can occur when data dependencies break down or when the available memory size is insufficient. An example of data dependency breakdown is illustrated in Figure 10, and an example of insufficient memory size is illustrated in Figure 11.

[0059] Figure 7 is an explanatory diagram illustrating an example of merging instructions using the instruction merging unit 15 in Figure 1. For example, uppercase letters indicate instruction sequence IS1, which includes instructions IS used in the batch normalization BN processing in Figure 6. Lowercase letters indicate instruction sequence IS2, which includes instructions IS used in the upload UL processing in Figure 6. Instruction sequence IS1 is an example of a first instruction sequence, and the instructions IS included in instruction sequence IS1 are examples of first instructions. Instruction sequence IS2 is an example of a second instruction sequence, and the instructions IS included in instruction sequence IS2 are examples of second instructions.

[0060] A single instruction IS includes multiple different instructions for each of multiple processing units capable of executing different types of processing in parallel, as will be described later with reference to Figures 8 and 9. That is, a single instruction IS includes instructions for a first processing unit, instructions for a second processing unit, ... instructions for the nth processing unit. Instructions provided to processing units may include NOPs (No Operation). Multiple processing units execute different types of processing (including NOPs) in parallel according to multiple different instructions provided simultaneously.

[0061] The instruction merging unit 15 extracts instructions IS that can be superimposed from the instructions IS included in instruction sequences IS1 and IS2, respectively, and generates an instruction group IGr by merging the extracted instructions IS. The instruction group IGr is an example of a third instruction. The instruction merging unit 15 then generates an instruction sequence IS3 that includes the instruction group IGr formed by merging the instructions IS and individual instructions IS that are not merged. The instruction sequence IS3 is an example of a third instruction sequence. For example, the instructions IS and instruction group IGr included in instruction sequences IS1, IS2, and IS3 are described at the machine code level.

[0062] As shown in Figure 7, the number of instructions IS that can be merged in the two instruction sequences IS1 and IS2 is limited. However, by merging several instructions IS into an instruction group IGr and making them executable in parallel, the instruction execution speed can be increased compared to executing instructions IS sequentially, as shown in Figure 6.

[0063] The brackets in Figure 7 indicate the state of the merge process in progress. The parts of instruction sequences IS1, IS2, and IS3 before the thick lines indicate that the merge process for the mergeable instruction IS has been completed, while the parts after the thick lines indicate that the merge process has not yet been completed. Instructions G and e, indicated by dashed boxes, indicate the next instruction IS to be merged.

[0064] As shown by the bold lines, the instruction merging unit 15 recognizes how far the merging process of instruction sequences IS1 and IS2 has been performed, determines whether the next instruction (for example, G, e) can be merged, and if it can be merged, repeats the process of generating the instruction group IGr.

[0065] Figures 8 and 9 are explanatory diagrams illustrating an example of merging two instructions. For example, instruction 1 corresponds to instruction IS in instruction sequence IS1 in Figure 7, and instruction 2 corresponds to instruction IS in instruction sequence IS2 in Figure 7. Instruction 1+2 represents the instruction group obtained by merging instruction 1 and instruction 2. In instruction 1 and instruction 2, the sign - indicates that there is no instruction to be executed (NOP). That is, each of instruction 1, instruction 2, and instruction 1+2 (the merged instruction 1 and instruction 2) contains multiple different instructions for multiple processing units, each capable of executing different types of processing in parallel, similar to the instruction IS in Figure 7. Figures 8(A)-8(C) and 9(D)-9(F) correspond to the operations in Figures 4(A)-4(C) and 5(D)-5(F), respectively.

[0066] In Figure 8(A), the instruction merging unit 15 determines that merging is possible because there is no conflict in the resources used by instruction 1, which includes an arithmetic instruction that executes a first operation by the arithmetic unit EX, and instruction 2, which includes a data transfer instruction that transfers data from memory MEM3 to memory MEM2. Therefore, the instruction merging unit 15 generates instruction 1+2, which is a merge of the arithmetic instruction and the data transfer instruction.

[0067] In Figure 8(B), the instruction merging unit 15 determines that the resources used for instruction 1, which includes an arithmetic instruction to perform a first operation, and instruction 2, which includes a data transfer instruction to transfer data from memory MEM1 to processor element PE, do not conflict under certain conditions. The condition for no resource conflict is, for example, that in each memory MEM0, the unit to which the result of the arithmetic instruction is written and the unit to which the data is transferred are different. If the condition is satisfied, the instruction merging unit 15 generates instruction 1+2 by merging the arithmetic instruction and the data transfer instruction.

[0068] In Figure 8(C), the instruction merging unit 15 determines that the resources used for instruction 1, which includes an arithmetic instruction to perform a first operation, instruction 2, which includes a data transfer instruction to transfer data from memory MEM0 to memory MEM1, and the resources used for the data transfer instruction to transfer data from memory MEM2 to memory MEM3 do not conflict under certain conditions. The condition for resources not to conflict is that, in each memory MEM0, the unit used for the arithmetic instruction and the unit used for data transfer are different.

[0069] If the conditions are met, the instruction merging unit 15 generates instruction 1+2 by merging the arithmetic instruction and the two data transfer instructions. If the conditions are not met, the instruction merging unit 15 does not merge the single arithmetic instruction and the two data transfer instructions, and as a result, instruction 1 and instruction 2 are maintained as separate instructions. However, instruction 1 may be merged with other instructions, and instruction 2 may be merged with other instructions.

[0070] In Figure 9(D), the instruction merging unit 15 determines that the instructions can be merged because the resources used by instruction 1, which includes a data transfer instruction to transfer data from memory MEM0 to memory MEM1, and instruction 2, which includes a data transfer instruction to transfer data from memory MEM2 to memory MEM3, do not conflict. Therefore, the instruction merging unit 15 generates instruction 1+2, which is a merge of the two data transfer instructions. The data transfer instruction to transfer data from memory MEM0 to memory MEM1 is an example of the first data transfer instruction, and the data transfer instruction to transfer data from memory MEM2 to memory MEM3 is also an example of the first data transfer instruction.

[0071] In this embodiment, data transfer instructions are provided for each different memory hierarchy. Therefore, as shown in Figure 9(D), the instruction merging unit 15 can determine that there are no conflicts for data transfer instructions that do not overlap in memory hierarchy. As a result, the compiler unit 10 can efficiently perform the instruction generation process.

[0072] In Figure 9(E), the instruction merging unit 15 determines that the resources used by instruction 1, which includes a first arithmetic instruction that causes the arithmetic unit EX to perform a first arithmetic operation, and instruction 2, which includes a second arithmetic instruction that causes the arithmetic unit EX to perform a second arithmetic operation, do not conflict under certain conditions. The conditions for no resource conflict are that the arithmetic elements that perform the operations are different from each other, and the units in memory MEM0 used by the first and second operations are different from each other. If the conditions are met, the instruction merging unit 15 generates instruction 1+2 by merging the first arithmetic instruction and the second arithmetic instruction.

[0073] In Figure 9(F), the instruction merging unit 15 determines that the resources used for instruction 1, which includes an arithmetic instruction that causes the arithmetic unit EX to perform a first arithmetic operation, and instruction 2, which includes a data transfer instruction that transfers data from memory MEM1 to memory MEM0 and a data transfer instruction that transfers data from memory MEM3 to memory MEM2, do not conflict under certain conditions. The condition for no resource conflict is that, in each memory MEM0, the unit used for the arithmetic instruction and the unit used for data transfer are different.

[0074] If the conditions are met, the instruction merging unit 15 generates instruction 1+2 by merging the arithmetic instruction and the two data transfer instructions. If the conditions are not met, the instruction merging unit 15 does not merge the single arithmetic instruction and the two data transfer instructions, and as a result, instruction 1 and instruction 2 are maintained as separate instructions.

[0075] Figure 10 is an explanatory diagram illustrating an example where instructions cannot be merged due to data dependencies. In Figure 10, it is assumed that Layer A, which writes the value x to memory MEM0, and Layer B, which reads the value x written to memory MEM0 by Layer A, are executed sequentially.

[0076] The instruction merging unit 15 determines whether there is a dependency between the data read from and written to memory MEM0 when merging the instruction sequence of layer A and the instruction sequence of layer B. In the example in Figure 10, there is a dependency between the data read from and written to memory MEM0. When merging the instruction sequence of layer A and the instruction sequence of layer B, the process of reading the value x from memory MEM0 is executed before the value x is written to memory MEM0. For this reason, the instruction merging unit 15 determines that merging the instruction sequences would result in incorrect processing and does not perform the instruction sequence merging.

[0077] Thus, the instruction merging unit 15 temporarily restricts the merging of instruction sequences if there is a data dependency on the memory MEM0, etc., which is used in common by layers A and B that are the targets of instruction merging, and if the reading and writing of the merged data is not executed in the correct order. That is, as can be understood from the explanation in Figure 7, for read and write instructions to the same memory MEM0, the instruction merging unit 15 waits for the merging process of the read instructions in the instruction sequence of layer B until the merging process of the write instructions in the instruction sequence of layer A is completed. This prevents malfunctions in which the arithmetic processing unit 100 does not operate normally due to a breakdown in data dependencies. Alternatively, instead of temporarily restricting the merging of instruction sequences, it is also possible to abandon the merging of instruction sequences between the layers in question and not merge instruction sequences between the layers at all.

[0078] Figure 11 is an explanatory diagram illustrating an example where instructions cannot be merged due to insufficient memory. Note that the memory capacity values ​​described below are illustrative. For example, suppose that the instruction sequences of Layer A and Layer B use a common memory with a storage capacity of 800 to perform calculations (calculations 1-1, 1-2, 2-1, 2-2). Note that the memory used for calculations may be distributed across multiple locations among memory MEM0, MEM1, and MEM2.

[0079] The memory capacity required for calculations 1-1 and 2-1 is 300 each, and the memory capacity required for calculations 1-2 and 2-2 is 400 each. After executing calculation 1-2, layer A releases the 700 memory capacity allocated by calculations 1-1 and 1-2. After executing calculation 2-2, layer B releases the 700 memory capacity allocated by calculations 2-1 and 2-2. If merging is not performed in this way, a memory shortage will not occur.

[0080] The instruction merging unit 15 determines whether the calculation processes of Layer A and Layer B can be executed without the amount of memory used exceeding the memory's storage capacity when merging the instruction sequences of Layer A and Layer B. In the example shown in Figure 11, when the instruction sequences are merged, after executing calculations 1-1 and 2-1, the required memory capacity of 400 for calculations 1-2 and 2-2 respectively cannot be secured, and the calculation process fails.

[0081] The instruction merging unit 15 suppresses instruction merging if it would result in insufficient memory capacity. This prevents malfunctions in which the arithmetic processing unit 100 fails to operate normally due to insufficient memory capacity.

[0082] In this embodiment, the instruction merging unit 15 enables the parallel execution of multiple basic operations by generating a single instruction set containing multiple instructions that do not conflict with each other's resources. This, for example, can reduce the computation time required to train a deep neural network and improve the processing performance of the arithmetic processing unit 100.

[0083] The instruction merging unit 15 determines whether the processing result of the instruction sequence after merging the instruction of interest is equivalent to the processing result of the instruction sequence before merging. If the processing results are equivalent, the instruction merging unit 15 merges the instructions to generate a new instruction sequence. This prevents malfunctions in the arithmetic processing unit 100 that execute the merged instruction sequence.

[0084] The instruction merging unit 15 temporarily restricts the merging of instruction sequences if there are data dependencies in memory MEM0, etc., which are commonly used by layers A and B that are the target of instruction merging, and the order of reading and writing data after merging is incorrect. This prevents malfunctions in which the arithmetic processing unit 100 may not operate normally due to a breakdown in data dependencies.

[0085] The instruction merging unit 15 suppresses instruction merging if it would result in insufficient memory capacity. This prevents malfunctions in which the arithmetic processing unit 100 fails to operate normally due to insufficient memory capacity.

[0086] As explained in Figure 6, by combining arithmetic instructions and data transfer instructions into a single instruction, the efficiency of instruction compression can be improved compared to combining arithmetic instructions, thereby improving the processing performance of the arithmetic processing unit 100. Data transfer instructions are provided for each different memory hierarchy. Therefore, as shown in Figure 9(D), the instruction merging unit 15 can determine that there are no conflicts for data transfer instructions that do not overlap in memory hierarchy. As a result, the instruction merging unit 15 can easily determine conflicts between data transfer instructions in different memory hierarchy, and the compiler unit 10 can efficiently execute the instruction generation process.

[0087] Figure 12 is an explanatory diagram illustrating an example of merging two instructions in a compiler device of another embodiment. Figure 12 shows an example of an instruction generation method by the compiler device. The compiler device of this embodiment has the same functions as the second instruction code generation unit 14, instruction merging unit 15, and finalization unit 16 of the compiler device 10 in Figure 1. That is, the compiler device of this embodiment has the function of generating a new instruction by merging the instructions included in the first instruction sequence and the instructions included in the second instruction sequence.

[0088] In this embodiment as well, each of the instructions included in the first instruction sequence, the instructions included in the second instruction sequence, and the new instruction generated by merging these two instructions each include multiple different instructions for each of multiple processing units capable of executing different types of processing in parallel. That is, the instructions included in the instruction sequences and the new instruction generated by merging include instructions for the first processing unit, instructions for the second processing unit, ... instructions for the Nth processing unit. Instructions provided to processing units may include NOPs (No Operation). Multiple processing units execute different types of processing (including NOPs) in parallel according to multiple different instructions provided simultaneously.

[0089] For example, the arithmetic processing unit that executes instructions 1 and 2 shown in Figure 12 is a VLIW (Very Long Instruction Word) processor and has multiple processing units capable of executing different types of processing, such as an ALU (Arithmetic and Logic Unit) and two FPUs (Floating Point Units) 0 and FPU1. In Figure 12, for the sake of clarity, instructions 1 include two instructions for the ALU and FPU0 and a NOP instruction for FPU1, and instructions 2 include a NOP instruction for the ALU and FPU0 and one instruction for FPU1. However, each of instructions 1 and 2 may contain four or more instructions.

[0090] The instruction merging unit 15 determines whether there is a resource conflict between instruction 1, which includes an integer addition instruction (c<-a+b) and a floating-point addition instruction (f<-d+.e), and instruction 2, which includes a floating-point multiplication instruction (z<-x*.y). The instruction merging unit 15 determines that there is no resource conflict between instruction 1 and instruction 2, and therefore it is possible to merge instruction 1 and instruction 2, and generates the instruction set (instruction 1+2).

[0091] This integer addition instruction adds the data held in integer registers a and b and stores the result in integer register c. The floating-point addition instruction adds the data held in floating-point registers d and e and stores the result in floating-point register f. The addition sign "+." indicates floating-point addition. The floating-point multiplication instruction multiplies the data held in floating-point registers x and y and stores the result in floating-point register z. The multiplication sign "*." indicates floating-point multiplication.

[0092] As described above, the same effects as those of the embodiments described can be obtained in this embodiment as well. For example, in this embodiment, instruction 1 and instruction 2, which include at least one instruction executed by the VLIW processor, are merged to generate an instruction set. This improves the execution efficiency of the VLIW processor and reduces computation time compared to when instruction 1 and instruction 2 are not merged.

[0093] In the embodiments described above, the process of merging (combining) the first instruction in the first instruction sequence and the second instruction in the second instruction sequence into a single instruction was explained. However, the process of combining the first instruction in the first instruction sequence and the second instruction in the second instruction sequence is also applicable to instruction sequences supplied to a superscalar processor. A superscalar processor can automatically detect two instructions in an instruction sequence that are consecutive and can be executed in parallel, and execute them in parallel. For such a superscalar processor, the compiler unit 10 may perform the process of combining multiple instructions as follows: If the compiler unit 10 expects the processor to automatically execute the first instruction in the first instruction sequence and the second instruction in the second instruction sequence in parallel by arranging them consecutively in a single instruction sequence, the compiler unit 10 generates an instruction in which the first instruction and the second instruction are merged (combined) in such a way that they are arranged consecutively. In this case, the first and second instructions, which are placed one after the other, correspond to the third instruction. This process is expected to result in an instruction sequence that the processor can execute with a higher degree of parallelism.

[0094] In the embodiments described above, part or all of the compiler device 10 or host 300 may be composed of hardware, or it may be composed of information processing of software (programs) executed by a CPU or GPU, etc. If it is composed of information processing of software, the software that realizes at least some of the functions of each device in the embodiments described above may be stored on a non-temporary storage medium (non-temporary computer-readable medium) such as a CD-ROM (Compact Disc-Read Only Memory) or USB (Universal Serial Bus) memory, and the information processing of the software may be executed by loading it into a computer. Alternatively, the software may be downloaded via a communication network. Furthermore, all or part of the processing of the software may be implemented in a circuit such as an ASIC (Application Specific Integrated Circuit) or FPGA (Field Programmable Gate Array), so that the information processing by the software is executed by hardware.

[0095] The storage medium for the software may be a removable medium such as an optical disc, or a fixed storage medium such as a hard disk or memory. Furthermore, the storage medium may be located inside the computer (main memory, auxiliary storage, etc.) or outside the computer.

[0096] Figure 13 is a block diagram showing an example of the hardware configuration of the compiler device 10 shown in Figure 1. The hardware configuration of the host 300 shown in Figure 3 is the same as the hardware configuration of the compiler device 10 shown in Figure 13. The compiler device 10 may be implemented as a computer comprising, for example, a processor 20, main memory 30 (memory), auxiliary memory 40 (memory), a network interface 50, and a device interface 60, all connected via a bus 70. For example, the processor 20 executes a compiler program, thereby performing the operations described in Figures 6 to 12.

[0097] The compiler device 10 has one of each component, but it may have multiple identical components. Also, although Figure 13 shows one compiler device 10, the software may be installed on multiple compiler devices 10, and each of the multiple compiler devices 10 may execute the same or different parts of the software. In this case, each compiler device 10 may communicate via a network interface 50 or the like to execute processing in a distributed computing configuration. In other words, the compiler device 10 in the above-described embodiment may be configured as a system that realizes its function by having one or more compiler devices 10 execute instructions stored in one or more storage devices. Alternatively, the configuration may include processing information transmitted from a terminal on one or more compiler devices 10 located on the cloud, and then transmitting the processing results to the terminal.

[0098] The various calculations that realize the operations described in Figures 6 to 11 may be executed in parallel using one or more processors 20, or using multiple computers via a network. Alternatively, the various calculations may be distributed to multiple processing cores within the processor 20 and executed in parallel. Furthermore, some or all of the processing and means of this disclosure may be implemented by at least one of a processor and a storage device located on a cloud that can communicate with the compiler device 10 via a network. Thus, the compiler device 10 in the above-described embodiment may be in the form of parallel computing using one or more computers.

[0099] The processor 20 may be an electronic circuit (processing circuit, processing circuitry, CPU, GPU, FPGA, ASIC, etc.) that performs either computer control or calculations. The processor 20 may also be a general-purpose processor, a dedicated processing circuit designed to perform specific calculations, or a semiconductor device that includes both a general-purpose processor and a dedicated processing circuit. Furthermore, the processor 20 may include optical circuits or quantum computing-based calculation functions.

[0100] The processor 20 may perform arithmetic processing based on data and software input from each of the internal components of the compiler unit 10, and may output arithmetic results and control signals to each of the internal components. The processor 20 may also control each of the components constituting the compiler unit 10 by executing the OS (Operating System) or applications of the compiler unit 10.

[0101] The compiler device 10 in the above-described embodiment may be implemented by one or more processors 20. Here, the processor 20 may refer to one or more electronic circuits arranged on one chip, or one or more electronic circuits arranged on two or more chips or two or more devices. When multiple electronic circuits are used, each electronic circuit may communicate by wire or wireless.

[0102] The main memory 30 may store instructions executed by the processor 20 and various data, and the information stored in the main memory 30 may be read by the processor 20. The auxiliary memory 40 is a memory device other than the main memory 30. These memory devices refer to any electronic component capable of storing electronic information, and may be semiconductor memory. The semiconductor memory may be either volatile memory or non-volatile memory. In the compiler device 10 in the above-described embodiment, the memory device for storing various data may be implemented by the main memory 30 or the auxiliary memory 40.

[0103] In the above-described embodiment, if the compiler device 10 consists of at least one storage device (memory) and at least one processor 20 connected to (coupled with) this at least one storage device, at least one processor 20 may be connected to one of the storage devices. Alternatively, at least one storage device may be connected to one of the processors 20. Furthermore, the configuration may include at least one processor 20 among a plurality of processors 20 being connected to at least one storage device among a plurality of storage devices. This configuration may also be realized by storage devices and processors 20 included in a plurality of compiler devices 10. Moreover, the configuration may include a storage device integrated with the processor 20 (for example, a cache memory including an L1 cache and an L2 cache).

[0104] The network interface 50 is an interface for connecting to the communication network 600 wirelessly or via a wired connection. The network interface 50 can be any appropriate interface, such as one conforming to existing communication standards. Information may be exchanged between the compiler device 10 and an external device 710 connected via the communication network 600 through the network interface 50. The communication network 600 may be a WAN (Wide Area Network), LAN (Local Area Network), PAN (Personal Area Network), or a combination thereof, as long as information is exchanged between the compiler device 10 and the external device 710. An example of a WAN is the Internet; an example of a LAN is IEEE 802.11 or Ethernet®; and an example of a PAN is Bluetooth® or NFC (Near Field Communication).

[0105] The device interface 60 is an interface such as USB that connects directly to the external device 720.

[0106] External device 710 is a device connected to the compiler device 10 via the communication network 600. External device 720 is a device directly connected to the compiler device 10.

[0107] External device 710 or external device 720 may, for example, be an input device. The input device may be a camera, microphone, motion capture device, various sensors, keyboard, mouse, touch panel, etc., and will provide the acquired information to the compiler device 10. Alternatively, it may be a device equipped with an input unit, memory, and processor, such as a personal computer, tablet terminal, or smartphone.

[0108] Furthermore, the external device 710 or external device 720 may, for example, be an output device. The output device may be a display device such as an LCD (Liquid Crystal Display) or an organic EL (Electro Luminescence) panel, or it may be a speaker that outputs sound, etc. It may also be a device equipped with an output unit, memory and a processor, such as a personal computer, tablet terminal or smartphone.

[0109] Furthermore, the external device 710 or external device 720 may be a storage device (memory). For example, the external device 710 may be network storage, and the external device 720 may be storage such as an HDD.

[0110] Furthermore, the external device 710 or external device 720 may be a device having some of the functions of the components of the compiler device 10 in the embodiment described above. In other words, the compiler device 10 may transmit some or all of the processing results of the external device 710 or external device 720, or may receive some or all of the processing results from the external device 710 or external device 720.

[0111] In this specification (including the claims), when the expression "at least one of a, b, and c" or "at least one of a, b, or c" (including similar expressions) is used, it includes any of a, b, c, ab, ac, bc, or abc. Furthermore, any element may have multiple instances, such as aa, abb, aabbcc, etc. In addition, it is also possible to add other elements other than the enumerated elements (a, b, and c), such as abcd which has d.

[0112] In this specification (including the claims), when expressions such as "using data as input / based on data / according to / in accordance with data" (including similar expressions) are used, unless otherwise specified, this includes using the data itself or using data that has been processed in some way (e.g., data with added noise, normalized data, features extracted from the data, intermediate representations of the data, etc.). Furthermore, when it is stated that some result is obtained "using data as input / based on data / according to / in accordance with data" (including similar expressions), unless otherwise specified, this includes cases where the result is obtained based solely on the data in question or where the result is influenced by other data, factors, conditions, and / or states other than the data in question. Furthermore, when it is stated that "data is output" (including similar expressions), unless otherwise specified, this includes cases where the data itself is used as output or where data that has been processed in some way (e.g., data with added noise, normalized data, features extracted from the data, intermediate representations of various types of data, etc.) is used as output.

[0113] In this specification (including the claims), the terms “connected” and “coupled” are intended to be non-restrictive terms that include any direct connection / coupling, indirect connection / coupling, electrical connection / coupling, communicative connection / coupling, operational connection / coupling, physical connection / coupling, etc. The terms should be interpreted as appropriate in the context in which they are used, but any form of connection / coupling that is not intentionally or naturally excluded should be interpreted non-restrictively as being included in the terms.

[0114] In this specification (including the claims), when the expression "A configured to B" is used, it may include that the physical structure of element A has a configuration capable of performing operation B, and that the permanent or temporary setting / configuration of element A is configured to actually perform operation B. For example, if element A is a general-purpose processor, it is sufficient that the processor has a hardware configuration capable of performing operation B, and that it is configured to actually perform operation B by the setting of a permanent or temporary program (instruction). Furthermore, if element A is a dedicated processor, dedicated arithmetic circuit, etc., it is sufficient that the circuit structure of the processor is implemented to actually perform operation B, regardless of whether control instructions and data are actually attached.

[0115] Wherever terms meaning "comprising" or "possessing" (e.g., "comprising / including," "having," etc.) are used herein, they are intended to be open-ended terms, including cases where the subject matter of such terms is not the object of the term. Where the object of such terms meaning "comprising" or "possessing" is an expression that does not specify a quantity or suggests a singular number (an expression with the article "a" or "an"), such expression should be interpreted as not being limited to a specific number.

[0116] In this specification (including the claims), even if expressions such as "one or more" or "at least one" are used in some places, and expressions that do not specify a quantity or suggest a singularity (expressions using the articles a or an) are used in other places, the latter expressions are not intended to mean "one." In general, expressions that do not specify a quantity or suggest a singularity (expressions using the articles a or an) should not necessarily be interpreted as not being limited to a specific number.

[0117] In this specification, if a particular configuration of an embodiment is described as having a specific advantage or result, it should be understood, unless otherwise stated, that the same advantage or result can also be obtained from one or more other embodiments having that configuration. However, it should be understood that the presence or absence of such advantage or result generally depends on various factors, conditions, and / or states, and that the configuration does not necessarily guarantee that the advantage or result can be obtained. The advantage or result can only be obtained from the configuration described in the embodiment when various factors, conditions, and / or states are met, and the advantage or result cannot necessarily be obtained in the invention claimed to define that configuration or a similar configuration.

[0118] In this specification (including the claims), when multiple hardware components perform a predetermined process, each component may cooperate to perform the predetermined process, or some components may perform all of the predetermined process. Alternatively, some components may perform part of the predetermined process, while other components perform the remainder. In this specification (including the claims), when expressions such as "one or more hardware components perform a first process, and the one or more hardware components perform a second process" (including similar expressions) are used, the hardware component performing the first process and the hardware component performing the second process may be the same or different. In other words, it is sufficient that the hardware component performing the first process and the hardware component performing the second process are included in the one or more hardware components. Hardware may include electronic circuits, devices containing electronic circuits, etc.

[0119] In this specification (including the claims), when multiple memory devices store data, each of the multiple memory devices may store only a portion of the data or the entire data. Furthermore, a configuration in which some of the multiple memory devices store data is also included.

[0120] While embodiments of this disclosure have been described in detail above, this disclosure is not limited to the individual embodiments described above. Various additions, modifications, substitutions, and partial deletions are possible, provided that they do not depart from the conceptual idea and spirit of the present invention derived from the claims and their equivalents. For example, where numerical values ​​or mathematical formulas are used in the description of the embodiments described above, these are provided for illustrative purposes only and do not limit the scope of this disclosure. Similarly, the sequence of operations shown in the embodiments is also illustrative and does not limit the scope of this disclosure.

Claims

1. A compiler device comprising at least one memory and at least one processor, the compiler device generating an instruction sequence to be executed by a processor, The at least one processor receiving a first instruction sequence for executing a first process and a second instruction sequence for executing a second process; generating a third instruction by combining a first instruction included in the first instruction sequence and a second instruction included in the second instruction sequence, the first instruction and the second instruction being executable in parallel; generating a third instruction sequence by concatenating one or more of the third instructions, instructions included in the first instruction sequence that are not combined into the third instruction, and instructions included in the second instruction sequence that are not combined into the third instruction; Compiler device.

2. The arithmetic processing device includes a plurality of hierarchical layers of memory and is connected to an external memory; The first instruction is an instruction to transfer data between the memories of two adjacent hierarchical levels in the arithmetic processing device, and the second instruction is an instruction to transfer data between the arithmetic processing device and the external memory.

2. The compiler apparatus according to claim 1.

3. generating the third instruction sequence so that a processing result based on the third instruction sequence is equivalent to a processing result obtained by sequentially executing the first instruction sequence and the second instruction sequence; 3. A compiler apparatus according to claim 1.

4. The at least one processor further comprises: determining whether a processing result obtained by combining a first instruction of interest in the first sequence of instructions and a second instruction of interest in the second sequence of instructions into a third instruction is equivalent to a processing result obtained by not combining the instructions; generating a third instruction by combining the first instruction of interest and the second instruction of interest such that a processing result is determined to be equivalent when the first instruction of interest and the second instruction of interest are combined and when they are not combined; 4. The compiler apparatus according to claim 3.

5. The at least one processor further comprises: determining whether or not there is a data dependency between the first process performed by the first instruction sequence and the second process performed by the second instruction sequence; If it is determined that the data dependency exists and if the generation of the third instruction sequence would cause the data dependency to be broken, the generation of the third instruction sequence is suppressed.

5. The compiler apparatus according to claim 4.

6. The at least one processor further comprises: When a memory capacity used during execution of the third instruction sequence exceeds a memory capacity used by the arithmetic processing device, generation of the third instruction sequence is inhibited.

6. A compiler apparatus according to claim 4 or 5.

7. One of the first instruction and the second instruction combined into the third instruction is an arithmetic instruction for causing an arithmetic unit of the arithmetic processing device to execute an arithmetic operation, and the other of the first instruction and the second instruction combined into the third instruction is a data transfer instruction for a memory of the arithmetic processing device. The compiler apparatus according to any one of claims 1 to 6.

8. a first data transfer instruction included in the first instruction sequence and a second data transfer instruction included in the second instruction sequence to generate the third instruction; 8. A compiler apparatus according to claim 7.

9. The memory used by the arithmetic processing device includes a plurality of memories having different hierarchical levels, The data transfer command is prepared for each data transfer between memories of different hierarchical levels.

9. A compiler apparatus according to claim 7 or 8.

10. Any of the plurality of memories having different hierarchical levels includes a register for storing data used by the arithmetic processing device to execute an arithmetic operation.

10. The compiler apparatus according to claim 9.

11. each of the first instructions, the second instructions, and the third instructions includes a plurality of different instructions for a plurality of processing units capable of executing different types of processing in parallel; The plurality of processing units are included in the arithmetic processing device. The compiler apparatus according to any one of claims 1 to 10.

12. The plurality of different instructions included in the first instruction include an arithmetic instruction for one of the plurality of processing units and a NOP (NO OPERATION) instruction for another one of the plurality of processing units; the plurality of different instructions included in the second instruction include a NOP instruction for the one of the plurality of processing units and an operation instruction for the other one of the plurality of processing units; The plurality of different instructions included in the third instruction include an operation instruction included in the first instruction for the one of the plurality of processing units and an operation instruction included in the second instruction for the other one of the plurality of processing units.

12. A compiler apparatus according to claim 11.

13. Each instruction included in the first instruction sequence, the second instruction sequence, and the third instruction sequence is written at a machine language level. The compiler apparatus according to any one of claims 1 to 12.

14. Generating the third instruction by combining the first instruction and the second instruction means generating, as the third instruction, the one instruction obtained by combining the first instruction and the second instruction in a manner that includes the first instruction and the second instruction in a single instruction. The compiler apparatus according to any one of claims 1 to 13.

15. The at least one processor generates the first instruction sequence and the second instruction sequence based on a learning model. The compiler apparatus according to any one of claims 1 to 14.

16. The at least one processor receives the first sequence of instructions and the second sequence of instructions, the first sequence of instructions being generated so that the second process is executed after the first process. A compiler apparatus according to any one of claims 1 to 15.

17. The third instruction sequence is transferred to an arithmetic processing device external to the compiler device in place of the first and second instruction sequences, and is executed by the arithmetic processing device. A compiler apparatus according to any one of claims 1 to 16.

18. Each instruction included in the third instruction sequence is a SIMD instruction for a SIMD (Single Instruction Multiple Data) processor, and the arithmetic processing device is a SIMD processor. A compiler apparatus according to any one of claims 1 to 17.

19. Each of the first instruction sequence and the second instruction sequence is one of a plurality of instruction sequences, each of the plurality of instruction sequences relating to at least arithmetic operations and data transfer for a corresponding layer of a deep neural network. A compiler apparatus according to any one of claims 1 to 18.

20. The arithmetic processing device receives and executes the third instruction sequence generated by the compiler device described in any one of claims 1 to 19.

21. An instruction generation method for generating the third instruction sequence using a compiler device described in any one of claims 1 to 19.

22. A program including the third sequence of instructions generated using a compiler device described in any one of claims 1 to 19, and executed by the processing device.

23. A compilation method executed by at least one processor for generating a sequence of instructions to be executed by a processor, comprising: receiving a first instruction sequence for executing a first process and a second instruction sequence for executing a second process; generating a third instruction by combining a first instruction included in the first instruction sequence and a second instruction included in the second instruction sequence, the first instruction and the second instruction being executable in parallel; generating a third instruction sequence by concatenating one or more of the third instructions, instructions included in the first instruction sequence that are not combined into the third instruction, and instructions included in the second instruction sequence that are not combined into the third instruction; How to compile.

24. A compiler program for generating an instruction sequence to be executed by a processor, comprising: receiving a first instruction sequence for executing a first process and a second instruction sequence for executing a second process; generating a third instruction by combining a first instruction included in the first instruction sequence and a second instruction included in the second instruction sequence, the first instruction and the second instruction being executable in parallel; generating a third instruction sequence by concatenating one or more of the third instructions, instructions included in the first instruction sequence that are not combined into the third instruction, and instructions included in the second instruction sequence that are not combined into the third instruction; A compiler program that causes a computer to carry out processing.