Information processing device, information processing method, program, intermediate language generation method, machine language generation method, and data structure generation method
The information processing device optimizes memory usage and processing time by generating and updating data structures to improve the efficiency and transparency of large-scale data handling, addressing the challenges of manual optimization in existing systems.
Patent Information
- Application Number
- PCT/JP2024/016415
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2024-04-26
- Publication Date
- 2024-10-31
AI Technical Summary
Existing information processing systems face challenges in optimizing memory usage and processing time for large-scale data handling, requiring specialized knowledge to improve program efficiency and transparency, which is difficult to achieve manually.
An information processing device with a processor that generates and updates data structures to optimize the order of instructions and memory usage, using methods like pipeline processing, SIMD, MIMD, and superscalar execution, to reduce memory usage and processing time without compromising calculation accuracy.
The solution enables automatic optimization of memory usage and processing time, improving efficiency and transparency in large-scale data processing, allowing for faster execution with reduced memory requirements.
Smart Images

Figure JP2024016415_31102024_PF_FP_ABST
Abstract
Description
Information processing device, information processing method, program, intermediate language generation method, machine language generation method, and data structure generation method
[0001] The present disclosure relates to an information processing device, an information processing method, a program, an intermediate language generation method, a machine language generation method, and a data structure generation method.
[0002] In recent years, advances in computing technology have led to an increase in information processing involving large amounts of data, and the lack of storage capacity in computers has become a major issue. While this issue can be addressed by improving programs to make them more memory-efficient and faster, this requires specialized knowledge, and improving large programs is often beyond the capabilities of humans. For this reason, computers sometimes automatically improve programs that are larger than a certain size. However, automatically generating programs that are more memory-efficient and faster while still satisfying the requirements for program transparency remains a major challenge.
[0003] P. Jain, et.al., “Checkmate: Breaking the Memory Wall with Optimal Tensor Rematerialization”, Proceedings of Machine Learning and Systems 2 (MLSys 2020)
[0004] One of the non-limiting problems that the embodiments of the present disclosure aim to solve is to perform optimization related to the memory area size or processing time required for a series of processes.
[0005] An information processing device according to one embodiment includes at least one processor, which acquires a first data structure including information about an execution order of a plurality of instructions and information about the amount of memory required to execute each of the instructions, performs a predetermined operation on the first data structure to generate a second data structure in which the information about the execution order and the information about the amount of memory required to execute the instructions are updated, acquires an evaluation value based on the second data structure, and if the evaluation value satisfies a first condition, updates the first data structure using the second data structure, the first data structure and the second data structure are data structures that support changes and value calculations for a predetermined section, and the at least one processor executes the processes of generating the second data structure, acquiring the evaluation value, and updating the first data structure if the evaluation value satisfies the first condition multiple times.
[0006] An intermediate language generation method according to one embodiment creates an intermediate language using the information processing device described above.
[0007] An information processing method according to one embodiment converts the intermediate language generated by the above method into machine language and executes it.
[0008] A data structure generation method according to one embodiment generates a data structure using the above-described information processing device.
[0009] 1 is a block diagram schematically illustrating an example of an information processing apparatus according to an embodiment. A flowchart illustrating an example of processing of an information processing apparatus according to an embodiment. A diagram illustrating an example of describing processing according to an embodiment using a graph. A diagram illustrating an example of changes in memory usage over time according to an embodiment. A flowchart illustrating an example of processing operations according to an embodiment. A flowchart illustrating an example of processing operations according to an embodiment. A flowchart illustrating an example of processing operations according to an embodiment. A diagram illustrating an example of changes in memory usage over time according to an embodiment. A diagram illustrating an example of describing processing according to an embodiment using a graph. A flowchart illustrating an example of processing operations according to an embodiment. A diagram illustrating an example of changes in memory usage over time according to an embodiment. A diagram illustrating an example of changes in memory usage over time according to an embodiment. A flowchart illustrating an example of processing operations according to an embodiment. A diagram illustrating an example of changes in memory usage over time according to an embodiment. A diagram illustrating an example of changes in memory usage over time according to an embodiment. A flowchart illustrating an example of tree update according to an embodiment. A block diagram schematically illustrating an example of implementation of an information processing apparatus according to an embodiment.
[0010] The problem to be solved by the embodiments of the present disclosure may be optimization related to at least one of the memory area size or processing time required for a series of processes, and further, as a non-limiting example of some problems, it may also be a problem corresponding to the effects described in the embodiments. In other words, a problem corresponding to at least one of the effects described in the description of the embodiments of the present disclosure can be the problem to be solved by the present disclosure.
[0011] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described with reference to the drawings. The drawings and the description of the embodiments are given by way of example only and are not intended to limit the present invention.
[0012] The information processing device of the present disclosure optimizes the storage status of variables, etc., by, for example, rearranging the order of processes included in a series of processes in at least one processor capable of pipeline processing, or by adding or deleting processes that are partially or completely overlapping. As a result, the information processing device can reduce memory usage and speed up processing without sacrificing calculation accuracy.
[0013] The processor that executes this optimized processing may be capable of parallel pipeline processing, and may process data in any of the following formats: SIMD (Single Instruction, Multiple Data Stream), MIMD (Multiple Instruction, Multiple Data Stream), SISD (Single Instruction, Single Data Stream), and MISD (Multiple Instruction, Single Data Stream). Also, the processor that executes the optimized processing may be superscalar.
[0014] In the present disclosure, an information processing device having a processor that executes an optimized program and an information processing device having a processor that optimizes a program are described, but when simply referring to an information processing device or a processor, it should be noted that these terms can be interpreted appropriately depending on the context. For example, an information processing device that performs optimization can also perform optimization based on the architecture of the information processing device that executes the optimized program.
[0015] Furthermore, it is not excluded that the information processing device that executes the optimized program and the information processing device that optimizes the program may be the same information processing device. In other words, the information processing device may itself optimize a program related to a series of processes that it executes.
[0016] The processor may be, for example, a multi-core CPU (Central Processing Unit) or GPU (Graphics Processing Unit). The information processing device can optimize processors with different functions based on the processing capabilities or architectural configurations of each processor. For example, the information processing device can perform different optimizations suited to each processor for the same series of processes in different processors.
[0017] The information processing device performs program optimization corresponding to a target device, for example, for a source describing a program or an intermediate representation of the source, and converts, for example, a series of processes expressed in the intermediate representation into an optimized series of processes expressed in the intermediate representation.
[0018] When an optimized program is represented in an intermediate representation, an information processing device that executes the optimized series of processes may execute the series of processes using the intermediate representation with a JIT (Just in Time) compiler, or may convert the intermediate representation into an executable format in advance and execute the series of processes.
[0019] FIG. 1 is a block diagram schematically illustrating an example of an information processing apparatus according to an embodiment.
[0020] The information processing device 1 includes a processing circuit 10, a memory circuit 12, and an input / output interface (hereinafter referred to as input / output I / F 14). The information processing device 1 performs optimization related to at least one of memory and processing time for a series of processes including multiple instructions. In addition to the components shown in FIG. 1 , the information processing device 1 also includes appropriate components required to operate the information processing device 1, such as a control unit that controls each component, a power supply that supplies power to each component, etc.
[0021] The processing circuit 10 is a circuit that mainly executes arithmetic processing in the information processing device 1. The processing circuit 10 may include a processor such as a CPU or a GPU. The processing circuit 10 may execute arithmetic processing in cooperation with at least one other processing circuit provided outside the information processing device 1.
[0022] The memory circuit 12 may include a memory, storage, etc. that can store data required for processing in the information processing device 1, data that needs to be stored during processing, or programs required for software. As with the processing circuit 10, the memory circuit 12 does not need to be provided entirely within the information processing device 1, and at least a part of it may be provided outside the information processing device 1.
[0023] The input / output I / F 14 has an interface that connects the inside and outside of the information processing device 1. The input / output I / F 14 can be provided with, for example, an interface of any standard for transmitting and receiving data, a user interface for user input or a user interface for output to the user, or an interface for transmitting and receiving data to and from these user interfaces.
[0024] When at least one of the processing circuit 10 and the memory circuit 12 operates in cooperation with a configuration external to the information processing device 1, the information processing device 1 can send and receive data via the input / output I / F 14.
[0025] Next, a description will be given of the processing of the information processing device 1 in the present disclosure. Fig. 2 is a flowchart showing an example of the processing of the information processing device 1 according to an embodiment.
[0026] The processing circuit 10 acquires a data structure (first data structure) including a description of memory usage at each timing in a series of processes to be optimized (S10). The data structure includes information about the series of processes having multiple instructions (e.g., information about the execution order of the instructions) and information about memory usage.
[0027] The information about the memory usage may include information about the memory amount required for each command, and may further include information about the total memory amount required for each command execution timing.
[0028] This data structure may be represented as a tree, and in the following non-limiting examples the data structure is described using a tree representation, but other representations of the data structure are not excluded.
[0029] The processing circuit 10 calculates a first memory amount indicating the amount of memory required to store input / output variables in an instruction written in an arbitrary format. The processing circuit 10 can also reflect, in the first memory amount, the amount of memory related to intermediate variables, etc. required in the calculation of each instruction, or the amount of memory related to input / output variables, intermediate variables, etc. required by other instructions, etc. during execution of the instruction.
[0030] For example, the first memory amount is the amount of memory required to execute each instruction in a series of processes including multiple instructions. Furthermore, for example, the first memory amount may be the amount of memory required at the timing of executing each instruction in a series of processes including multiple instructions. In other words, when multiple instructions are being executed in parallel, the first memory amount may be the sum of the amounts of memory required for the multiple instructions being executed in parallel, rather than the amount of memory required for each individual instruction being executed in parallel.
[0031] The processing circuit 10 generates a first tree, which is a collection of time series intervals, from the acquired first memory amount. As a non-limiting example of the first data structure, the processing circuit 10 divides the time series into intervals in which each operation (instruction) is executed, and acquires a first tree with these intervals as leaf nodes. An interval is a term that indicates a part of a time series of a series of processes, and it is sufficient if the operations of the following commands can be realized for this interval, for example.
[0032] The processing circuit 10 may also acquire a first data structure (first tree) as an initial value, for example, via the input / output I / F 14. When acquiring data of the first data structure via the input / output I / F 14, the processing circuit 10 may store the data in the memory circuit 12.
[0033] When the processing circuit 10 receives, as data representing a series of processes including multiple instructions, for example, graph-represented data in which variables are represented by nodes and processes are represented by edges, it represents this graph-represented data using a time-series data structure. This time-series data is, for example, a representation of multiple instructions arranged in chronological order. The graph-represented data may also be data in which nodes represent processes. In either case, it acquires at least the amount of memory used by variables that are input and output to the process.
[0034] The first data structure can be described as a first tree using, for example, a segment tree. By describing using a segment tree, the processing circuit 10 can change the memory amount at each time for each input / output variable of an instruction at a low time cost when performing an operation such as switching processes. Also, by describing using a segment tree, the processing circuit 10 can calculate the evaluation value of the entire program at a low time cost. The evaluation value can be obtained from the maximum memory amount, the total memory amount at each time, the total processing execution time, or an approximate value of these. Also, the user can easily implement this change in memory amount used.
[0035] In addition, the evaluation value can be, as other non-limiting examples, information that indirectly indicates the maximum memory amount, the total memory amount by time, the total processing execution time, or an approximate value of these, information that is correlated with these values, or any combination of the information given as examples.
[0036] Furthermore, the representation of data indicating memory usage is not limited to a segment tree, and may be represented by other data structures such as square division or a balanced binary tree (e.g., a red-black tree) that support changes and value calculation for intervals. Note that the calculated value may be obtained for each interval or for the entire series of processes.
[0037] A data structure holds a sequence of values. If the length of this sequence is n, n is at least equal to the number of instructions included in the series of operations. The kth value from the beginning in the time series stores information such as the instruction at time k and the amount of memory. Note that a data structure may hold information other than memory amount, and the values it holds do not have to be real numbers but may hold quantities such as vectors, tensors, or complex numbers.
[0038] The data structure supports changes to intervals as follows. For example, when an instruction is added or deleted at a certain time, the data structure needs to store values in memory for variables related to that instruction from one time to another. In this case, the processing circuit 10 performs an update by adding or subtracting the value of the variable's memory size for the corresponding time interval of the data structure.
[0039] The data structure also supports value calculation for a predetermined interval (one or more intervals) as follows: For example, if the predetermined interval is the entire sequence of time-series values, the processing circuit 10 can calculate the maximum value of the sequence of values in the data structure, thereby calculating the maximum memory amount required for a series of processes, i.e., the memory amount required to execute the entire program representing the series of processes.
[0040] Although the above examples of memory amount calculations include adding or subtracting updates within an interval and calculating the maximum value within an interval, the present invention is not limited to these examples. For example, the processing circuit 10 can obtain execution time as a calculated value by referencing a column within the data structure. As another example, the processing circuit 10 can obtain various values, such as the total memory amount required for a series of processes within an interval or logsumexp for an interval, by referencing a column within the data structure.
[0041] 3 is a diagram showing a series of processes in which variables are described in a graph according to one embodiment. Nodes represent variables. Edges represent that a variable at a starting node is transformed by an instruction at a destination node. When one node is connected to another node by an edge, the edge may be understood to represent an instruction, and passing through the edge means applying the instruction indicated by the edge to the variable.
[0042] On the other hand, when edges from multiple nodes reach a node such as c, it can be expressed that c is obtained by performing an operation on variables b1 and b2, which are the starting nodes of the multiple edges, using an instruction such as c = op5(b1, b2).
[0043] The instruction op1 is applied to variable x1 to calculate variable a1, and the instruction op2 is applied to variable a1 to calculate variable b1. Similarly, the instruction op3 is applied to variable x2 to calculate variable a2, and the instruction op4 is applied to variable a2 to calculate variable b2. Then, the instruction op5 is applied to variables b1 and b2 to calculate variable c, and the instruction op6 is applied to variable c to calculate output y.
[0044] Also, for example, there may be cases where only one of op5_1(b1) or op5_2(b2) is required to obtain c. Furthermore, there may be cases where obtaining c involves branching between the transformation result of b1 and the transformation result of b2. In such cases, the first data structure can be used to appropriately describe a series of processes.
[0045] Even if it is expressed more generally as (output variable set) = op(input variable set), it can be appropriately expressed as the first data structure.
[0046] FIG. 4 is a diagram showing an example of time-series changes in memory usage in the process of FIG. 3. The top row shows variables, each of which uses the memory amount shown in the second row. The arrows indicate the lifetime of each variable. The processing circuit 10 can set time-series intervals based on the lifetime of each variable.
[0047] The size [MB] is the size required when the variable is used. The timing of using the variable is a concept that includes the timing when the variable is stored for use in another instruction, such as when an instruction that does not use the variable is being executed, for example, for use in a later instruction.
[0048] Additionally, the total size [MB] is the amount of memory required when the command shown on the left of the table is executed. The total size includes, for example, the amount of memory required when command op2 is executed, the amount of memory required at the time command op2 is executed, or the amount of memory required to store the variables described above in the section where command op2 is executed.
[0049] The lifetime of a variable is set based on, for example, the timing at which each instruction forming a series of processes requires the variable as output, or the timing at which each instruction requires the variable as input. For example, variable a1 (100 [MB]) is held in memory from the start of instruction op1 to the completion of instruction op3, and variable a2 (100 [MB]) is held in memory from the start of instruction op2 to the completion of instruction op4. Therefore, when instruction op2 is executed, both variables a1 and a2 are held in memory, and the total size of the memory used is 200 [MB].
[0050] The processing circuit 10 calculates the total values of variables, instructions, and memory usage by tracing the nodes in order, starting from the variable indicated at the terminal node of the processing flow described in chronological order. For example, for each section of the chronological order in which one instruction continues, the processing circuit 10 generates a first data structure (e.g., a first tree) by using the memory usage of each variable and the total size of the memory usage as the first memory usage.
[0051] By describing the data in such a data structure (e.g., a tree), even if the order of instructions in a series of processes is changed, the processing circuit 10 can easily obtain the memory amount for each variable and the total memory amount during the period in which each instruction is being executed. For example, the processing circuit 10 can easily obtain the total memory amount taking into account the memory amount for holding variables that are not used in instruction op2 but are required for use in the next instruction op3.
[0052] Returning to FIG. 2, after generating the structure data indicating memory usage, the processing circuit 10 performs an operation on the instruction or variable corresponding to the structure data (S20). This operation may include, for example, at least one of adding an instruction, replacing an instruction, deleting an instruction, moving an instruction, manipulating the storage location of a variable, or manipulating a variable. The operation may also be a combination of multiple operations. The operations will be described in detail later.
[0053] The processing circuit 10 calculates a new memory usage amount (second memory amount) that reflects the manipulated command and generates a second data structure (second tree) (S30). The generation of this second data structure may be similar to S10 above, where the processing circuit 10 calculates the second memory amount, which is the memory usage amount for each time series interval for the manipulated process, and generates the second data structure as a collection of the calculated memory usage amounts for each time series interval. The processing circuit 10 can also manipulate at least a portion of the first data structure in S20 above and obtain the updated result as the second data structure.
[0054] The processing circuit 10 calculates an evaluation value based on at least the second memory amount based on the second data structure, and updates the first data structure and a series of processes taking into consideration the order of commands corresponding to the first data structure, etc., in accordance with this evaluation value (S40). The processing circuit 10 determines whether to update the first data structure by determining whether a condition (first condition) is satisfied, for example, by comparing the evaluation value with a predetermined threshold value.
[0055] If the processing circuit 10 determines to update, it updates the current second data structure as the first data structure to be used in the calculation in the next iteration. If the processing circuit 10 determines not to update, it uses the current first data structure as the first data structure to be used in the calculation in the next iteration. This evaluation and update process will be described in detail later.
[0056] The processing circuit 10 determines whether the optimization is complete after updating / not updating the first data structure and the corresponding instructions (S50). The optimization completion condition (second condition) can be set to any appropriate condition. For example, the completion condition can be a condition related to a predetermined parameter, such as a predetermined number of operations, evaluations, and updates being repeated, a predetermined parameter becoming smaller than a predetermined value, a predetermined time having elapsed, no updates being made during a predetermined number of optimization loops or a predetermined time, or a combination of these conditions.
[0057] If the optimization is not completed (S50: NO), the processing circuit 10 repeats the processes from S20 to S40.
[0058] If the optimization is completed (S50: YES), the processing circuit 10 converts the optimized processing flow into an arbitrary format, for example, a graph format, and outputs it (S60). The output includes output to the outside via the input / output I / F 14, as well as a process of storing the results in the memory circuit 12. The processing circuit 10 may also output the memory usage, particularly the maximum memory usage, along with the processing flow.
[0059] Next, we will explain the optimization process (S20, S40) in detail. These processes can reduce calculation costs by using a tree representation, such as a segment tree representation, which results in improved optimization accuracy and reduced optimization time.
[0060] The decision to update or not update can be made based on, for example, a Monte Carlo simulation. The processing circuit 10 can also apply other metaheuristic optimization techniques, such as a genetic algorithm. While an example using simulated annealing will be described, the implementation of the optimization technique is not limited to this example.
[0061] 5 is a flowchart showing an example of a processing operation according to an embodiment. The processing circuit 10 selects an arbitrary time in the time series of multiple instructions corresponding to the first tree (S200). This arbitrary time may be a time between instructions. For example, in the example of FIG. 4, the processing circuit 10 randomly selects a time, resulting in the selection of a time between instructions op1 and op2.
[0062] The processing circuit 10 performs an operation to add and insert an arbitrary instruction at this arbitrarily selected time (S202). The added instruction may be a nop or any other instruction that does not change the operation result. In the above example, the processing circuit 10 adds and inserts an arbitrary process between the instruction op1 and the instruction op2.
[0063] The "arbitrary command" described here can be any command that does not change the result of a series of processes. Before adding an arbitrary command at an arbitrary time, the processing circuit 10 can check the dependency of variables, such as whether a variable used in the arbitrary command has already been calculated, and add the actual command if there are no problems with the dependency.
[0064] For example, the processing circuit 10 may randomly select a time and add the randomly selected instruction. The processing circuit 10 may also select a time based on a predetermined rule in S200. The processing circuit 10 may also select an instruction to add based on a predetermined rule in S202.
[0065] The predetermined rule for selecting a time may depend on memory-related time, for example, by increasing or decreasing the probability of selecting a period when there is little memory available or a period when there is plenty of memory available. Also, the predetermined rule for the instruction to be added and inserted may be set to a rule such as an instruction that uses a small amount of memory for input and a large amount of memory for output.
[0066] 6 is a flowchart showing an example of an instruction operation according to an embodiment. The processing circuit 10 selects an arbitrary time in the time series of multiple instructions corresponding to the first tree (S210). This arbitrary time may be a time when some instruction is being executed. For example, in the example of FIG. 4, the processing circuit 10 selects a random time or a time based on a predetermined rule, and as a result, selects the processing time for instruction op3, and instruction op3 is selected.
[0067] The processing circuit 10 deletes the selected instruction (S212). The processing circuit 10 deletes instructions that do not change the operation result. In the above example, the processing circuit 10 deletes the instruction op3.
[0068] For example, when the processing circuit 10 is to delete an instruction that outputs a variable x at time t, it determines whether there is an instruction that uses the variable x after time t. If it determines that there is an instruction that uses the variable x after time t, the processing circuit 10 checks whether the variable x is output before the instruction that uses the variable x. If it cannot be confirmed that the variable x is output appropriately, the processing circuit 10 avoids deleting the instruction that outputs the variable x at time t.
[0069] 7 is a flowchart showing an example of an instruction operation according to one embodiment. By combining FIGS. 5 and 6, the processing circuit 10 can, for example, perform an operation to move an arbitrarily selected instruction at an arbitrarily selected time. In other words, the processing circuit 10 can change the order of two or more arbitrarily selected instructions.
[0070] When swapping instructions, as explained for each operation, the processing circuit 10 obtains the dependency of variables and performs swapping operations based on this dependency of variables to the extent that swapping the instructions does not change the calculation results.
[0071] In summary, as shown in the flowchart, the processing circuit 10 selects any multiple instructions (S220). The processing circuit 10 selects multiple instructions, for example, randomly or based on a predetermined rule, and then selects instructions op2 and op3.
[0072] Then, the processing circuit 10 swaps the selected instructions to the extent that the operation result does not change (S222). For example, the processing circuit 10 swaps the order of the selected instructions op2 and op3. As a result, the processing circuit 10 can perform a so-called swap operation on the instructions op2 and op3, for example.
[0073] This operation can also be described as an operation in which the instruction op3 is selected as an arbitrary instruction (an instruction at a random time or a time selected based on a predetermined rule), a time between instructions op1 and op2 is selected as an arbitrary time (another random time or a time selected based on another predetermined rule), and the selected instruction op3 is inserted at the selected time.
[0074] Fig. 8 is a diagram showing an example of a time-series change in memory usage according to one embodiment. The processing circuit 10 generates a second tree representing memory usage as a set for each time-series interval for the command after operation according to Fig. 8. For example, as the process of S30 in Fig. 2, the processing circuit 10 calculates the total memory usage by rearranging the memory usage for each time-series interval, and generates the second tree by using the rearranged memory usage and the total memory usage as the second memory usage.
[0075] It can be seen that the memory usage of a series of processes including multiple instructions can be reduced by manipulating the instructions from the state in Figure 4 to the state in Figure 8. In this way, by performing the above operations, it may be possible to reduce the memory usage of the entire series of processes.
[0076] Note that this replacement operation is not limited to swap, and by selecting three or more instructions, it can also be a rotate or shuffle instruction operation. Rotate is an operation that shifts multiple instructions without disrupting the circular order. For example, in Figure 4, the operation of moving instruction op2 between instructions op4 and op5 can be rephrased as a rotate process of instructions op2, op3, and op4. Shuffle is an exchange operation between multiple instructions, and of course it is an operation that includes rotate.
[0077] In this way, the processing circuit 10 can arbitrarily select and arbitrarily replace any number of instructions as an instruction operation.
[0078] The operations of instructions executed by the processing circuit 10 are not limited to these. The processing circuit 10 can perform not only instructions but also operations such as deleting variables from memory. By allowing the deletion operation of variables in memory, the processing circuit 10 can perform operations related to the recalculation of variables, for example.
[0079] 9 shows an example of deleting variables from memory and recalculating, or deleting calculations and retaining variables in memory for a long time. For example, variables b and e are required to calculate y, and variable b is a variable required in the process of calculating variable e.
[0080] One way to reduce calculations is to extend the lifetime of variable b in memory and execute the process in a flow that eliminates the recalculation of variable b (see the left diagram). While this reduces the amount of calculations, variable b occupies memory space for a long period of time.
[0081] One way to reduce memory usage is to shorten the memory lifetime of variable b and execute the process in a flow that recalculates variable b (see the right figure). While this reduces overall memory usage, it does require the recalculation of variable b.
[0082] One of the flows can be selected based on the computational cost required to compute variable b and the memory area required to store variable b. The processing circuit 10 can perform optimization that also accommodates such changes in the order of instructions and deletion of variables in memory.
[0083] Fig. 10 is a flowchart showing an example of an operation of a command according to an embodiment. Fig. 11 is a diagram showing an example of a time series change in memory usage according to an embodiment. Note that Figs. 11 and 12 show a series of processes different from those shown in Fig. 4 and the like, and there is no particular relationship between the order of processes, memory usage, etc.
[0084] The processing circuit 10 selects an instruction at an arbitrary time (a random time or an instruction at a time selected based on a predetermined rule) (S230). For example, in the left diagram of FIG. 9, the processing circuit 10 selects instruction op6.
[0085] The processing circuit 10 selects a random variable from the input variables of the selected instruction op6 (S232). For example, the processing circuit 10 selects variable b from the input variables of the instruction op6.
[0086] If the processing circuit 10 determines that the variable b can be temporarily deleted from the memory and recalculated, it temporarily deletes the variable b from the memory and adds an instruction to recalculate it (S234).
[0087] 11, after variable b is used in instruction op3, it is not used until instruction op5. Therefore, the processing circuit 10 releases the memory area for variable b after instruction op3 and adds an instruction to recalculate variable b at some point before instruction op5.
[0088] 12 is a diagram showing an example of a time series change in memory usage according to an embodiment. To achieve the state shown in FIG. 12, the processing circuit 10 can add an instruction to recalculate variable b before instruction op5, preferably immediately before operation op5, which requires variable b.
[0089] For the sake of explanation, let us assume that variable b is divided into two variables, b1 and b2, depending on the time. After variable c = op3(b1) is calculated in instruction op3, the processing circuit 10 releases the memory associated with variable b1. Then, before calculating y, the processing circuit 10 calculates b2 = op2(a), thereby reacquiring variable b2 as variable b, and calculates variable y as y = op6(b2, e).
[0090] By changing from the state in Fig. 11 to the state in Fig. 12, it may be possible to reduce the amount of memory occupied by the entire series of processes. In this way, the processing circuit 10 can arbitrarily select one instruction from the multiple instructions corresponding to the first tree, and for at least one of the input variables of that instruction, if that input variable is used in an earlier instruction, delete that variable from memory after the earlier instruction is completed, and add an instruction to perform recalculation before the selected instruction, for example, immediately before it.
[0091] Processing circuitry 10 may also perform the above process by selecting a variable rather than selecting an instruction at a given time and determining that this variable is input to multiple instructions.
[0092] Conversely, if the impact of the amount of calculation for variable b is greater than the memory usage for variable b, it is desirable to be able to manipulate instructions from the right diagram to the left diagram in FIG.
[0093] Fig. 13 is a flowchart showing an example of an operation of a command according to an embodiment. Figs. 14 and 15 are diagrams showing an example of a time series change in memory usage before and after the operation of Fig. 13. As with the above, Figs. 14 and 15 show a series of processes different from those of Figs. 4, 11, etc., and there is no particular relationship between the order of processes, memory usage, etc.
[0094] The processing circuit 10 selects an instruction at an arbitrary time (a random time or an instruction at a time based on a predetermined rule) (S240). For example, in the right diagram of FIG. 9, the processing circuit 10 selects instruction op6 as a result of the arbitrary selection.
[0095] The processing circuit 10 selects an arbitrary variable from the input variables of the selected instruction op6 (S242). The processing circuit 10 selects the variable b from the input variables of the instruction op6, for example, randomly or based on a predetermined rule.
[0096] The processing circuit 10 deletes the variable b2, which is a recalculation of the variable b, and, if it determines that it is possible to extend the lifetime of the variable b1, which is the result of the previous calculation in the memory, deletes the recalculation process and extends the lifetime of the previously obtained variable b1 (S244).
[0097] 14, variable b1 is calculated in instruction op2 immediately before instruction op3, then deleted from memory, and then recalculated as variable b2 in instruction op2 immediately before instruction op6. Therefore, the processing circuit 10 deletes instruction op2 immediately before instruction op6, and performs an operation to keep the already calculated variable b1 in memory even after instruction op3.
[0098] As a result, as shown in FIG. 15, the lifetime of variable b becomes longer, while it is possible to operate to a state in which the recalculation process of variable b is deleted.
[0099] By changing from the state in Fig. 14 to the state in Fig. 15, it may be possible to reduce the amount of memory occupied by the entire series of processes. In this way, the processing circuit 10 can arbitrarily select one instruction from the multiple instructions corresponding to the first tree, and, if at least one of the input variables of that instruction is used in an earlier instruction, retain that variable in memory even after the earlier instruction is completed, and delete the recalculation process before the selected instruction, for example, the immediately previous one.
[0100] The processing circuit 10 can select any variable, rather than selecting an instruction at any time, determine whether or not there is a recalculation for the selected variable, and perform operations such as deleting the recalculation process.
[0101] In this manner, processing circuitry 10 can add recalculations or remove recalculations as a manipulation of instructions.
[0102] 10 to 15, operations for adding and deleting recalculation processes are described, but operations on variables are not limited to this. For example, the processing circuit 10 can also perform operations for adding and deleting upload and / or download processes for variables, such as transferring a variable held in a memory area (first memory) with a relatively fast access speed to a memory area (second memory) with a comparatively slower access speed, or conversely, transferring a variable from a memory area in the second memory with a slower access speed to a memory area in the first memory with a faster access speed.
[0103] As a non-limiting example, the first memory may be a shared memory, a cache, etc., and the second memory may be an external memory, a storage, etc.
[0104] As a non-limiting example, the processing circuit 10 can perform operations such as adding or deleting instructions that transfer variables in shared memory to global memory in CUDA (registered trademark), and / or instructions that transfer variables in global memory to shared memory.
[0105] Returning to Figure 2, processing circuitry 10 generates a second tree in S30 that corresponds to the instructions after they have been manipulated in the operations (Figures 5, 6, 10, 13, etc.), and then performs an evaluation based on the second tree and an update of the first tree based on this evaluation in S40.
[0106] 16 is a flowchart illustrating a non-limiting example of the evaluation and update process (S40 of FIG. 2) according to one embodiment. This evaluation and update process may be implemented using a Monte Carlo simulation, e.g., a method based on simulated annealing.
[0107] The processing circuit 10 extracts the maximum value of the total memory amount of the first data structure (first tree) (S400).
[0108] The processing circuit 10 extracts the maximum value of the total memory amount of the second data structure (second tree) (S402).
[0109] The processing circuit 10 compares the maximum total memory value of the first data structure (same as the maximum first memory amount) with the maximum total memory value of the second data structure (same as the maximum second memory amount) (S404).
[0110] If the maximum total memory capacity of the first data structure is equal to or less than the maximum total memory capacity of the second data structure (S404: NO), the processing circuit 10 determines whether a condition considering temperature is satisfied (S406). The temperature is, as a non-limiting example, a temperature parameter when simulated annealing is used as the optimization method.
[0111] The processing circuit 10 determines that the update condition is met by accepting the data based on, for example, a temperature-based probability (for example, the probability obtained by subtracting the maximum total memory value of the second data structure from the maximum total memory value of the first data structure, dividing the result by the temperature, and raising this result to the Napier's number) (S406: YES).
[0112] If it is determined that the update condition is met (S404: YES or S406: YES), the processing circuit 10 updates the first data structure so that the second data structure can be used as the first data structure for the next iteration (S408), and accordingly, the lifetimes in memory of the instructions and / or variables changed by the operation in S20 are also updated.
[0113] If it is determined that the update condition is not met (S404: NO and S406: NO), the processing circuit 10 does not update the current first data structure, but uses it as the first data structure for the next iteration.
[0114] Thereafter, the processing circuit 10 updates the temperature, for example, updates the temperature according to the number of iterations (S410), and then proceeds to the processing of S50 in FIG.
[0115] The flowchart in FIG. 16 is shown as an example, and optimization can be performed using other metaheuristic algorithms.
[0116] Generally, when performing operations such as swapping instructions or changing the lifetime of variables in memory, it takes a considerable amount of time to perform those operations and extract the maximum value of the total memory amount thereafter. On the other hand, by using a segment tree, which is an example not limited to the present disclosure, the time to swap instructions and extract the maximum value of memory amount can be O(log N) when the length of the operation sequence is N. Therefore, by generating a tree based on memory amount, it is possible to shorten the processing time for extracting the maximum value in optimization while ensuring consistency of processing results.
[0117] (Modification) In the above, optimization is performed based only on the maximum amount of memory to be used, but the present invention is not limited to this.
[0118] For example, in evaluating S40 in FIG. 2, the estimated processing time for the entire series of processes can be used as an index.
[0119] The processing circuit 10 can make update decisions using separate evaluation criteria, for example, with memory capacity and processing time as separate indicators.
[0120] The processing circuit 10 can make an update determination using an evaluation value including, for example, (memory capacity) x (processing time).
[0121] The processing circuit 10 calculates, for example, (memory capacity) × (processing time) 2 The update decision can be made using an evaluation value including:
[0122] That is, the objective function can use any evaluation value expressed in a form including at least one of the processing time and the memory usage amount.
[0123] As another example, the processing circuit 10 may use, as an index, not only the maximum memory size but also the second largest memory size, the third largest memory size, etc. In this case, evaluation can be performed using an index (such as variance) that indicates that the same memory size is used on average, or that the memory size is locally large but is reduced on average.
[0124] The processor (other than the processing circuit 10) that executes the series of processes may be, for example, a processor having multiple processing cores and a shared memory that can be accessed from these multiple processing cores faster than a memory area outside the processor. As a representative example, the processor may include at least a GPU or a multi-core CPU.
[0125] In addition, although the above-described embodiments have been given as examples in which the simulated annealing method is not limited to the optimization method, any high-speed and highly accurate method can be used as the optimization method. For example, the information processing device 1 can also use other convergence methods such as a replica exchange method based on random walk or Monte Carlo method as the optimization method. Furthermore, it can also incorporate machine learning methods such as reinforcement learning, or methods such as the Las Vegas algorithm, which are known for reliably obtaining a solution.
[0126] In the present disclosure, an information processing device can be understood as an information processing device having a processor that executes an optimized program, an information processing device having a processor that optimizes a program, or an information processing device having a processor that performs both of these operations.
[0127] Furthermore, the processor of the information processing device does not need to be provided in a single housing; multiple processors connected via a network or the like can work together to perform the optimization of the above-mentioned program, the execution of the optimized program, or both.
[0128] At least one of the information processing devices may have a processor that can convert the intermediate language generated by the information processing method according to each of the above-described embodiments into an executable file (machine language) format suitable for execution by an information processing device that executes a program using a linker, etc. Furthermore, at least one of the information processing devices may have a processor that executes processing related to the executable file (machine language).
[0129] The intermediate language or executable file can be generated based on the data structure updated by the method described in any of the above-mentioned embodiments. In other words, the information processing device can generate the intermediate language, executable file, etc. as a final product based on the data structure updated by the method described in any of the above-mentioned embodiments.
[0130] Some or all of the devices (information processing devices) in the above-described embodiments may be configured as hardware, or may be configured as software (programs) executing information processing by a CPU (Central Processing Unit) or a GPU (Graphics Processing Unit), etc. When software information processing is configured, software that realizes at least some of the functions of each device in the above-described embodiments may be stored on a non-transitory storage medium (non-transitory computer-readable medium) such as a CD-ROM (Compact Disc-Read Only Memory) or a USB (Universal Serial Bus) memory, and the software information processing may be executed by loading the software into a computer. The software may also be downloaded via a communications network. Furthermore, all or part of the software processing may be implemented in a circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array), thereby allowing the software information processing to be executed by hardware.
[0131] The storage medium that stores the software may be a removable medium such as an optical disk, or a fixed medium such as a hard disk or memory. The storage medium may be located inside the computer (such as a main memory or auxiliary memory), or may be located outside the computer.
[0132] 17 is a block diagram showing an example of the hardware configuration of each device (information processing device) in the above-described embodiment. Each device may be realized as a computer 7 including, for example, a processor 71, a main storage device 72 (memory), an auxiliary storage device 73 (memory), a network interface 74, and a device interface 75, all of which are connected via a bus 76.
[0133] Although the computer 7 in FIG. 17 includes one of each component, it may include multiple of the same component. Also, while FIG. 17 shows one computer 7, the software may be installed on multiple computers, and each of the multiple computers may execute the same or different parts of the software. In this case, a distributed computing configuration may be used in which each computer communicates with the other computers via a network interface 74 or the like to execute the processing. In other words, each device (information processing device) in the above-described embodiment may be configured as a system in which one or more computers execute instructions stored in one or more storage devices to achieve its function. Furthermore, the system may be configured such that information sent from a terminal is processed by one or more computers located on a cloud, and the processing results are sent to the terminal.
[0134] The various calculations of each device (information processing device) in the above-described embodiments may be executed in parallel using one or more processors, or using multiple computers via a network. Furthermore, the various calculations may be distributed to multiple processor cores within a processor and executed in parallel. Furthermore, some or all of the processes, means, etc. disclosed herein may be implemented by at least one processor and storage device provided on a cloud that can communicate with computer 7 via a network. Thus, each device in the above-described embodiments may be implemented in the form of parallel computing using one or more computers.
[0135] The processor 71 may be an electronic circuit (processing circuit, processing circuitry, CPU, GPU, FPGA, ASIC, etc.) that at least controls or performs calculations on a computer. The processor 71 may also be a general-purpose processor, a dedicated processing circuit designed to perform a specific calculation, or a semiconductor device that includes both a general-purpose processor and a dedicated processing circuit. The processor 71 may also include an optical circuit or a calculation function based on quantum computing.
[0136] The processor 71 may perform arithmetic processing based on data or software input from each device, etc., configured inside the computer 7, and may output arithmetic results or control signals to each device, etc. The processor 71 may control each component constituting the computer 7 by executing the OS (Operating System) of the computer 7, applications, etc.
[0137] Each device (information processing device) in the above-described embodiments may be realized by one or more processors 71. Here, the processor 71 may refer to one or more electronic circuits arranged on one chip, or may refer to one or more electronic circuits arranged on two or more chips or two or more devices. When multiple electronic circuits are used, the electronic circuits may communicate with each other via wire or wirelessly.
[0138] The main memory device 72 may store instructions executed by the processor 71 and various data, etc., and information stored in the main memory device 72 may be read by the processor 71. The auxiliary memory device 73 is a memory device other than the main memory device 72. Note that 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. The memory device for saving various data, etc. in each device (information processing device) in the above-mentioned embodiments may be realized by the main memory device 72 or the auxiliary memory device 73, or may be realized by an internal memory built into the processor 71. For example, the memory circuit 12 in the above-mentioned embodiment may be realized by the main memory device 72 or the auxiliary memory device 73.
[0139] When each device (information processing device) in the above-described embodiments is configured with at least one storage device (memory) and at least one processor connected (coupled) to this at least one storage device, at least one processor may be connected to one storage device. At least one storage device may be connected to one processor. A configuration in which at least one processor among multiple processors is connected to at least one storage device among multiple storage devices may also be included. This configuration may also be realized by storage devices and processors included in multiple computers. Furthermore, a configuration in which a storage device is integrated with a processor (for example, a cache memory including an L1 cache and an L2 cache) may also be included.
[0140] The network interface 74 is an interface for connecting to the communication network 8 wirelessly or via a wire. The network interface 74 may be an appropriate interface, such as one that conforms to an existing communication standard. The network interface 74 may exchange information with an external device 9A connected via the communication network 8. The communication network 8 may be any one of a WAN (Wide Area Network), a LAN (Local Area Network), a PAN (Personal Area Network), etc., or a combination thereof, as long as information is exchanged between the computer 7 and the external device 9A. An example of a WAN is the Internet, an example of a LAN is IEEE 802.11 or Ethernet (registered trademark), and an example of a PAN is Bluetooth (registered trademark) or NFC (Near Field Communication), etc.
[0141] The device interface 75 is an interface such as USB that directly connects to the external device 9B.
[0142] The external device 9A is a device connected to the computer 7 via a network. The external device 9B is a device directly connected to the computer 7.
[0143] For example, the external device 9A or the external device 9B may be an input device. The input device may be a device such as a camera, a microphone, a motion capture device, various sensors, a keyboard, a mouse, or a touch panel, and provides acquired information to the computer 7. Alternatively, the external device 9A or the external device 9B may be a device equipped with an input unit, a memory, and a processor, such as a personal computer, a tablet terminal, or a smartphone.
[0144] Furthermore, the external device 9A or the external device 9B may be, for example, an output device. The output device may be, for example, a display device such as an LCD (Liquid Crystal Display) or an organic EL (Electro Luminescence) panel, or a speaker that outputs sound or the like. Alternatively, the external device 9A or the external device 9B may be a device including an output unit, a memory, and a processor, such as a personal computer, a tablet terminal, or a smartphone.
[0145] Furthermore, the external device 9A or the external device 9B may be a storage device (memory). For example, the external device 9A may be a network storage or the like, and the external device 9B may be a storage such as an HDD.
[0146] Furthermore, the external device 9A or the external device 9B may be a device having some of the functions of the components of each device (information processing device) in the above-described embodiment. That is, the computer 7 may transmit some or all of the processing results to the external device 9A or the external device 9B, or may receive some or all of the processing results from the external device 9A or the external device 9B.
[0147] 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, a-b, a-c, b-c, or a-b-c. It may also include multiple instances of any element, such as a-a, a-b-b, a-a-b-b-c-c, etc. It also includes the addition of elements other than the listed elements (a, b, and c), such as having d, as in a-b-c-d.
[0148] In this specification (including claims), when expressions such as "using / using data as input / based on / according to / in response to" (including similar expressions) are used, unless otherwise specified, this includes cases where the data itself is used, or where data that has been processed in some way (e.g., data with noise added, normalized data, features extracted from data, intermediate representations of data, etc.) is used. Furthermore, when a statement is made that a result is obtained "using data as input / based on / according to / in response to" (including similar expressions), this includes cases where the result is obtained based solely on the data, or where the result is influenced by other data, factors, conditions, and / or states other than the data, unless otherwise specified. Furthermore, when a statement is made that "data is output" (including similar expressions), 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 noise added, normalized data, features extracted from data, intermediate representations of data, etc.) is used as output, unless otherwise specified.
[0149] When the terms "connected" and "coupled" are used in this specification (including the claims), they are intended as open-ended terms that encompass any of direct connection / coupling, indirect connection / coupling, electrically connection / coupling, communicatively connection / coupling, functionally connection / coupling, and physically connection / coupling. These terms should be interpreted appropriately according to the context in which they are used, but any connection / coupling form that is not intentionally or naturally excluded should be interpreted as being included in these terms without limitation.
[0150] In this specification (including the claims), the expression "A configured to B" may include the physical structure of element A having a configuration capable of performing operation B, and the permanent or temporary setting / configuration of element A being configured / set 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 is configured to actually perform operation B by setting a permanent or temporary program (instruction). Also, if element A is a dedicated processor or dedicated arithmetic circuit, 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 to it.
[0151] When used in this specification (including the claims), terms implying containing or possessing (e.g., "comprising" or "including" and "having"), they are intended to be open-ended terms that include containing or possessing things other than the object designated by the object of the term. When the object of such terms implies no quantity or a singular number (e.g., expressions using the articles "a" or "an"), the expression should be construed as not being limited to a specific number.
[0152] In this specification (including the claims), although expressions such as "one or more" or "at least one" are used in some places and expressions that do not specify a quantity or that imply a singular number (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 that imply a singular number (expressions using the articles a or an) should be interpreted as not necessarily being limited to a specific number.
[0153] In this specification, when a particular advantage / result is described as being obtained from a particular configuration of an embodiment, it should be understood that the same advantage / result can also be obtained from one or more other embodiments having the same configuration, unless otherwise stated. However, it should be understood that the presence or absence of the effect generally depends on various factors, conditions, and / or circumstances, and that the effect is not necessarily obtained by the configuration. The effect is merely obtained by the configuration described in the embodiment when various factors, conditions, and / or circumstances are satisfied, and the effect does not necessarily occur in a claimed invention that defines the same or a similar configuration.
[0154] When terms such as "maximize" and "maximization" are used in this specification (including the claims), they include finding a global maximum, finding an approximation of a global maximum, finding a local maximum, and finding an approximation of a local maximum, and should be interpreted accordingly according to the context in which the term is used. They also include finding approximations of these maxima probabilistically or heuristically. Similarly, when terms such as "minimize" and "minimization" are used, they include finding a global minimum, finding an approximation of a global minimum, finding a local minimum, and finding an approximation of a local minimum, and should be interpreted accordingly according to the context in which the term is used. They also include finding approximations of these minima probabilistically or heuristically. Similarly, when terms such as "optimize" and "optimization" are used, they include finding a global optimum, finding an approximation of a global optimum, finding a local optimum, and finding an approximation of a local optimum, and should be interpreted accordingly according to the context in which the term is used. It also includes finding approximations of these optimum values probabilistically or heuristically.
[0155] In this specification (including claims), when multiple pieces of hardware perform a predetermined process, the pieces of hardware may cooperate to perform the predetermined process, or some of the hardware may perform all of the predetermined process. Furthermore, some of the hardware may perform part of the predetermined process, and other hardware may perform the rest of the predetermined process. In this specification (including claims), when expressions such as "one or more pieces of hardware perform a first process, and the one or more pieces of hardware perform a second process" (including similar expressions) are used, the hardware performing the first process and the hardware performing the second process may be the same or different. In other words, it is sufficient that the hardware performing the first process and the hardware performing the second process are included in the one or more pieces of hardware. Note that hardware may also include an electronic circuit or a device including an electronic circuit.
[0156] In this specification (including the claims), when multiple storage devices (memories) store data, each of the multiple storage devices may store only a portion of the data, or may store the entire data. Also, a configuration in which only some of the multiple storage devices store data may be included.
[0157] The above-described embodiments can also be summarized as follows.
[0158] (1) An information processing device comprising at least one processor, wherein the at least one processor acquires a first data structure including information regarding the execution order of a plurality of instructions and information regarding the amount of memory required to execute each of the instructions, performs a predetermined operation on the first data structure to generate a second data structure in which the information regarding the execution order and the information regarding the amount of memory are updated, acquires an evaluation value based on the second data structure, and if the evaluation value satisfies a first condition, updates the first data structure using the second data structure, the first data structure and the second data structure are data structures that support changes and value calculations for a predetermined section, and the at least one processor executes the process of generating the second data structure, the process of acquiring the evaluation value, and the process of updating the first data structure if the evaluation value satisfies the first condition multiple times.
[0159] Updating the first data structure using the above-mentioned second data structure includes not only the process of overwriting the first data structure with the second data structure, but also the case where the second data structure is used as the first data structure in subsequent iteration processes.
[0160] Furthermore, "executing multiple times" may include repeatedly executing, which may include execution by loop (iteration).
[0161] (2) The information processing device according to (1), wherein the first data structure and the second data structure acquire, as information about the memory amount, the total amount of memory required at the timing of executing each instruction.
[0162] The total memory amount mentioned above may not be an exact total memory amount, but may be an approximate value of the total memory amount.
[0163] (3) The information processing device according to (1) or (2), wherein the first data structure and the second data structure are at least one of a segment tree, a square partition, or a balanced binary tree.
[0164] (4) The information processing device according to any one of (1) to (3), wherein the predetermined operation is at least one of the following, or a combination of a plurality of operations: an operation of adding a selected instruction at a selected time; an operation of deleting an instruction at a selected time; an operation of moving an instruction at a selected time to another selected time; an operation of storing at least one variable used in an instruction at a selected time in a second memory having a slower access speed than the first memory if the variable is stored in a first memory, and storing the variable in the first memory if the variable is stored in the second memory; an operation of deleting at least one variable stored in the first memory at the selected time from the first memory and adding an instruction to recalculate the variable before an instruction using the variable; or an operation of deleting an instruction to recalculate at least one variable stored in the first memory at the selected time and storing the variable in the first memory at least until an instruction using the variable.
[0165] (5) The information processing device according to (4), wherein the selected time is a randomly selected time.
[0166] (6) The information processing device according to (4), wherein the selected command is a randomly selected command.
[0167] (7) The information processing device according to any one of (1) to (6), wherein the predetermined operation to be executed on the first data structure is selected randomly from among a plurality of operations.
[0168] (8) The information processing device according to any one of (1) to (7), wherein the evaluation value is a value calculated by performing a value search for a predetermined section of the second data structure.
[0169] (9) The information processing device according to any one of (1) to (8), wherein the evaluation value is a value based on the amount of memory required for each command in the second data structure.
[0170] (10) The information processing device according to (9), wherein the evaluation value is a maximum value of the memory amount required for each command of the second data structure.
[0171] (11) The information processing device according to any one of (1) to (10), wherein the first condition is a condition relating to at least one of memory amount and processing time.
[0172] (12) The information processing device according to (11), wherein the first condition is that the maximum amount of memory required for each instruction of the second data structure is smaller than the maximum amount of memory required for each instruction of the first data structure.
[0173] The above configuration is a concept that also includes a case where the conditional expression determines whether the maximum amount of memory required for each process of the second data structure is less than or equal to the maximum amount of memory required for each process of the first data structure.
[0174] (13) The information processing device according to any one of (1) to (12), wherein the evaluation value is a value based on the computational cost required to execute the plurality of instructions in the second data structure and the amount of memory required for each instruction in the second data structure.
[0175] (14) An information processing device according to any one of (1) to (13), wherein the at least one processor repeatedly executes the process of generating the second data structure, the process of obtaining the evaluation value, and the process of updating the first data structure if the evaluation value satisfies the first condition, until the second condition is satisfied.
[0176] (15) The information processing device according to (14), wherein the second condition is at least one of the following: the repeated execution has been performed a predetermined number of times or more; a condition relating to a predetermined parameter; a predetermined time has elapsed; there has been no update processing during the repeated execution of a predetermined number of times; there has been no update processing for a predetermined time; or a combination of these conditions.
[0177] (16) The information processing device according to any one of (1) to (15), wherein the at least one processor generates the first data structure from a plurality of instructions described in a graph.
[0178] (17) The information processing device according to any one of (1) to (16), wherein the at least one processor generates an intermediate language using a data structure in which the predetermined operation has been executed multiple times.
[0179] (18) The information processing device according to any one of (1) to (16), wherein the at least one processor generates machine code using a data structure in which the predetermined operation has been executed multiple times.
[0180] (19) An intermediate language generation method for generating an intermediate language using the information processing device according to (17).
[0181] (20) A machine language generation method for converting the intermediate language according to (17) into machine language.
[0182] (21) A data structure generation method for generating a data structure using the information processing device according to any one of (1) to (18).
[0183] (22) An information processing method, in which at least one processor acquires a first data structure including information regarding the execution order of a plurality of instructions and information regarding the amount of memory required to execute each of the instructions, performs a predetermined operation on the first data structure to generate a second data structure in which the information regarding the execution order and the information regarding the amount of memory are updated, acquires an evaluation value based on the second data structure, and if the evaluation value satisfies a first condition, updates the first data structure using the second data structure, the first data structure and the second data structure are data structures that support changes and value calculations for a predetermined section, and the at least one processor executes the process of generating the second data structure, the process of acquiring the evaluation value, and the process of updating the first data structure if the evaluation value satisfies the first condition multiple times.
[0184] Furthermore, the information processing method may further include a method having the features of any of the devices or methods described in any of (2) to (21) above.
[0185] (23) A program that causes at least one processor to execute an information processing method that includes: acquiring a first data structure including information regarding the execution order of a plurality of instructions and information regarding the amount of memory required to execute each of the instructions; performing a predetermined operation on the first data structure to generate a second data structure in which the information regarding the execution order and the information regarding the amount of memory are updated; acquiring an evaluation value based on the second data structure; and updating the first data structure using the second data structure if the evaluation value satisfies a first condition, wherein the first data structure and the second data structure are data structures that support changes and value calculations for a predetermined section; and the at least one processor executes the process of generating the second data structure, the process of acquiring the evaluation value, and the process of updating the first data structure if the evaluation value satisfies the first condition multiple times.
[0186] Furthermore, the program may also be a program that specifically realizes, using hardware resources, information processing by software having the characteristics of any of the devices or methods described in any of (2) to (21) above.
[0187] Although the embodiments of the present disclosure have been described in detail above, the present disclosure is not limited to the individual embodiments described above. Various additions, modifications, substitutions, and partial deletions are possible within the scope of the conceptual idea and spirit of the present disclosure, which is derived from the content defined in the claims and their equivalents. For example, when numerical values or formulas are used in the above-described embodiments, they are shown for illustrative purposes and do not limit the scope of the present disclosure. Furthermore, the order of each operation shown in the embodiments is also illustrative and does not limit the scope of the present disclosure.
[0188] 1: information processing device, 10: processing circuit, 12: memory circuit, 14: input / output I / F
Claims
1. An information processing device comprising at least one processor, wherein the at least one processor acquires a first data structure including information regarding an execution order of a plurality of instructions and information regarding the amount of memory required to execute each of the instructions, generates a second data structure in which the information regarding the execution order and the information regarding the amount of memory required to execute each of the instructions are updated by performing a predetermined operation on the first data structure, acquires an evaluation value based on the second data structure, and if the evaluation value satisfies a first condition, updates the first data structure using the second data structure, the first data structure and the second data structure are data structures that support changes and value determination for a predetermined section, and the at least one processor executes the process of generating the second data structure, the process of acquiring the evaluation value, and the process of updating the first data structure if the evaluation value satisfies the first condition, multiple times.
2. The information processing device according to claim 1, wherein the first data structure and the second data structure acquire, as information relating to the memory amount, the total amount of memory required at the timing of executing each of the first and second data structures.
3. The information processing device according to claim 1, wherein the first data structure and the second data structure are at least one of a segment tree, a square partition, or a balanced binary tree.
4. The information processing device of claim 1, wherein the specified operation is at least one of the following, or a combination of two or more: an operation of adding a selected instruction at a selected time; an operation of deleting an instruction at a selected time; an operation of moving an instruction at a selected time to another selected time; an operation of storing at least one variable used in an instruction at a selected time in a second memory having a slower access speed than the first memory when it is stored in a first memory, and storing the variable in the first memory when it is stored in the second memory; an operation of deleting at least one variable stored in the first memory at the selected time from the first memory, and adding an instruction to recalculate the at least one variable before an instruction in which the at least one variable is used; or an operation of deleting an instruction to recalculate at least one variable stored in the first memory at the selected time, and storing the variable in the first memory at least until an instruction in which the variable is used.
5. The information processing device according to claim 4, wherein the selected time is a randomly selected time.
6. The information processing device according to claim 4, wherein the selected instruction is a randomly selected instruction.
7. The information processing device according to claim 1, wherein the predetermined operation to be performed on the first data structure is randomly selected from a plurality of operations.
8. The information processing device according to claim 1, wherein the evaluation value is a value calculated by performing a value search for a predetermined section of the second data structure.
9. The information processing device according to claim 1, wherein the evaluation value is a value based on the amount of memory required for each command of the second data structure.
10. The information processing device according to claim 9, wherein the evaluation value is a maximum value of the amount of memory required for each command of the second data structure.
11. The information processing device according to claim 1, wherein the first condition is a condition relating to at least one of memory amount and processing time.
12. The information processing device according to claim 11, wherein the first condition is that the maximum amount of memory required for each instruction of the second data structure is smaller than the maximum amount of memory required for each instruction of the first data structure.
13. The information processing device according to claim 1, wherein the evaluation value is a value based on the computational cost required to execute a plurality of instructions in the second data structure and the amount of memory required for each instruction in the second data structure.
14. The information processing device according to claim 1, wherein the at least one processor repeatedly executes the process of generating the second data structure, the process of obtaining the evaluation value, and the process of updating the first data structure when the evaluation value satisfies the first condition, until the second condition is satisfied.
15. The information processing device according to claim 14, wherein the second condition is at least one of the following: the repeated execution has been performed a predetermined number of times or more; a condition related to a predetermined parameter; a predetermined time has elapsed; there has been no update processing during a predetermined number of repeated executions; there has been no update processing for a predetermined time; or a combination of these conditions.
16. The information processing device according to claim 1, wherein the at least one processor generates the first data structure from a plurality of instructions described in a graph.
17. An information processing device according to any one of claims 1 to 16, wherein the at least one processor generates an intermediate language using a data structure in which the specified operation has been executed multiple times.
18. An information processing device according to any one of claims 1 to 16, wherein the at least one processor generates machine code using a data structure in which the specified operation has been executed multiple times.
19. An intermediate language generating method, comprising: generating an intermediate language using the information processing device according to claim 17.
20. A machine code generating method, comprising: generating machine code using the information processing device according to claim 18.
21. A data structure generating method, comprising: generating a data structure using an information processing device according to any one of claims 1 to 16.
22. An information processing method, comprising: at least one processor: acquiring a first data structure including information regarding an execution order of a plurality of instructions and information regarding the amount of memory required to execute each of the instructions; performing a predetermined operation on the first data structure to generate a second data structure in which the information regarding the execution order and the information regarding the amount of memory are updated; acquiring an evaluation value based on the second data structure; and if the evaluation value satisfies a first condition, updating the first data structure using the second data structure; the first data structure and the second data structure are data structures that support changes and value determination for a predetermined section; and the at least one processor: executing a process of generating the second data structure, a process of acquiring the evaluation value, and a process of updating the first data structure if the evaluation value satisfies the first condition, multiple times.
23. A program for causing at least one processor to execute an information processing method comprising the steps of: acquiring a first data structure including information regarding an execution order of a plurality of instructions and information regarding the amount of memory required to execute each of the instructions; performing a predetermined operation on the first data structure to generate a second data structure in which the information regarding the execution order and the information regarding the amount of memory required to execute each of the instructions have been updated; acquiring an evaluation value based on the second data structure; and if the evaluation value satisfies a first condition, updating the first data structure using the second data structure, wherein the first data structure and the second data structure are data structures that support changes and value determination for a predetermined section, and the at least one processor executes the process of generating the second data structure, the process of acquiring the evaluation value, and the process of updating the first data structure if the evaluation value satisfies a first condition, multiple times.
Citation Information
Patent Citations
Program translation processor
JP1992213118A
Program parallelization device, method therefor, and program
JP2006018446A
Compiler apparatus
JP2007094731A
Cited By
Method and apparatus for converting dynamic indexing to static indexing and performing scalarization
TWI946064B
