Heterogeneous machine performance determination method and device
By sending simulation test instructions in heterogeneous machines and performing real-time compilation, the problem that hardware floating-point calculation parameters in the prior art cannot reflect the real performance of heterogeneous machines is solved, and the accurate evaluation of heterogeneous machines is achieved.
Patent Information
- Application Number
- CN202411129324.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the real performance of heterogeneous machines in actual operation cannot be effectively reflected through the factory-departed hardware floating point calculation parameters, resulting in poor accuracy of performance evaluation results.
By obtaining the simulation test instructions generated by the benchmark heterogeneous machine and sending them to the heterogeneous machine to be determined for real-time compilation operations, the operation results of the heterogeneous machine are determined based on the feedback compilation results, thereby reflecting its true performance.
The accurate performance evaluation of heterogeneous machines in actual operation is achieved, and the accuracy of performance evaluation is improved.
Smart Images

Figure CN119066855A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a method and device for determining heterogeneous machine performance. Background Art
[0002] With the continuous development of technology and the increasing application demand, heterogeneous simulation technology will play an important role in more fields. In the existing technology, the hardware floating-point calculation parameters given by the heterogeneous machine when it leaves the factory are usually used as the basis for evaluating the performance of the heterogeneous machine.
[0003] However, in the process of implementing the present invention, it is found that the prior art has at least the following technical problems: the hardware floating-point calculation parameters at the factory cannot effectively reflect the real performance of heterogeneous machines in actual operation, resulting in poor accuracy of performance evaluation results. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for determining the performance of a heterogeneous machine, so as to achieve the purpose of effectively and accurately reflecting the real performance of a heterogeneous machine to be determined in actual operation through an operation result.
[0005] According to one aspect of the present invention, a method for determining performance of a heterogeneous machine is provided, comprising:
[0006] Obtain simulation test instructions generated by a benchmark heterogeneous machine in a target heterogeneous computing system;
[0007] Sending the simulation test instruction to at least one heterogeneous machine to be determined under the target heterogeneous computing system, so that the heterogeneous machine to be determined performs a real-time compilation operation based on the simulation test instruction; wherein the architecture of the reference heterogeneous machine is different from that of at least one heterogeneous machine to be determined;
[0008] For the at least one heterogeneous machine to be determined, the running result of the simulation test instruction by the heterogeneous machine to be determined is determined according to the real-time compilation result corresponding to the simulation test instruction received and fed back by the heterogeneous machine to be determined.
[0009] According to another aspect of the present invention, a device for determining performance of a heterogeneous machine is provided, the device comprising:
[0010] An instruction acquisition module, used to acquire simulation test instructions generated by a benchmark heterogeneous machine in a target heterogeneous computing system;
[0011] An instruction sending module, used for sending the simulation test instruction to at least one heterogeneous machine to be determined for performance under the target heterogeneous computing system, so that the heterogeneous machine to be determined for performance performs a real-time compilation operation based on the simulation test instruction; wherein the architecture of the reference heterogeneous machine is different from that of at least one heterogeneous machine to be determined for performance;
[0012] An operation result determination module is used to determine the operation result of the at least one heterogeneous machine to be determined for the performance of the simulation test instruction according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined for the performance of the simulation test instruction.
[0013] The technical solution of the embodiment of the present invention obtains the simulation test instruction generated by the benchmark heterogeneous machine in the target heterogeneous computing system; sends the simulation test instruction to at least one heterogeneous machine to be determined under the target heterogeneous computing system, so that the heterogeneous machine to be determined performs real-time compilation operation based on the simulation test instruction, and obtains the real-time compilation result that can reflect the actual operation status of the heterogeneous machine to be determined; wherein the architecture of the benchmark heterogeneous machine is different from that of at least one heterogeneous machine to be determined; for at least one heterogeneous machine to be determined, according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined, the operation result of the heterogeneous machine to be determined for the simulation test instruction is determined, so as to effectively and accurately reflect the real performance of the heterogeneous machine to be determined in actual operation through the operation result.
[0014] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 is a flow chart of a method for determining performance of a heterogeneous machine provided according to an embodiment of the present invention;
[0017] Figure 2 is a flow chart of another method for determining performance of heterogeneous machines provided according to an embodiment of the present invention;
[0018] Figure 3is a schematic diagram of a structure diagram of a target heterogeneous computing system provided according to an embodiment of the present invention;
[0019] Figure 4 is a schematic diagram of the structure of a device for determining performance of a heterogeneous machine provided according to an embodiment of the present invention;
[0020] Figure 5 It is a schematic diagram of the structure of an electronic device for implementing the heterogeneous machine performance determination method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "etc." and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] Figure 1 This is a flow chart of a method for determining the performance of a heterogeneous machine provided according to an embodiment of the present invention. This embodiment can be applied to a scenario of determining the performance of at least one heterogeneous machine in a target heterogeneous computing system. The method can be performed by a heterogeneous machine performance determination device, which can be implemented in the form of hardware and / or software.
[0024] like Figure 1 As shown, the method of this embodiment may specifically include:
[0025] S110, obtaining simulation test instructions generated by a benchmark heterogeneous machine in a target heterogeneous computing system.
[0026] It should be noted that the heterogeneous computing system is composed of heterogeneous machines using different types of instruction sets and architectures, and the heterogeneous machines are connected through a high-speed network. In this embodiment, the target heterogeneous computing system is a heterogeneous computing system that needs to be tested for performance, and the heterogeneous machine that needs to be tested for performance in the target heterogeneous computing system is called a heterogeneous machine to be determined for performance, and the heterogeneous machine in the target heterogeneous computing system used to send instructions to the heterogeneous machine to be determined for performance is called a reference heterogeneous machine.
[0027] In a specific implementation, a simulation test instruction is generated in the target heterogeneous computing system, and the simulation test instruction is obtained through the organization node. The simulation test instruction is an instruction for performing a real-time compilation performance test on at least one heterogeneous machine to be determined. Specifically, the organization node can detect the reference heterogeneous machine in real time, and after detecting that the reference heterogeneous machine generates an instruction, the currently generated instruction is used as the simulation test instruction.
[0028] Optionally, the implementation method of acquiring the simulation test instruction generated by the benchmark heterogeneous machine in the target heterogeneous computing system specifically includes: intercepting the simulation test instruction transmitted by the application program interface of the benchmark heterogeneous machine in the target heterogeneous computing system.
[0029] In a specific implementation, an application program for supporting heterogeneous computing is deployed in the reference heterogeneous machine, and the organization node can intercept instructions transmitted by the application program interface of the reference heterogeneous machine in the target heterogeneous computing system, and use the intercepted instructions as simulation test instructions. Exemplarily, the organization node establishes connections with the reference heterogeneous machine and the heterogeneous machine to be determined for performance in the target heterogeneous computing system, respectively. The target heterogeneous computing system includes a reference heterogeneous machine A, a heterogeneous machine B to be determined for performance, and a heterogeneous machine C to be determined for performance. The organization node obtains simulation test instructions by intercepting instructions transmitted by the application program interface of the reference heterogeneous machine A, and can send simulation test instructions to the heterogeneous machine B to be determined for performance and the heterogeneous machine C to be determined for performance, respectively, so as to perform performance tests on the heterogeneous machine B to be determined for performance and the heterogeneous machine C to be determined for performance.
[0030] In this embodiment, by intercepting the instructions transmitted by the application program interface of the benchmark heterogeneous machine as simulation test instructions, simulation test instructions that match the architecture of the benchmark heterogeneous machine are effectively obtained, which facilitates unified comparison of the performance of different heterogeneous machines to be determined, and improves the convenience of performance comparison between different heterogeneous machines to be determined.
[0031] S120: Send the simulation test instruction to at least one heterogeneous machine to be determined in the target heterogeneous computing system, so that the heterogeneous machine to be determined performs a real-time compilation operation based on the simulation test instruction.
[0032] The architecture of the benchmark heterogeneous machine is different from that of at least one heterogeneous machine to be determined. For example, the architecture adopted by the benchmark heterogeneous machine may be CUDA (Compute Unified Device Architecture), and the architecture of the heterogeneous machine to be determined may be a reduced instruction set architecture.
[0033] In a specific implementation, the heterogeneous machines to be determined in the target heterogeneous computing system may be determined first. For example, all the remaining heterogeneous machines in the target heterogeneous computing system except the reference heterogeneous machine may be determined as the heterogeneous machines to be determined; or, among the remaining heterogeneous machines in the target heterogeneous computing system except the reference heterogeneous machine, the remaining heterogeneous machines having different architectures from the reference heterogeneous machine may be determined as the heterogeneous machines to be determined.
[0034] In this embodiment, the simulation test instruction can be sent to each heterogeneous machine to be determined in the target heterogeneous computing system. After receiving the simulation test instruction, the heterogeneous machine to be determined can perform a real-time compilation operation on the simulation test instruction, so that the compiled simulation test instruction is executed locally on the heterogeneous machine to be determined to obtain an implementation compilation result. The implementation compilation result is the result obtained after the simulation test instruction is compiled in real time and executed locally.
[0035] S130. For at least one heterogeneous machine to be determined for performance, determine the running result of the heterogeneous machine to be determined for the simulation test instruction according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined for performance.
[0036] The operation result is used to reflect whether the heterogeneous machine to be determined can correctly execute the simulation test instruction. Optionally, the operation result includes a correct operation and an error operation.
[0037] In this embodiment, the heterogeneous machine to be determined for performance can feed back the obtained real-time compilation results corresponding to the simulation test instructions to the organization node, and the organization node determines whether the heterogeneous machine to be determined for performance correctly executes the simulation test instructions based on the simulation test instructions and the real-time compilation results.
[0038] Optionally, based on the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined for performance, the running result of the simulation test instruction by the heterogeneous machine to be determined for performance is determined, including: determining a preset compilation result associated with the simulation test instruction, and comparing the preset compilation result with the real-time compilation result; when the preset compilation result matches the real-time compilation result, determining that the running result of the simulation test instruction by the heterogeneous machine to be determined for performance is correct; when the preset compilation result does not match the real-time compilation result, determining that the running result of the simulation test instruction by the heterogeneous machine to be determined for performance is incorrect.
[0039] The preset compilation result is the result obtained when the simulation test instruction is correctly executed. The preset compilation result and the simulation test instruction are codes in the same instruction set.
[0040] In a specific implementation, the correspondence between the preset compilation result and the simulation test instruction can be stored in advance. After receiving the real-time compilation result corresponding to the simulation test instruction, the preset compilation result corresponding to the simulation test result can be determined based on the correspondence, and the preset compilation result can be compared with the real-time compilation result. If the two match, it means that the real-time compilation result is the result obtained after correct compilation and execution of the simulation test instruction, and the operation result can be determined to be correct operation. If the two do not match, it means that the real-time compilation result is the result obtained after incorrect compilation or incorrect execution of the simulation test instruction, and the operation result can be determined to be an operation error.
[0041] This embodiment determines whether the preset compilation result matches the real-time compilation result, thereby effectively and accurately determining whether the heterogeneous machine to be determined for performance can correctly compile and execute the simulation test instruction.
[0042] In order to more comprehensively reflect the performance of the heterogeneous machine to be determined for performance executing the simulation test instruction, in this embodiment, after the simulation test instruction is sent to at least one heterogeneous machine to be determined for performance located in the target heterogeneous computing system, it also includes: determining the distribution time of the simulation test instruction and the feedback time of at least one heterogeneous machine to be determined for performance feedback of the real-time compilation result; for at least one heterogeneous machine to be determined for performance, determining the execution time of the simulation test instruction on the heterogeneous machine to be determined for performance based on the distribution time and the feedback time corresponding to the heterogeneous machine to be determined for performance, and determining the operating state of the heterogeneous machine to be determined for performance based on the execution time; wherein the operating state includes a normal state and an abnormal state.
[0043] The distribution time is the time when the organization node sends the simulation test instruction to the heterogeneous machine to be determined first, and the feedback time is the time when the organization node receives the real-time compilation result fed back by the heterogeneous machine to be determined first.
[0044] In this embodiment, for the heterogeneous machine to be determined that feeds back the real-time compilation result to the organization node, the time obtained by subtracting the distribution time from the feedback time corresponding to the heterogeneous machine to be determined can be used as the execution time used by the heterogeneous machine to be determined to compile and execute the simulation test instruction. Alternatively, when the heterogeneous machine to be determined performs other preset processing on the simulation test instruction, the execution time can be obtained by subtracting the distribution time and the time required for the preset processing from the feedback time. Exemplarily, the preset processing may include processing such as decompression or decryption.
[0045] Further, the running state of the heterogeneous machine to be determined is determined based on the execution time. When the running state is normal, it means that the heterogeneous machine to be determined can process instructions normally. When the running state is abnormal, it means that the heterogeneous machine to be determined cannot process instructions normally.
[0046] This embodiment determines the execution time of the simulation test instruction executed by the heterogeneous machine to be determined through the feedback time and the distribution time, so that the running state of the heterogeneous machine to be determined can be determined quickly and accurately.
[0047] Optionally, the operating status of the heterogeneous machine to be determined is determined based on the execution time, including: when the execution time is greater than or equal to a preset time length, determining that the operating status of the heterogeneous machine to be determined is an abnormal state; when the execution time is less than a preset time length, determining that the operating status of the heterogeneous machine to be determined is a normal state.
[0048] It should be noted that those skilled in the art may determine the maximum operating time required by the heterogeneous machine to be determined for performance under normal operation as the preset time according to actual application conditions. Different preset time may be determined for different heterogeneous machines to be determined for performance.
[0049] In a specific implementation, if the execution time is greater than or equal to the preset time, it means that the heterogeneous machine to be determined for performance exceeds the maximum running time when executing the simulation test instruction, and the running state of the heterogeneous machine to be determined for performance is abnormal. If the execution time is less than the preset time, it can be determined that the running state of the heterogeneous machine to be determined for performance is normal.
[0050] Furthermore, the execution efficiency of different heterogeneous machines to be determined as abnormal can be compared based on the execution time. For different abnormal machines to be determined as abnormal, the shorter the execution time, the higher the execution efficiency and the better the execution performance of the instruction; conversely, the longer the execution time, the lower the execution efficiency and the worse the execution performance of the instruction.
[0051] This embodiment compares the preset duration with the execution time, thereby effectively determining the operating status of the heterogeneous machine to be determined. In addition, the execution efficiency of the execution instructions of different heterogeneous machines to be determined is compared through the execution time, so that users can understand the performance of different heterogeneous machines to be determined in actual applications from multiple perspectives.
[0052] The technical solution of the embodiment of the present invention obtains the simulation test instruction generated by the benchmark heterogeneous machine in the target heterogeneous computing system; sends the simulation test instruction to at least one heterogeneous machine to be determined under the target heterogeneous computing system, so that the heterogeneous machine to be determined performs real-time compilation operation based on the simulation test instruction, and obtains the real-time compilation result that can reflect the actual operation status of the heterogeneous machine to be determined; wherein the architecture of the benchmark heterogeneous machine is different from that of at least one heterogeneous machine to be determined; for at least one heterogeneous machine to be determined, according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined, the operation result of the heterogeneous machine to be determined for the simulation test instruction is determined, so as to effectively and accurately reflect the real performance of the heterogeneous machine to be determined in actual operation through the operation result.
[0053] Figure 2 It is a flowchart of another heterogeneous machine performance determination method provided according to an embodiment of the present invention. In this embodiment, based on the above embodiment, the method of sending simulation test instructions to at least one heterogeneous machine to be determined in the target heterogeneous computing system may be: the simulation test instructions are packaged according to the linear prediction coding method, and the instruction packets corresponding to the simulation test instructions obtained after the package processing are distributed to at least one heterogeneous machine to be determined in the target heterogeneous computing system, so that the heterogeneous machine to be determined will decompress the received instruction packets, obtain decompressed instructions, and perform real-time compilation operations based on the decompressed instructions. Among them, the explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 2 As shown, the method includes:
[0054] S210, obtaining simulation test instructions generated by a benchmark heterogeneous machine in a target heterogeneous computing system.
[0055] In a specific implementation, in order to minimize the workload while effectively performing performance tests on problematic heterogeneous machines so as to improve the overall performance of the target heterogeneous computing system, before obtaining the simulation test instructions generated by the benchmark heterogeneous machine in the target heterogeneous computing system, it also includes: obtaining program compilation information of a preset test program fed back by at least one remaining heterogeneous machine in the target heterogeneous computing system, and determining at least one heterogeneous machine to be determined for performance among the remaining heterogeneous machines based on the program compilation information; wherein the program compilation information includes the final compilation results and / or total execution time of the preset test program by the remaining heterogeneous machines.
[0056] The preset test program includes at least one instruction, and the preset test program is a program generated by a reference heterogeneous machine in the target heterogeneous computing system. The remaining heterogeneous machines are heterogeneous machines in the target heterogeneous computing system except the reference heterogeneous machine.
[0057] In a specific implementation, the preset test program generated by the reference heterogeneous machine can be sent to at least one remaining heterogeneous machine of the target heterogeneous computing system, so that the at least one remaining heterogeneous machine can execute the preset test program and obtain program compilation information. The at least one remaining heterogeneous machine feeds back the program compilation information to the organization node, and the organization node determines the remaining heterogeneous machines whose program compilation information does not meet the preset compilation requirements as the heterogeneous machines to be determined.
[0058] Specifically, the preset compilation requirements may include: the final compilation result matches the preset program compilation result; and / or the total execution time is less than or greater than the preset total execution time. This embodiment takes into account the final compilation result and the total execution time of the preset test program, and determines the remaining heterogeneous machines with weak performance in compiling and executing the preset test program as the heterogeneous machines to be determined for performance, thereby facilitating accurate performance testing of the heterogeneous machines with weak performance; by performing instruction-level performance determination on the heterogeneous machines to be determined for performance, it is helpful to more accurately and finely determine the reasons for the poor performance of the heterogeneous machines to be determined for performance.
[0059] S220, packing the simulation test instructions according to the linear prediction coding method, and distributing the instruction packages corresponding to the simulation test instructions obtained after the packing process to at least one heterogeneous machine to be determined in the target heterogeneous computing system, so that the heterogeneous machine to be determined decompresses the received instruction packages to obtain decompressed instructions, and performs real-time compilation operations based on the decompressed instructions.
[0060] In a specific implementation, in order to facilitate the transmission of simulation test instructions, the simulation test instructions can be packaged according to the linear prediction coding method (LPC) to obtain an instruction packet corresponding to the simulation test instruction. The instruction packet can be sent to each heterogeneous machine to be determined for performance. After receiving the instruction packet, the heterogeneous machine to be determined for performance can decompress the instruction packet to obtain a decompressed instruction, and perform real-time compilation operations and local execution operations on the decompressed instruction to obtain a real-time compilation result.
[0061] This embodiment packages the simulation test instructions to obtain instruction packages, and distributes the instruction packages to heterogeneous machines whose performance is to be determined, thereby facilitating improving the efficiency and security of transmitting the simulation test instructions.
[0062] Optionally, a real-time compilation operation is performed based on the decompression instruction, including: when the architecture of the heterogeneous machine to be determined for performance of the received instruction packet is different from that of the benchmark heterogeneous machine, the decompression instruction is translated into a translation instruction that matches the heterogeneous machine to be determined for performance of the received instruction packet, and the translation instruction is executed to complete the real-time compilation operation.
[0063] It should be noted that, when the heterogeneous machine to be determined for performance is different from the reference heterogeneous machine, it means that the heterogeneous machine to be determined for performance and the reference heterogeneous machine use different instruction sets. Therefore, in order to normally execute the instructions generated by the reference heterogeneous machine on the heterogeneous machine to be determined for performance, it is necessary to translate the instructions generated by the received reference heterogeneous machine.
[0064] Specifically, for at least one heterogeneous machine to be determined for performance, the architecture of the benchmark heterogeneous machine can be determined in advance, and the architecture adopted by the machine can be compared with the architecture of the benchmark heterogeneous machine. If they are different, it means that the decompression instruction cannot be directly executed on the heterogeneous machine to be determined for performance. The decompression instruction can be translated first to obtain a translation instruction that matches the heterogeneous machine to be determined for performance, and the translation instruction is executed to complete the real-time compilation operation of the simulation test instruction. After the heterogeneous machine to be determined for performance executes the translation instruction, the execution result is obtained, and the execution result is translated into a real-time compilation result that can be recognized by the benchmark heterogeneous machine, and the real-time compilation result is fed back to the organization node, so as to facilitate the comparison of the real-time compilation result with the preset compilation result.
[0065] In this embodiment, in consideration of the fact that the architectures adopted by the heterogeneous machine to be determined are inconsistent with those of the reference heterogeneous machine, the decompression instructions may be translated before execution, thereby avoiding the compilation failure caused by the inability of the heterogeneous machine to be determined to recognize the instructions.
[0066] Furthermore, executing the real-time compilation operation based on the decompression instruction includes: when the architecture of the waiting heterogeneous machine and the reference heterogeneous machine of the received instruction packet is the same, executing the decompression instruction to complete the real-time compilation operation.
[0067] Specifically, when the heterogeneous machine to be determined for performance is the same as the reference heterogeneous machine, it means that the heterogeneous machine to be determined for performance and the reference heterogeneous machine use the same instruction set. Therefore, in order to improve the convenience of the heterogeneous machine to be determined for performance to execute instructions, after decompressing to obtain the decompressed instructions, the decompressed instructions can be directly executed to complete the real-time compilation operation.
[0068] S230. For at least one heterogeneous machine to be determined for performance, determine the running result of the heterogeneous machine to be determined for the simulation test instruction according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined for performance.
[0069] This embodiment provides methods for completing the compilation operation for the two situations where the architectures of the heterogeneous machine to be determined are the same as or different from those of the benchmark heterogeneous machine, thereby ensuring that the real-time compilation operation can be accurately performed and improving the convenience of operation.
[0070] The embodiments corresponding to the method for determining the performance of heterogeneous machines are described in detail above. In order to make the technical solution of the method further clear to those skilled in the art, a specific application scenario is given below.
[0071] For a clear and detailed description of the heterogeneous machine performance determination process, see Figure 3 . Figure 3 The target heterogeneous computing system provided in the specification includes a benchmark heterogeneous machine A, a heterogeneous machine B to be determined for performance, and a heterogeneous machine C to be determined for performance.
[0072] In this embodiment, a preset test program can be generated by a reference heterogeneous machine, and each instruction in the preset test program is used as a simulation test instruction and transmitted through the application program interface of the reference heterogeneous machine A. The organization node O obtains the simulation test instruction by intercepting the instruction transmitted by the application program interface of the reference heterogeneous machine A, and packages the simulation test instruction to obtain an instruction package. The instruction package is distributed to the heterogeneous machine B to be determined for performance and the heterogeneous machine C to be determined for performance at the same time, and the distribution time of the instruction package is recorded. The heterogeneous machine B to be determined for performance and the heterogeneous machine C to be determined for performance are connected to the application program interface, and after receiving the instruction package, they are decompressed. Exemplarily, if the architecture of the heterogeneous machine B to be determined for performance is different from that of the reference heterogeneous machine A, the heterogeneous machine B to be determined for performance translates the decompressed instruction obtained by decompression in real time and then runs it locally. If the architecture of the heterogeneous machine C to be determined for performance is the same as that of the reference heterogeneous machine A, the heterogeneous machine C to be determined for performance executes the decompressed instruction obtained by executing decompression locally. The execution result obtained after execution is translated into a real-time compilation result; wherein the real-time compilation result is the same as the instruction set to which the simulation test instruction belongs. The heterogeneous machine B to be determined for performance and the heterogeneous machine C to be determined for performance respectively feed back the obtained real-time compilation results to the organization node O. The organization node O records the feedback time of the real-time compilation results fed back by each heterogeneous machine to be determined for performance. Based on the obtained real-time compilation results fed back by each heterogeneous machine to be determined for performance and the corresponding feedback time, the compilation correctness and execution time of each heterogeneous machine to be determined for performance for the currently obtained simulation test instructions are determined; and the organization node O feeds back the real-time compilation results to the benchmark heterogeneous machine.
[0073] Furthermore, the organization node O waits again to intercept the instructions transmitted by the application program interface of the benchmark heterogeneous machine A, and uses the intercepted instructions as simulation test instructions to re-execute the above-mentioned transmission, compilation and execution processes until each instruction in the preset test program is executed, thereby obtaining the compilation correctness and execution time of each instruction in the preset test program for each heterogeneous machine to be determined.
[0074] This embodiment effectively and accurately reflects the real performance of the heterogeneous machine to be determined in actual operation; and, the performance of the heterogeneous machine to be determined can be determined separately for different simulation test instructions, so that users can measure the performance of different heterogeneous machines to be determined in combination with application scenarios.
[0075] Figure 41 is a schematic diagram of the structure of a heterogeneous machine performance determination device provided according to an embodiment of the present invention, and the device is used to execute the heterogeneous machine performance determination method provided in any of the above embodiments. The device and the heterogeneous machine performance determination method of the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the heterogeneous machine performance determination device can refer to the embodiment of the above heterogeneous machine performance determination method. Figure 4 As shown, the device comprises:
[0076] An instruction acquisition module 10 is used to acquire simulation test instructions generated by a benchmark heterogeneous machine in a target heterogeneous computing system;
[0077] An instruction sending module 11 is used to send a simulation test instruction to at least one heterogeneous machine to be determined for performance under the target heterogeneous computing system, so that the heterogeneous machine to be determined for performance performs a real-time compilation operation based on the simulation test instruction; wherein the architecture of the reference heterogeneous machine is different from that of the at least one heterogeneous machine to be determined for performance;
[0078] The operation result determination module 12 is used to determine the operation result of the heterogeneous machine to be determined for the simulation test instruction for at least one heterogeneous machine to be determined according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined for the performance.
[0079] Based on any optional technical solution in the embodiment of the present invention, optionally, the instruction acquisition module 10 includes:
[0080] The instruction interception submodule is used to intercept the simulation test instructions transmitted by the application program interface of the benchmark heterogeneous machine in the target heterogeneous computing system.
[0081] Based on any optional technical solution in the embodiment of the present invention, optionally, the instruction sending module 11 includes:
[0082] The packing submodule is used to pack the simulation test instructions according to the linear prediction coding method, and distribute the instruction packages corresponding to the simulation test instructions obtained after the packing process to at least one heterogeneous machine to be determined in the target heterogeneous computing system, so that the heterogeneous machine to be determined can decompress the received instruction packages to obtain decompressed instructions, and perform real-time compilation operations based on the decompressed instructions.
[0083] Based on any optional technical solution in the embodiments of the present invention, optionally, the packaging submodule includes:
[0084] The instruction translation unit is used to translate the decompressed instruction into a translation instruction matching the heterogeneous machine to be determined for the received instruction packet when the architecture of the heterogeneous machine to be determined for the received instruction packet is different from that of the reference heterogeneous machine, and execute the translation instruction to complete the real-time compilation operation.
[0085] Based on any optional technical solution in the embodiments of the present invention, optionally, the packaging submodule includes:
[0086] The decompression instruction execution unit is used to execute the decompression instruction to complete the real-time compilation operation when the architecture of the heterogeneous machine to be determined in the received instruction packet is the same as that of the reference heterogeneous machine.
[0087] Based on any optional technical solution in the embodiment of the present invention, optionally, the operation result includes correct operation and error operation;
[0088] The operation result determination module 12 includes:
[0089] A preset compilation result determination submodule is used to determine a preset compilation result associated with a simulation test instruction and compare the preset compilation result with the real-time compilation result;
[0090] A first result determination submodule is used to determine that the running result of the simulation test instruction by the heterogeneous machine to be determined for performance is correct when the preset compilation result matches the real-time compilation result;
[0091] The second result determination submodule is used to determine that the running result of the simulation test instruction by the heterogeneous machine to be determined is an running error when the preset compilation result does not match the real-time compilation result.
[0092] Based on any optional technical solution in the embodiments of the present invention, optionally, the device further includes:
[0093] A feedback time determination module, used to determine the distribution time of the simulation test instruction and the feedback time of the at least one heterogeneous machine to be determined for performance feedback of the real-time compilation result after sending the simulation test instruction to at least one heterogeneous machine to be determined for performance under the target heterogeneous computing system;
[0094] An execution time determination module is used to determine, for at least one heterogeneous machine to be determined for performance, the execution time of a simulation test instruction on the heterogeneous machine to be determined for performance based on a distribution time and a feedback time corresponding to the heterogeneous machine to be determined for performance, and to determine the operating state of the heterogeneous machine to be determined for performance based on the execution time; wherein the operating state includes a normal state and an abnormal state.
[0095] Based on any optional technical solution in the embodiments of the present invention, optionally, the execution time determination module includes:
[0096] A first state determination submodule, configured to determine that the operation state of the heterogeneous machine to be determined is an abnormal state when the execution time is greater than or equal to a preset time length;
[0097] The second state determination submodule is used to determine that the running state of the heterogeneous machine to be determined is a normal state when the execution time is less than a preset time length.
[0098] Based on any optional technical solution in the embodiments of the present invention, optionally, the device further includes:
[0099] The program compilation information acquisition module is used to obtain the program compilation information of the preset test program fed back by at least one remaining heterogeneous machine in the target heterogeneous computing system before obtaining the simulation test instructions generated by the benchmark heterogeneous machine in the target heterogeneous computing system, and determine at least one heterogeneous machine to be determined in the remaining heterogeneous machines based on the program compilation information; wherein the program compilation information includes the final compilation result and / or total execution time of the remaining heterogeneous machines for the preset test program. .
[0100] The technical solution of the embodiment of the present invention obtains the simulation test instruction generated by the benchmark heterogeneous machine in the target heterogeneous computing system; sends the simulation test instruction to at least one heterogeneous machine to be determined under the target heterogeneous computing system, so that the heterogeneous machine to be determined performs real-time compilation operation based on the simulation test instruction, and obtains the real-time compilation result that can reflect the actual operation status of the heterogeneous machine to be determined; wherein the architecture of the benchmark heterogeneous machine is different from that of at least one heterogeneous machine to be determined; for at least one heterogeneous machine to be determined, according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined, the operation result of the heterogeneous machine to be determined for the simulation test instruction is determined, so as to effectively and accurately reflect the real performance of the heterogeneous machine to be determined in actual operation through the operation result.
[0101] It is worth noting that in the above-mentioned embodiment of the heterogeneous machine performance determination device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0102] Figure 5Schematic diagram of the structure of an electronic device that implements the heterogeneous machine performance determination method of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0103] like Figure 5 As shown, the electronic device 20 includes at least one processor 21, and a memory connected to the at least one processor 21, such as a read-only memory (ROM) 22, a random access memory (RAM) 23, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 21 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 22 or the computer program loaded from the storage unit 28 to the random access memory (RAM) 23. In RAM23, various programs and data required for the operation of the electronic device 20 can also be stored. The processor 21, ROM22 and RAM23 are connected to each other through a bus 24. An input / output (I / O) interface 25 is also connected to the bus 24.
[0104] A number of components in the electronic device 20 are connected to the I / O interface 25, including: an input unit 26, such as a keyboard, a mouse, etc.; an output unit 27, such as various types of displays, speakers, etc.; a storage unit 28, such as a disk, an optical disk, etc.; and a communication unit 29, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 29 allows the electronic device 20 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0105] The processor 21 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 21 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 21 executes the various methods and processes described above, such as a heterogeneous machine performance determination method.
[0106] In some embodiments, the heterogeneous machine performance determination method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 28. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 20 via the ROM 22 and / or the communication unit 29. When the computer program is loaded into the RAM 23 and executed by the processor 21, one or more steps of the heterogeneous machine performance determination method described above may be performed. Alternatively, in other embodiments, the processor 21 may be configured to perform the heterogeneous machine performance determination method in any other appropriate manner (e.g., by means of firmware).
[0107] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0108] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0109] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0110] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0111] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0112] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0113] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0114] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for determining the performance of heterogeneous machines, characterized in that: include: Obtain simulation test instructions generated by a benchmark heterogeneous machine in a target heterogeneous computing system; Sending the simulation test instruction to at least one heterogeneous machine to be determined under the target heterogeneous computing system, so that the heterogeneous machine to be determined performs a real-time compilation operation based on the simulation test instruction; wherein the architecture of the reference heterogeneous machine is different from that of at least one heterogeneous machine to be determined; For the at least one heterogeneous machine to be determined, the running result of the simulation test instruction by the heterogeneous machine to be determined is determined according to the real-time compilation result corresponding to the simulation test instruction received and fed back by the heterogeneous machine to be determined.
2. The method according to claim 1, characterized in that: The step of obtaining the simulation test instruction generated by the benchmark heterogeneous machine in the target heterogeneous computing system includes: Intercepting simulation test instructions transmitted by the application program interface of the benchmark heterogeneous machine in the target heterogeneous computing system.
3. The method according to claim 1, characterized in that The step of sending the simulation test instruction to at least one heterogeneous machine to be determined in the target heterogeneous computing system, so that the heterogeneous machine to be determined performs a real-time compilation operation based on the simulation test instruction, includes: The simulation test instructions are packaged in accordance with a linear prediction coding method, and instruction packets corresponding to the simulation test instructions obtained after the packaged processing are distributed to at least one heterogeneous machine to be determined in the target heterogeneous computing system, so that the heterogeneous machine to be determined decompresses the received instruction packets to obtain decompressed instructions, and executes the real-time compilation operation based on the decompressed instructions.
4. The method according to claim 3, characterized in that The performing the real-time compiling operation based on the decompression instruction includes: When the architecture of the heterogeneous machine to be determined that receives the instruction packet is different from that of the reference heterogeneous machine, the decompression instruction is translated into a translation instruction that matches the heterogeneous machine to be determined that receives the instruction packet, and the translation instruction is executed to complete the real-time compilation operation.
5. The method according to claim 3, characterized in that: The performing the real-time compiling operation based on the decompression instruction includes: In a case where the architecture of the heterogeneous machine to be determined that receives the instruction packet is the same as that of the reference heterogeneous machine, the decompression instruction is executed to complete the real-time compilation operation.
6. The method according to claim 1, characterized in that The operation results include correct operation and error operation; The step of determining the running result of the simulation test instruction by the heterogeneous machine to be determined for performance according to the received real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined for performance includes: Determining a preset compilation result associated with the simulation test instruction, and comparing the preset compilation result with the real-time compilation result; In a case where the preset compilation result matches the real-time compilation result, determining that the running result of the simulation test instruction by the to-be-determined heterogeneous machine is running correctly; In a case where the preset compilation result does not match the real-time compilation result, it is determined that the running result of the simulation test instruction by the heterogeneous machine to be determined is a running error.
7. The method according to claim 1, characterized in that After sending the simulation test instruction to at least one heterogeneous machine to be determined in the target heterogeneous computing system, the method further includes: Determine the distribution time of the simulation test instruction and the feedback time of the at least one heterogeneous machine to be determined to feed back the real-time compilation result; For the at least one heterogeneous machine to be determined for performance, based on the distribution time and the feedback time corresponding to the heterogeneous machine to be determined for performance, the execution time of the simulation test instruction on the heterogeneous machine to be determined for performance is determined, and based on the execution time, the operating state of the heterogeneous machine to be determined for performance is determined; wherein the operating state includes a normal state and an abnormal state.
8. The method according to claim 7, characterized in that The determining the operating state of the waiting heterogeneous machine based on the execution time includes: In a case where the execution time is greater than or equal to a preset time length, determining that the operation state of the to-be-determined heterogeneous machine is the abnormal state; When the execution time is less than the preset time length, it is determined that the running state of the heterogeneous machine to be determined is the normal state.
9. The method according to claim 1, characterized in that: Before obtaining the simulation test instruction generated by the benchmark heterogeneous machine in the target heterogeneous computing system, the method further includes: Obtain program compilation information of a preset test program fed back by at least one remaining heterogeneous machine in the target heterogeneous computing system, and determine the at least one heterogeneous machine to be determined in the remaining heterogeneous machines based on the program compilation information; wherein the program compilation information includes final compilation results and / or total execution time of the preset test program by the remaining heterogeneous machines.
10. A device for determining performance of heterogeneous machines, characterized in that: include: An instruction acquisition module, used to acquire simulation test instructions generated by a benchmark heterogeneous machine in a target heterogeneous computing system; An instruction sending module, used for sending the simulation test instruction to at least one heterogeneous machine to be determined for performance under the target heterogeneous computing system, so that the heterogeneous machine to be determined for performance performs a real-time compilation operation based on the simulation test instruction; wherein the architecture of the reference heterogeneous machine is different from that of at least one heterogeneous machine to be determined for performance; An operation result determination module is used to determine the operation result of the at least one heterogeneous machine to be determined for the performance of the simulation test instruction according to the real-time compilation result corresponding to the simulation test instruction fed back by the heterogeneous machine to be determined for the performance of the simulation test instruction.
Citation Information
Patent Citations
Performance analysis method and device, storage medium and program product
CN116701144A
Performance test method and system for artificial intelligence accelerator card of domestic heterogeneous platform
CN117370088A
