Information processing device, machine learning method, and computer-readable storage medium
By dynamically adjusting data types and forming computing clusters in deep learning, the problem of extended processing time in existing technologies is solved, and more efficient computing efficiency is achieved.
Patent Information
- Application Number
- CN202110740440.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-08-19
- Filing Date
- 2021-06-30
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-06-30
AI Technical Summary
Existing technologies find it difficult to effectively utilize the characteristics of changing computational precision in deep learning, resulting in extended processing time and delays caused by data type conversion, making it difficult to improve overall computational efficiency.
By preliminarily determining the data type of the operation in each iteration and adjusting the data type based on the operation performance evaluation, an operation cluster is formed, and operations are performed using more accurate data types, thereby reducing data type conversion time.
It effectively reduces the overall processing time, improves the computational efficiency of deep learning, avoids delays caused by data type conversion, and keeps processing time to a minimum.
Smart Images

Figure CN114077890B_ABST
Abstract
Description
Technical Field
[0001] The embodiments discussed herein relate to an information processing apparatus, a machine learning method, and a non-transitory computer-readable storage medium storing a machine learning program. Background Art
[0002] In recent years, various companies have been working to develop processors optimized for deep learning. The same is true for machine learning, a method of machine learning.
[0003] The operations used in deep learning are primarily tensor operations, characterized by decreasing deviations in the values of each element of a tensor as learning progresses. Focusing on these unique properties of many operations performed in deep learning, processors designed for deep learning have been released, such as those that perform inference operations using 8-bit integers. Generally, using 8-bit or 16-bit fixed-point numbers to perform operations can reduce computation time.
[0004] These processors are expected to improve power-to-performance by performing operations with lower precision. However, because the precision of existing processors is predetermined by hardware, the characteristics of operations performed in deep learning, where the change in each element of a tensor becomes smaller as learning progresses, are not fully utilized. Furthermore, even operations used in deep learning have the disadvantage that if the precision of the operations is reduced, learning may not proceed as expected. Specifying such operations is difficult.
[0005] Therefore, there are technologies for determining whether to perform 32-bit floating-point or 8-bit fixed-point operations based on the operation content. However, among the operations performed in one iteration of deep learning, some operations may cause the change in each element of the tensor to increase significantly even after learning has progressed to a certain extent. In such operations where the change in each element increases, if the operation precision is reduced in advance based on the operation content, there is a possibility that accurate operation will be difficult to perform.
[0006] Note that as a technique for arithmetic processing in deep learning, there is the following prior art: each element of the input tensor is pre-calculated to convert the operation into an expression form of a power of 2, and the operation is performed by using the weight tensor for the convolution operation and the input tensor addition and shift operations. In addition, there is the following prior art: statistical information about the bit distribution as a result of executing a command on data with fixed-point numbers is obtained, and the decimal point position of the fixed-point number is updated. In addition, there is the following prior art: a first operation is identified from a series of operations, a second operation is selected to be grouped with the first operation, and the input data is processed by the grouped operation.
[0007] Examples of related art include Japanese Laid-Open Patent Publication No. 2018-181313, Japanese Laid-Open Patent Publication No. 2018-124681, and Japanese Laid-Open Patent Publication No. 2019-169150.
[0008] However, when converting a 32-bit floating point number to a 16-bit fixed point number or an 8-bit fixed point number, and when converting a 16-bit fixed point number or an 8-bit fixed point number to a 32-bit floating point number, a delay occurs due to the data type conversion. Therefore, when performing an operation after converting a 32-bit floating point number to an 8-bit fixed point number, and then performing a process such as returning to a 32-bit floating point number again, the operation time is not necessarily shortened each time, and there is no guarantee that the processing time is reduced. For example, there is a case where converting the data type takes time, and when considered as a whole, high-speed operations are enabled by performing processes using 32-bit floating point numbers. In this way, when focusing on individual operations and determining the data type for each operation so that the local processing time is shortened, there is a possibility that it is difficult to keep the processing time for the entire deep learning to a minimum. Therefore, it is difficult to improve the efficiency of deep learning. Here, since performing operations within the processing time consumes electricity and ensures computing resources, the cost associated with the operation can be considered to be proportional to the processing time, and therefore the processing time is sometimes referred to as the computing cost.
[0009] Furthermore, even if the prior art is used to perform operations by performing addition and shift operations using the input tensor and the weight tensor of the convolution operation, the efficiency of each operation can be improved, but it is difficult to keep the processing time of the entire deep learning short. In addition, even in the prior art that updates the decimal point position of a fixed-point number based on statistical information of the bit distribution as a result of executing a command, the processing time for the entire deep learning is not taken into account, and it is difficult to keep the processing time short. Similarly, even in the prior art that groups a series of operations to process input data, it is difficult to keep the processing time of the entire deep learning short because the delay caused by data type conversion is not taken into account. Therefore, it is difficult to improve the efficiency of deep learning by any technology in the prior art.
[0010] In aspects of the embodiments disclosed below, solutions are provided for improving the efficiency of deep learning. Summary of the Invention
[0011] According to one aspect of the embodiment, an information processing device includes: an operation unit that sequentially performs a series of multiple operations in machine learning; a preliminary data type determination unit that determines a data type to be used for each of the multiple operations, the multiple operations being a series of operations to be used in machine learning processing; a data type modification unit that reduces a total processing time by modifying the determined data type to be used in each operation to a data type that is more precise than the data type defined by the determination, the total processing time being a time period including the operation time of each of the multiple operations and the conversion time taken to convert the data type; and an execution control unit that causes the operation unit to execute each of the multiple operations by using the modified data type of each of the multiple operations.
[0012] The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
[0013] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a hardware configuration diagram of an information processing device;
[0015] Figure 2 It is a diagram used to illustrate the learning process;
[0016] Figure 3 is a block diagram of an information processing device according to one embodiment;
[0017] Figure 4 is a diagram illustrating an example of a computation graph.
[0018] Figure 5 is a diagram showing an example of operation time and conversion time;
[0019] Figure 6 is a diagram showing an example of a calculation time management table and a conversion time management table;
[0020] Figure 7 is a graph representing a cluster of operations;
[0021] Figure 8 is a diagram for illustrating modifications of data types for operations in a computation graph; and
[0022] Figure 9 This is a flowchart of deep learning of an information processing device according to one embodiment. DETAILED DESCRIPTION
[0023] The following will describe in detail the embodiments of the information processing device, machine learning method, and machine learning program disclosed in this application based on the accompanying drawings. Note that the following embodiments do not limit the information processing device, machine learning method, and machine learning program disclosed in this application.
[0024] [First embodiment]
[0025] Figure 1 This is a hardware configuration diagram of an information processing device. Information processing device 1 performs deep learning. The following will describe information processing device 1 that performs deep learning. However, when performing another type of machine learning, information processing device 1 also has a similar function. There is a case where information processing device 1 is referred to as a node. Figure 1 As shown, the information processing device 1 includes a processor 11 , a memory 12 , a storage device 13 and a network interface 14 .
[0026] For example, a central processing unit (CPU) or a graphics processing unit (GPU) may be used as the processor 11. The processor 11 is connected to a memory 12, a storage device 13, and a network interface 14 via a bus.
[0027] The memory 12 is a volatile memory and temporarily stores data for learning read from the storage device 13 until the data is transferred to the processor 11. The memory 12 also stores various data used for arithmetic processing performed by the processor 11.
[0028] The storage device 13 is a nonvolatile memory such as a hard disk drive (HDD) or a solid state drive (SSD). The storage device 13 stores learning data used when the information processing device 1 performs deep learning.
[0029] The network interface 14 is an interface connected to another information processing device 1 via Ethernet (registered trademark) or InfiniBand (registered trademark). The network interface 14 relays data transmission and reception between the processor 11 and the processor 11 installed in another information processing device 1.
[0030] The information processing device 1 uses Figure 2 The multi-layer neural network shown is used to perform deep learning. Figure 2 is a diagram for explaining the learning process. The information processing device 1 improves the recognition accuracy by repeating the operation in each layer. For example, Figure 2 As shown in FIG, in the case where operations #1 to #N are respectively performed in each layer, the information processing device 1 repeats operations #1 to #N using the learning data. Figure 2As shown in FIG, a learning cycle 2 in which operations #1 to #N are repeatedly performed once is called an iteration. For example, the information processing device 1 performs deep learning by repeating iterations multiple times.
[0031] Next, we will refer to Figure 3 The function of deep learning provided in the information processing device 1 according to the present embodiment is described. Figure 3 is a block diagram of an information processing apparatus according to an embodiment.
[0032] like Figure 3 As shown, the information processing device 1 includes a deep learning framework 10, a user application execution unit 20 and a learning data storage unit 30. For example, by Figure 1 The illustrated storage device 13 realizes a learning data memory unit 30. The learning data memory unit 30 stores a plurality of learning data used in deep learning in advance.
[0033] The user application execution unit 20 activates the deep learning application created by the operator by reading and executing the pre-input user program. Then, the user application execution unit 20 outputs an execution command for deep learning specified by the activated user application to the execution control unit 102.
[0034] The Deep Learning Framework 10 is a set of software libraries developed to easily create deep learning applications. Figure 1 The processor 11 and memory 12 shown implement the deep learning framework 10. The deep learning framework 10 includes an operation unit 101, an execution control unit 102, a data type modification unit 103, a preliminary data type determination unit 104, a learning data reading unit 105, a management table storage unit 106, and a calculation graph storage unit 107.
[0035] The calculation graph storage unit 107 stores a calculation graph that illustrates the various operation processes included in one iteration. The calculation graph has nodes representing each operation, and the operation content and data type to be used are registered for each node. Thereafter, the preliminary data type determination unit 104 temporarily registers the data type of each operation in the calculation graph stored by the calculation graph storage unit 107. Next, the data type control unit 132 of the data type modification unit 103 modifies the temporarily registered data type, and then the data type of each operation is registered in the calculation graph storage unit 107.
[0036] Figure 4 is a diagram illustrating an example of a computation graph. Figure 4The illustrated computation graph 200 includes seven operations indicated by nodes 201 to 207. Information about the operations performed by nodes 201 to 207 is registered in the computation graph 200. For example, node 203 performs an operation that specifies the operation results of nodes 201 and 202 as input, and the result of this operation is used as input to node 204.
[0037] According to the deep learning to be performed, the calculation graph 200 in a state where the data type to be used in each operation is not registered is registered in the calculation graph storage unit 107. For example, the user application execution unit 20 may register the calculation graph together with the deep learning execution instruction according to the deep learning to be performed in the calculation graph storage unit 107.
[0038] The operation unit 101 performs operations designated as deep learning operations to perform deep learning. The operation unit 101 receives input of learning data from the operation instruction unit 121 of the execution control unit 102 at the beginning of each iteration. Thereafter, the operation unit 101 receives an operation execution instruction from the operation instruction unit 121 of the execution control unit 102. Then, the operation unit 101 reads out the calculation graph stored in the calculation graph storage unit 107 to use the learning data as input, perform operations according to the calculation graph, and end one iteration. When all operations included in one iteration are completed, the operation unit 101 outputs an iteration completion notification to the operation instruction unit 121. The operation unit 101 repeats the arithmetic processing until it receives a notification of deep learning completion from the operation instruction unit 121.
[0039] The execution control unit 102 comprehensively controls various processes in deep learning. The execution control unit 102 includes an operation instruction unit 121, a management table creation instruction unit 122, an operation data type control instruction unit 123, and a data read instruction unit 124.
[0040] The operation instruction unit 121 receives an instruction to start deep learning from the management table creation instruction unit 122. Then, the operation instruction unit 121 starts deep learning operation. The operation instruction unit 121 performs the following processing at the start of each iteration in deep learning.
[0041] The operation instruction unit 121 outputs an acquisition request for learning data to be used for learning to the data read instruction unit 124. Then, the operation instruction unit 121 receives input of learning data from the data read instruction unit 124 as a response to the acquisition request.
[0042] Next, the operation instruction unit 121 instructs the operation data type control instruction unit 123 to perform operation data type determination processing. Thereafter, the operation instruction unit 121 receives notification of data type determination from the operation data type control instruction unit 123. Then, the operation instruction unit 121 outputs the learning data to the operation unit 101 and instructs the operation unit 101 to perform operation.
[0043] Thereafter, the operation instruction unit 121 receives input of an iteration completion notification from the operation unit 101. Then, the operation instruction unit 121 repeats the processing of acquiring learning data, giving an execution instruction for operation data type determination processing, and causing the operation unit 101 to execute operation.
[0044] Operation instruction unit 121 causes operation unit 101 to repeat operations in each layer for each iteration until deep learning is complete. Operation instruction unit 121 verifies deep learning completion when predetermined conditions are met, such as when a predetermined number of iterations have completed or when recognition accuracy exceeds 90%. Recognition accuracy is determined by performing recognition processing using test data each time a predetermined number of iterations have completed. Upon verification of deep learning completion, operation instruction unit 121 transmits a notification of deep learning completion to operation unit 101.
[0045] The management table creation instruction unit 122 receives the deep learning execution instruction input from the user application execution unit 20 to the execution control unit 102. The management table creation instruction unit 122 then instructs the single value calculation unit 131 of the data type modification unit 103 to calculate the operation time required to execute each operation included in one iteration and the conversion time required to convert the operation data. Thereafter, the management table creation instruction unit 122 receives a management table creation completion response from the single value calculation unit 131. The management table creation instruction unit 122 then instructs the operation instruction unit 121 to start deep learning.
[0046] The operation data type control instruction unit 123 receives an instruction to execute the operation data type determination process from the operation instruction unit 121. Then, the operation data type control instruction unit 123 instructs the preliminary data type determination unit 104 to execute the data type preliminary determination process. Here, the preliminary data type determination is a process of temporarily determining the data type that is considered to be optimal for each operation, taking into account the state of the operation result of each operation.
[0047] Thereafter, the operation data type control instruction unit 123 receives a notification of the provisional determination of the data type for each operation from the preliminary data type determination unit 104. Next, the operation data type control instruction unit 123 instructs the data type control unit 132 of the data type modification unit 103 to modify the data type. Thereafter, the operation data type control instruction unit 123 receives a notification of the conclusion regarding the data type from the data type control unit 132. The operation data type control instruction unit 123 then transmits a notification of the data type determination to the operation instruction unit 121.
[0048] The data reading instruction unit 124 receives a request from the operation instruction unit 121 to obtain learning data to be used for learning. The data reading instruction unit 124 then instructs the learning data reading unit 105 to read the learning data to be used for learning. Thereafter, the data reading instruction unit 124 obtains the learning data to be used for learning from the learning data reading unit 105. The data reading instruction unit 124 then outputs the obtained learning data to the operation instruction unit 121.
[0049] Subsequently, each time an iteration ends, the data read instruction unit 124 receives a request for acquiring learning data from the operation instruction unit 121. The data read instruction unit 124 then instructs the learning data reading unit 105 to read the learning data to acquire the learning data, and outputs the acquired learning data to the operation instruction unit 121 for each iteration.
[0050] The learning data reading unit 105 receives an instruction to read learning data to be used for learning from the data reading instruction unit 124. Then, the learning data reading unit 105 reads the designated learning data from the learning data memory unit 30. Thereafter, the learning data reading unit 105 sends the read learning data to the data reading instruction unit 124.
[0051] The preliminary data type determination unit 104 receives an execution instruction for preliminary data type determination processing from the operation data type control instruction unit 123. The preliminary data type determination unit 104 then obtains the operation result of each operation in the immediately preceding iteration from the operation unit 101. Furthermore, the preliminary data type determination unit 104 calculates a representable ratio based on the decimal point position determined in the operation result of each operation. This representable ratio is the ratio of the number of tensor elements that can be represented using 8-bit fixed-point numbers in operations using 32-bit floating-point numbers as the data type. Next, for operations where the calculated representable ratio exceeds a threshold, the preliminary data type determination unit 104 calculates a fluctuation per iteration, indicating the change in the representable ratio. The preliminary data type determination unit 104 then verifies whether the calculated fluctuation is less than a fluctuation threshold. If the fluctuation is less than the fluctuation threshold, the preliminary data type determination unit 104 verifies that the decimal point position of the relevant operation has converged, and therefore preliminarily determines the operation data type of the relevant operation to be an 8-bit fixed-point number. Here, the case of conversion to 8-bit fixed point is described, and in the case of conversion to another low-precision data type with reduced information amount (such as 16-bit fixed point), the preliminary data type determination unit 104 can similarly preliminarily determine the data type of each operation.
[0052] Thereafter, the preliminary data type determination unit 104 registers the preliminarily determined data type of each operation in the calculation graph stored by the calculation graph storage unit 107, and updates the data type information to be used for each operation in the calculation graph. Figure 4 As shown in the lower part of , when viewed facing the page, the data type used in each of the nodes 201 to 207 is registered in the calculation graph 200. Figure 4 , the preliminary data type determination unit 104 temporarily determines that 8-bit fixed-point numbers are used as the data types at the nodes 203, 205, and 206 represented by filled circles. Furthermore, the preliminary data type determination unit 104 temporarily determines that 32-bit floating-point numbers are used at the nodes 201, 202, 204, and 207. Thereafter, the preliminary data type determination unit 104 outputs a notification of the temporary determination of the data type of each operation to the operation data type control instruction unit 123.
[0053] The data type modifying unit 103 modifies the temporarily determined data type of each operation according to the processing time of the entire iteration. The data type modifying unit 103 includes a single value calculating unit 131 and a data type control unit 132.
[0054] The single value calculation unit 131 receives an instruction to calculate the operation time taken for each operation included in executing one iteration and the conversion time taken for converting the operation data from the management table creation instruction unit 122. Then, the single value calculation unit 131 acquires the calculation graph from the calculation graph storage unit 107.
[0055] Next, the single value calculation unit 131 uses a profiler to calculate the operation time of each operation by performing the operation of each node in the calculation graph using a value given in advance to calculate the operation time. In this case, the single value calculation unit 131 uses both 32-bit floating point numbers and 8-bit fixed point numbers as the values used to calculate the operation time, to calculate the operation time when using 32-bit floating point numbers and the operation time when using 8-bit fixed point numbers. Here, the single value calculation unit 131 treats each operation in the calculation graph as a different operation from each other. For example, even if the operation is of the same type, when the operation is performed at different timings in one iteration, the single value calculation unit 131 also treats these operations as different operations.
[0056] exist Figure 4 In the case of the calculation graph 200 shown in FIG. 200 , for each operation performed in nodes 201 to 207 , the single value calculation unit 131 calculates the operation time when using 32-bit floating point numbers and the operation time when using 8-bit fixed point numbers. Figure 5 As shown, the single-value calculation unit 131 calculates the operation time for the operation used in each of the nodes 201 to 207 . Figure 5 is a diagram showing an example of operation time and conversion time. Figure 5 In each of nodes 201 to 207, the operation name, the operation time when using 32-bit floating-point numbers, and the operation time when using 8-bit fixed-point numbers are recorded. The operation name is identification information assigned to uniquely identify each operation executed in nodes 201 to 207.
[0057] Then, the single value calculation unit 131 generates Figure 6 The operation time management table 211 shown registers, for each operation, the operation time when using 32-bit floating-point numbers and the operation time when using 8-bit fixed-point numbers. Figure 6 It is a diagram showing an example of a calculation time management table and a conversion time management table.
[0058] Next, the single value calculation unit 131 uses the data previously given to calculate the operation time to calculate the conversion time when performing data conversion between each node. In this case, the single value calculation unit 131 also calculates the conversion time for both the conversion from 32-bit floating point numbers to 8-bit fixed point numbers and the conversion from 8-bit fixed point numbers to 32-bit floating point numbers.
[0059] For example, Figure 5 As shown, in Figure 4In the case of the calculation diagram 200 shown, the single value calculation unit 131 calculates the conversion time for the conversion from 32-bit floating point numbers to 8-bit fixed point numbers for the data type conversions 221 to 225. In addition, the single value calculation unit 131 calculates the conversion time for the conversion from 8-bit fixed point numbers to 32-bit floating point numbers for the data type conversions 221 to 225. Figure 5 In the example, the conversion time for converting from a 32-bit floating point number to an 8-bit fixed point number is recorded above the balloons attached to the arrows indicating each of the data type conversions 221 to 225, and the conversion time for converting from an 8-bit fixed point number to a 32-bit floating point number is recorded below the balloons. Here, in this embodiment, the single-value calculation unit 131 omits calculation of the conversion time between operations whose data types have been determined to be consistent. For example, because nodes 205 and 206 in the calculation graph 200 are required to use the same data type, the single-value calculation unit 131 does not calculate the conversion time for data conversion between nodes 205 and 206.
[0060] Then, the single value calculation unit 131 generates Figure 6 The conversion time management table 212 shown has registered therein the conversion times of both the conversion from a 32-bit floating point number to an 8-bit fixed point number and the conversion from an 8-bit fixed point number to a 32-bit floating point number.
[0061] Thereafter, the single-value calculation unit 131 stores the operation time management table 211 in the management table storage unit 106. Furthermore, the single-value calculation unit 131 stores the conversion time management table 212 in the management table storage unit 106. Then, the single-value calculation unit 131 notifies the management table creation instruction unit 122 of a management table creation completion response.
[0062] Here, the single value calculation unit 131 can use the analyzer to pre-calculate the operation time and conversion time before receiving the deep learning execution command. In addition, the single value calculation unit 131 can pre-calculate the operation time and conversion time of each operation using the properties of each operation determined by the tensor type, operation type, and parameters used in each operation.
[0063] Upon receiving the data type modification instruction from the operation data type control instruction unit 123, the data type control unit 132 acquires the operation time management table 211 and the conversion time management table 212 from the management table storage unit 106. In addition, the data type control unit 132 acquires the calculation graph from the calculation graph storage unit 107.
[0064] Here, the total processing time for one iteration is calculated by summing the operation time and data type conversion time of each operation. For example, the provisional total processing time for one iteration is calculated by the following mathematical formula (1).
[0065] Ctotal =C o8 +C o32 +C c8→32 +C c32→8 …(1)
[0066] Here, C total Indicates the total processing time. In addition, C o8 Indicates the processing time for summing the operation group using 8-bit fixed-point numbers. o32 Indicates the processing time for summing the operation groups that perform operations using 32-bit floating-point numbers. c8→32 Indicates the conversion time for the data type conversion from 8-bit fixed-point number to 32-bit floating-point number. c32→8 Indicates the conversion time for summing the data type conversion from 32-bit floating-point numbers to 8-bit fixed-point numbers.
[0067] The data type control unit 132 performs data type modification on the temporary data type to minimize the total processing time expressed by the mathematical formula (1). Here, as a data type conversion, the data type control unit 132 converts the data type used in consecutive operations using the same data type. Thus, the data type control unit 132 collectively clusters consecutive operations using the same data type in the computation graph. For example, the data type control unit 132 constructs clusters using the intervals between operations that switch data types in the computation graph as boundaries.
[0068] When using Figure 4 When the calculation diagram 200 is shown, the data type control unit 132 is as follows Figure 7 Shown are computing clusters of nodes 201 to 207 . Figure 7 In this case, the data type control unit 132 generates a cluster 231 including nodes 201 and 202, a cluster 232 including node 203, a cluster 233 including node 204, a cluster 234 including nodes 205 and 206, and a cluster 235 including node 207.
[0069] Next, the data type control unit 132 specifies the cluster to be used for performing operations using 8-bit fixed-point numbers as the data type. Figure 4 In the case of the calculation graph in , the data type control unit 132 specifies cluster 232 and cluster 234 as clusters that perform operations using 8-bit fixed-point numbers as data types.
[0070] Next, in the following mathematical formula (2), the data type control unit 132 calculates the processing time of each specified cluster when using 8-bit fixed-point numbers using each value in the operation time management table 211 and the conversion time management table 212. In this case, the data type control unit 132 includes the conversion time caused by the data type conversion in the processing time when using 8-bit fixed-point numbers.
[0071]
[0072] Here, c8 represents the processing time involved when an 8-bit fixed-point number is used for an operation in a cluster. In addition, N represents the number of operations included in the cluster. In addition, N i represents the number of tensors input to the cluster. In addition, N o Indicates the number of tensors output from the cluster. In addition, c i8 represents the computation cost when using 8-bit fixed-point numbers to perform the computation on operation i. n32→8 represents the conversion time taken to convert the data type from 32-bit floating point number to 8-bit fixed point number for input n. m8→32 Indicates the conversion time taken to convert the data type of input m from 8-bit fixed-point numbers to 32-bit floating-point numbers.
[0073] Next, in the following mathematical formula (3), the data type control unit 132 uses each value in the operation time management table 211 and the conversion time management table 212 to calculate the processing time of each designated cluster when using 32-bit floating-point numbers.
[0074]
[0075] Here, c 32 Indicates the processing time involved when 32-bit floating point numbers are used for operations in the cluster. In addition, c i32 represents the operation cost when the operation i is performed using 32-bit floating-point numbers.
[0076] Since the operation name is also registered together in each node in the calculation graph, the data type control unit 132 searches for each operation time using the operation name as a key, and obtains each operation time from the operation time management table 211. In addition, for data type conversion between operations, the data type control unit 132 searches for data conversion between functions that matches when <data conversion source operation name>-<data conversion destination operation name> is used as a key, and obtains the data conversion from the conversion time management table 212. For example, Figure 8 As shown, the data type control unit 132 obtains the operation time and data type conversion time of each operation. Figure 8 A diagram for explaining the modification of data types of operations in a computation graph.
[0077] Next, the data type control unit 132 compares the processing time when using 8-bit fixed-point numbers with the processing time when using 32-bit floating-point numbers for each specified cluster. If the processing time when using 8-bit fixed-point numbers is equal to or greater than the processing time when using 32-bit floating-point numbers, the data type control unit 132 determines to return the data type of the relevant cluster to 32-bit floating-point numbers.
[0078] For example, the data type control unit 132 will use 8-bit fixed-point numbers when Figure 8 The processing time for cluster 232 in the example is calculated as: 1.0 + 0.5 + 1.2 + 8.2 = 10.9 ms. Furthermore, data type control unit 132 calculates the processing time for cluster 232 when using 32-bit floating-point numbers to be 10.6 ms. In this case, because the processing time when using 8-bit fixed-point numbers is equal to or greater than the processing time when using 32-bit floating-point numbers, data type control unit 132 determines to return the data type of cluster 232 to 32-bit floating-point numbers.
[0079] In addition, the data type control unit 132 will be used when using 8-bit fixed-point numbers Figure 8 The processing time for cluster 234 in the example is calculated as: 0.9 + 2.3 + 1.1 + 1.4 = 5.7 ms. Furthermore, data type control unit 132 calculates the processing time for cluster 234 when using 32-bit floating-point numbers as: 8.6 + 2.3 = 10.9 ms. In this case, because the processing time when using 8-bit fixed-point numbers is shorter than when using 32-bit floating-point numbers, data type control unit 132 determines to maintain the data type of cluster 234 at 8-bit fixed-point numbers.
[0080] Next, the data type control unit 132 modifies the calculation graph by modifying the data type to be used in each operation included in the cluster determined to return a data type of a 32-bit floating point number to a 32-bit floating point number in the calculation graph stored in the calculation graph storage unit 107. Through this process, when viewed facing the page, the calculation graph 200 is modified to Figure 8 The state shown in the lower part of . Thereafter, the data type control unit 132 responds to the operation data type control instruction unit 123 with the notification of the conclusion of the data type. This 8-bit fixed-point number corresponds to an example of the "first data type." In addition, the 32-bit floating-point number corresponds to an example of the "second data type."
[0081] Next, we will refer to Figure 9 The flow of deep learning by the information processing device 1 according to the embodiment will be described. Figure 9 4 is a flowchart of deep learning of an information processing device according to an embodiment.
[0082] The management table creation instruction unit 122 receives the deep learning execution instruction from the user application execution unit 20. The management table creation instruction unit 122 then instructs the single value calculation unit 131 to create a management table. The single value calculation unit 131 uses a predetermined value to perform each operation and uses the analyzer to calculate the operation time of each operation and the conversion time of each data type (step S1). The single value calculation unit 131 then creates the operation time management table 211 and the conversion time management table 212 and stores the created management tables in the management table storage unit 106. Thereafter, the operation data type control instruction unit 123 notifies the operation instruction unit 121 of the completion of the management table creation.
[0083] Upon receiving the notification that the creation of the management table is complete, the operation instruction unit 121 reads the input data (step S2). For example, the operation instruction unit 121 requests the data read instruction unit 124. The data read instruction unit 124 instructs the learning data reading unit 105 to read the learning data. The learning data reading unit 105 receives the instruction from the data read instruction unit 124 and reads the learning data from the learning data memory unit 30. The data read instruction unit 124 obtains the learning data from the learning data reading unit 105 and transmits the obtained learning data to the operation instruction unit 121.
[0084] Next, the operation instruction unit 121 instructs the operation data type control instruction unit 123 to determine the data type. The operation data type control instruction unit 123 receives the instruction from the operation instruction unit 121 and requests the preliminary data type determination unit 104 to preliminarily determine the data type. The preliminary data type determination unit 104 obtains the operation result from the operation unit 101 and calculates the representable ratio based on the 8-bit fixed-point number in the operation result. In addition, the preliminary data type determination unit 104 calculates the fluctuation for each iteration that represents the change in the representable ratio. Then, the preliminary data type determination unit 104 preliminarily determines the data type of each operation based on the representable ratio and the fluctuation (step S3). Thereafter, the preliminary data type determination unit 104 registers the preliminarily determined data type for each operation type in the calculation graph contained in the calculation graph storage unit 107.
[0085] Next, the operation data type control instruction unit 123 instructs the data type control unit 132 to modify the data type. Upon receiving the instruction from the operation data type control instruction unit 123, the data type control unit 132 retrieves the operation time management table 211 and the conversion time management table 212 from the management table storage unit 106. Furthermore, the data type control unit 132 retrieves the calculation graph that registers the preliminarily determined data type from the calculation graph storage unit 107. Next, the data type control unit 132 clusters the operations in the calculation graph. Subsequently, the data type control unit 132 verifies whether verification regarding the data type modification has been completed for all clusters having an 8-bit fixed-point number as a data type (step S4).
[0086] When there are still clusters that have 8-bit fixed-point numbers as data types but have not yet been verified for data type modification (step S4: No), the data type control unit 132 selects a cluster as the data type from the clusters that have 8-bit fixed-point numbers but have not yet been verified (step S5).
[0087] Next, the data type control unit 132 calculates the processing time before modification, which is the processing time when an 8-bit fixed-point number is used in the selected cluster (step S6).
[0088] Subsequently, the data type control unit 132 calculates a modified processing time which is a processing time when 32-bit floating-point numbers are used in the selected cluster (step S7 ).
[0089] Next, the data type control unit 132 verifies whether the pre-modification processing time is equal to or greater than the post-modification processing time (step S8). When the pre-modification processing time is less than the post-modification processing time (step S8: No), the data type control unit 132 returns to step S4.
[0090] On the other hand, if the pre-modification processing time is equal to or greater than the post-modification processing time (step S8: Yes), the data type control unit 132 returns the data type to be used for all operations belonging to the selected cluster registered in the calculation graph to 32-bit floating-point numbers (step S9). Thereafter, the data type control unit 132 returns to step S4.
[0091] On the other hand, when verification regarding data type modification has been completed for all clusters having 8-bit fixed-point numbers as data types (step S4: Yes), the operation data type control instruction unit 123 notifies the determination of the data type to the operation instruction unit 121. The operation instruction unit 121 receives the notification of the data type determination and performs one iteration of operation using the calculation graph stored in the calculation graph storage unit 107 (step S10).
[0092] Next, the operation instruction unit 121 verifies whether learning has been completed based on whether a predetermined condition is satisfied (step S11). When learning has not been completed (step S11: No), the operation instruction unit 121 returns to step S2.
[0093] In contrast, when the learning has been completed (step S11 : Yes), the operation instruction unit 121 notifies the operation unit 101 of the completion of the learning, and ends the execution of the deep learning.
[0094] Here, in this embodiment, 32-bit floating-point numbers and 8-bit fixed-point numbers are used as examples for explanation, but there may also be cases where 32-bit floating-point numbers and 16-bit fixed-point numbers are used, or there may be cases where 8-bit fixed-point numbers and 16-bit fixed-point numbers are used. In addition, a combination of other data types may be used as long as operations are performed on data types with different precisions and processing time is sometimes shortened when precision is increased.
[0095] As described above, in the information processing device according to the present embodiment, based on the evaluation of the operation performance of each operation included in one iteration, the data type to be used in each operation is preliminarily determined for each iteration. Next, the information processing device clusters the operations and specifies a cluster whose processing time is shorter when using 32-bit floating-point numbers than when using 8-bit fixed-point numbers. Subsequently, the information processing device modifies the data type to be used in the operations belonging to the specified cluster to 32-bit floating-point numbers. Thereafter, the information processing device uses the modified data type of each operation to perform the operation for each iteration. This can alleviate the following disadvantage: the data type conversion time generated when some operations are converted from 32-bit floating-point numbers to less precise data types makes the total processing time longer than the total processing time when the operations are performed using 32-bit floating-point numbers. Therefore, the processing time of the entire machine learning can be kept short and the efficiency of machine learning can be improved.
[0096] All examples and conditional language provided herein are intended to be used for the teaching purpose of helping the reader understand the present invention and the inventor's contribution to further developing the art, and should not be interpreted as being limited to these specific narrated examples and conditions, nor should the organization of these examples in the specification relate to the display of advantages and disadvantages of the present invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that various changes, substitutions and conversions can be made to the present invention without departing from the spirit and scope of the present invention.
Claims
1. An information processing device, comprising: A computational unit, which sequentially performs a series of multiple operations in machine learning; a preliminary data type determination unit that determines a data type to be used for each of a plurality of operations that are a series of operations to be used in a machine learning process, wherein the preliminary data type determination unit selects a first data type or a second data type that is more mathematically precise than the first data type as the determined data type; and a data type modifying unit, which, in response to selection of the first data type, modifies the determined data type from the first data type to the second data type, wherein the data type modifying unit is configured to: clustering some of the plurality of operations that are consecutive and use the same data type; selecting a modified target cluster including a modified target operation from among the generated clusters; and modifying the data type determined to be used in all modification target operations included in each of the selected modification target clusters to be included in the modification target clusters to the second data type, in a case where the total processing time determined when the data type used in all modification target operations included in each of the selected modification target clusters is changed from the first data type to the second data type is equal to or less than the total processing time before the change, the total processing time being the sum of the operation time of each of the plurality of operations and the conversion time taken to convert the data type; and An execution control unit causes the operation unit to execute each of the plurality of operations by using the modified data type of each of the plurality of operations.
2. The information processing device according to claim 1, wherein The modification of the determined data type is configured to: selecting the modification target clusters one by one; and The data type determined to be used in all modification target operations included in one of the modification target clusters that has been selected is modified to the second data type when the processing time when the second data type is used in all modification target operations included in one of the modification target clusters that has been selected is equal to or less than the following value: the value is obtained by adding the conversion time of the data type to the operation time when the first data type is used in all modification target operations included in one of the modification target clusters that has been selected.
3. The information processing device according to any one of claims 1 to 2, wherein: The process including determining the data type, reducing the total processing time, and performing each of the plurality of operations is iteratively performed for a plurality of iterations, each iteration being an execution cycle including performing a series of operations in a machine learning process.
4. The information processing apparatus according to claim 1 , further comprising a memory unit that stores information indicating an operation time when each of the data types is used in each of the operations and a conversion time between the data types, wherein The modification of the determined data type is configured to modify the determined data type based on an operation time and a conversion time indicated by the information stored in the memory unit.
5. The information processing device according to any one of claims 1 to 2, wherein: The modification of the determined data type is configured to: estimate the operation time and the conversion time before performing each of the multiple operations in the machine learning process, and modify the determined data type by using the estimated operation time and the estimated conversion time.
6. A machine learning method comprising: determining a data type to be used for each of a plurality of operations, the plurality of operations being a series of operations to be used in a machine learning process, wherein a first data type or a second data type that is more mathematically precise than the first data type is selected as the determined data type; and In response to selection of the first data type, modifying the determined data type from the first data type to the second data type includes: clustering some of the plurality of operations that are consecutive and use the same data type; selecting a modified target cluster including a modified target operation from among the generated clusters; and modifying the data type determined to be used in all modification target operations included in each of the selected modification target clusters to be included in the modification target clusters to the second data type, in a case where the total processing time determined when the data type used in all modification target operations included in each of the selected modification target clusters is changed from the first data type to the second data type is equal to or less than the total processing time before the change, the total processing time being the sum of the operation time of each of the plurality of operations and the conversion time taken to convert the data type; and Each of the plurality of operations is performed using the modified data type of each of the plurality of operations.
7. A non-transitory computer-readable storage medium storing a machine learning program that causes a computer to perform a process comprising: determining a data type to be used for each of a plurality of operations, the plurality of operations being a series of operations to be used in a machine learning process, wherein a first data type or a second data type that is more mathematically precise than the first data type is selected as the determined data type; and In response to selection of the first data type, modifying the determined data type from the first data type to the second data type includes: clustering some of the plurality of operations that are consecutive and use the same data type; selecting a modified target cluster including a modified target operation from among the generated clusters; and modifying the data type determined to be used in all modification target operations included in each of the selected modification target clusters to be included in the modification target clusters to the second data type, in a case where the total processing time determined when the data type used in all modification target operations included in each of the selected modification target clusters is changed from the first data type to the second data type is equal to or less than the total processing time before the change, the total processing time being the sum of the operation time of each of the plurality of operations and the conversion time taken to convert the data type; and Each of the plurality of operations is performed using the modified data type of each of the plurality of operations.
Citation Information
Patent Citations
Arithmetic processing device, information processing device, method, and program
JP2018124681A
Information processing method, information processing device and program
JP2018181313A
System and method for data processing
JP2019169150A
Dynamic precision management for integer deep learning primitives
CN108805796A
Information processing method and terminal device
WO2019085655A1