CN115061925A - Performance test method and device of heterogeneous acceleration program and storage medium - Google Patents

Performance test method and device of heterogeneous acceleration program and storage medium Download PDF

Info

Publication number
CN115061925A
CN115061925A CN202210735044.3A CN202210735044A CN115061925A CN 115061925 A CN115061925 A CN 115061925A CN 202210735044 A CN202210735044 A CN 202210735044A CN 115061925 A CN115061925 A CN 115061925A
Authority
CN
China
Prior art keywords
acceleration program
performance test
heterogeneous acceleration
test data
performance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210735044.3A
Other languages
Chinese (zh)
Inventor
李志功
肖熠
霍志坤
彭超峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Shuguang International Information Industry Co ltd
Original Assignee
Zhongke Shuguang International Information Industry Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Shuguang International Information Industry Co ltd filed Critical Zhongke Shuguang International Information Industry Co ltd
Priority to CN202210735044.3A priority Critical patent/CN115061925A/en
Publication of CN115061925A publication Critical patent/CN115061925A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a performance test method, a device and a storage medium of a heterogeneous acceleration program, wherein the method comprises the following steps: creating a process management table of a heterogeneous acceleration program to be tested, and running the heterogeneous acceleration program based on a runtime system; if the heterogeneous acceleration program is detected to comprise a plurality of processes, respectively recording the process identification of each process through a process management table; and respectively acquiring the performance test data of each process according to the process identification. The invention not only reduces the performance test time of the heterogeneous acceleration program and improves the acquisition efficiency of the test data, but also realizes the multi-process performance test data acquisition under the single operation of the heterogeneous acceleration program, avoids the occurrence of data errors caused by manual data combination and improves the accuracy of the performance test result.

Description

Performance test method and device of heterogeneous acceleration program and storage medium
Technical Field
The invention relates to the field of software testing, in particular to a method and a device for testing the performance of a heterogeneous acceleration program and a storage medium.
Background
The heterogeneous acceleration program is an application program that performs acceleration calculation using a heterogeneous accelerator (e.g., an acceleration calculation chip, an acceleration calculation card, etc.), and is different from a general application program that processes a large amount of data using a Central Processing Unit (CPU), and the heterogeneous acceleration program performs data calculation using the heterogeneous accelerator to improve data processing efficiency.
In the prior art, for the performance test of the heterogeneous acceleration program, performance analysis can be performed only for one application process, and performance data under the application process is collected, and for the heterogeneous acceleration program including a plurality of application processes, the performance test data of each application process is collected by running the heterogeneous acceleration program for a plurality of times.
However, in such a performance test method, the test process is complicated, the test time is long, and meanwhile, the performance test data in each process needs to be combined manually to obtain complete performance test data in a heterogeneous acceleration program, and the combined performance test data often has a large error.
Disclosure of Invention
The invention provides a performance test method and device of a heterogeneous acceleration program, electronic equipment and a storage medium, which realize single operation based on the heterogeneous acceleration program and acquire performance test data under each process.
According to an aspect of the present invention, a performance testing method for a heterogeneous acceleration program is provided, including:
creating a process management table of a heterogeneous acceleration program to be tested, and running the heterogeneous acceleration program based on a runtime system;
if the heterogeneous acceleration program is detected to comprise a plurality of processes, respectively recording the process identification of each process through the process management table;
and respectively acquiring the performance test data of each process according to each process identifier.
Before the heterogeneous acceleration program is operated based on the runtime system, the method further comprises the following steps: creating a shared memory matched with the heterogeneous acceleration program; after the heterogeneous acceleration program is run based on the runtime system, the method further comprises the following steps: transmitting the process identification of the heterogeneous acceleration program to the shared memory through the runtime system; the obtaining performance test data of each process according to each process identifier includes: and transmitting the performance test data of each process to the shared memory through the runtime system according to each process identifier. Compared with the traditional technical scheme, the test data transmission is carried out by reading and writing the data file, the shared memory greatly improves the data transmission speed, and the acquisition efficiency of the performance test data is improved.
After the performance test data of each process is respectively obtained according to each process identifier, the method further comprises the following steps: and if the performance test of the heterogeneous acceleration program is determined to be completed according to the process identification and the performance test data of each process, creating a test database of the heterogeneous acceleration program, and storing the performance test data of each process to the test database. Through the creation of the test database, the persistent storage of the performance test data is realized, so that a data base is provided for the generation of a performance test report.
After storing the performance test data of each process in the test database, the method further comprises the following steps: and displaying the visual structure chart according to the performance test data of each process in the test database. And respectively displaying the Gantt chart under each process in different display rows so as to visually display the performance test result for a tester.
After the heterogeneous acceleration program is run based on the runtime system, the method further comprises the following steps: recording initialization time points of each process of the heterogeneous acceleration program through the runtime system; the displaying of the visual structure diagram according to the performance test data of each process in the test database comprises the following steps: acquiring the relative delay time of each process according to the initialization time point of each process; and displaying a visual structure chart according to the relative delay time of each process and the performance test data. When the visual structure chart is drawn in sequence according to the initialization time point of each process, the time difference among the performance test nodes of each process is visually displayed.
The obtaining performance test data of each process according to each process identifier includes: and respectively acquiring the performance test data of each process based on different communication channels according to each process identifier. After the performance test data of each process is obtained, the system does not need to add process identification in the transmission protocol during operation, and can directly transmit the performance test data through a matched communication channel, thereby avoiding the data combination of the transmission protocol; the performance test system can directly acquire the performance test data under the corresponding process through different communication channels, so that the data analysis of a transmission protocol is avoided, and the transmission efficiency of the performance test data is further improved.
The performance test data comprises interface performance data and calculation performance data; the interface performance data comprises interface calling time and interface returning time of the runtime system; the computing performance data includes a computing start time and a computing end time of the heterogeneous accelerator. The interface performance data and the calculation performance data respectively reflect the calling efficiency of the heterogeneous acceleration program to the runtime system and the heterogeneous accelerator, and the performance test is performed from the two ends of the runtime system and the heterogeneous accelerator, so that a more comprehensive performance test result is obtained.
According to another aspect of the present invention, there is provided a performance testing apparatus for a heterogeneous acceleration program, including:
the process management table acquisition module is used for creating a process management table of the heterogeneous acceleration program to be tested and operating the heterogeneous acceleration program based on the runtime system;
a process identifier obtaining module, configured to, if it is detected that the heterogeneous acceleration program includes multiple processes, respectively record a process identifier of each process through the process management table;
and the test data acquisition module is used for respectively acquiring the performance test data of each process according to each process identifier.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method for performance testing of a heterogeneous acceleration program according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a performance testing method of a heterogeneous acceleration program according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the process identification of each process is managed by creating the process management table of the heterogeneous acceleration program to be tested, and the performance test data of each process is respectively obtained according to the obtained process identification, so that the performance test time of the heterogeneous acceleration program is reduced, the test data obtaining efficiency is improved, the performance test data of multiple processes is obtained under the single operation of the heterogeneous acceleration program, the phenomenon of data errors caused by manual data combination is avoided, and the accuracy of the performance test result is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a performance testing method for a heterogeneous acceleration program according to an embodiment of the present invention;
fig. 2 is a flowchart of a performance testing method of a heterogeneous acceleration program according to a second embodiment of the present invention;
fig. 3A is a flowchart of a performance testing method of a heterogeneous acceleration program according to a third embodiment of the present invention;
fig. 3B is a schematic structural diagram of a performance analysis system of a heterogeneous acceleration program according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a performance testing apparatus for a heterogeneous acceleration program according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a performance testing method of a heterogeneous acceleration program according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a performance testing method of a heterogeneous acceleration program according to an embodiment of the present invention, where the method may be adapted to obtain performance testing data under each process of the heterogeneous acceleration program by creating a process management table of the heterogeneous acceleration program, and the method may be executed by a performance testing apparatus of the heterogeneous acceleration program, where the performance testing apparatus of the heterogeneous acceleration program may be implemented in a form of hardware and/or software, and the performance testing apparatus of the heterogeneous acceleration program may be configured in a performance testing system, and the performance testing system may be configured in an electronic device such as a server, a server cluster composed of multiple servers, or a terminal device. As shown in fig. 1, the method includes:
s110, creating a process management table of the heterogeneous acceleration program to be tested, and running the heterogeneous acceleration program based on a runtime system.
When the heterogeneous acceleration program runs, in order to ensure a high calculation speed and scheduling of system resources, data operation is often required to be performed through a plurality of processes, and therefore, when the performance test system executes a performance test of the heterogeneous acceleration program, a process management table matched with the heterogeneous acceleration program is firstly created for managing each process of the heterogeneous acceleration program. After obtaining a source code file of a heterogeneous acceleration program to be tested, a performance test system compiles the source code file to obtain an executable program, and can directly execute a performance test aiming at the executable program, namely, at the moment, matched performance test data is obtained according to a preset performance test item; after the executable program is obtained, the performance test may be executed based on the obtained user test instruction, that is, at this time, the specified performance test item is obtained by analyzing the user test instruction, and the matched performance test data is obtained according to the performance test item obtained by analyzing. The Run-time System (Run-time System) is an operating environment of semi-compiled codes on the electronic device, and after a source code file of the heterogeneous acceleration program is compiled into an executable program, the Run-time System is connected to the executable program, that is, the Run-time System is started along with the starting of the heterogeneous acceleration program.
And S120, if the heterogeneous acceleration program is detected to comprise a plurality of processes, respectively recording the process identification of each process through the process management table.
When the heterogeneous acceleration program is started, the runtime system runs along with each application process and executes initialization, and in the initialization process, the runtime system acquires the process identifier of each process and records the process identifier of each process through the process management table; the performance testing system can also ensure that the heterogeneous acceleration program runs normally by creating system resources required by the heterogeneous acceleration program and modifying environment variables of the heterogeneous acceleration program, for example, setting a search Path (Path) of a source code file of the heterogeneous acceleration program, before the heterogeneous acceleration program runs based on the runtime system.
Particularly, the process identifier in the embodiment of the present invention may be composed of a program identifier of the heterogeneous acceleration program and a start sequence number of the process; wherein, each process under the same heterogeneous acceleration program corresponds to the same program identifier, and processes under different heterogeneous acceleration programs correspond to different program identifiers; the starting sequence number of the process reflects the starting sequence of the process under the current heterogeneous acceleration program, and each process under the same heterogeneous acceleration program obviously corresponds to different starting sequence numbers.
In the prior art, after a program running system allocates a process identifier to a process, it can only be ensured that the process identifiers of the currently running processes are different, but after the running of a process is completed and recovered by the system, the process identifier of the process may be allocated to other subsequently started processes, so that different processes started successively under a heterogeneous acceleration program may use the same process identifier; in the embodiment of the present invention, when the runtime system allocates the process identifier to each process based on the rule, the process identifiers of different heterogeneous acceleration programs are different due to the program identifier, and the start sequence number ensures that the process identifiers of each process under the same heterogeneous acceleration program are different, so that even after the current process is completely recovered, the process identifier difference between the recovered process and the subsequent start process can be maintained, thereby ensuring one-to-one matching between the process and the process identifier, and avoiding the occurrence of performance test data confusion under different processes.
And S130, respectively acquiring the performance test data of each process according to each process identifier.
The heterogeneous acceleration program transmits a data calculation task to an interface of a heterogeneous accelerator through an interface of a runtime system, the heterogeneous accelerator processes the data calculation task, and a calculation result is returned to the heterogeneous acceleration program through the self interface and the runtime system interface; the performance test data may include an interface name and a calling time of a runtime system called by the heterogeneous acceleration program, and an interface name and a calling time of the called heterogeneous accelerator; after the performance test data of each process is acquired, the runtime system can add a process identifier in the header information of the transmission protocol and send the performance test data including the process identifier to the performance test system; the performance test system can obtain the process identification by reading the head information of the transmission protocol, and associates the performance test data under the transmission protocol with the process identification so as to distinguish the performance test data under different processes.
Particularly, the performance test system can also judge whether the performance test is in accordance with the expectation or not based on the acquired performance test data, and generate a performance test report; for example, the acquired runtime system interface and/or heterogeneous accelerator interface is compared with an expected interface, so as to verify whether an interface object called by a heterogeneous accelerator program is wrong; and comparing the acquired calling time of the running system interface and/or the calling time of the heterogeneous accelerator interface with the expected time to verify whether the heterogeneous acceleration program has delayed calling.
Optionally, in this embodiment of the present invention, before the running the heterogeneous acceleration program based on the runtime system, the method further includes: creating a shared memory matched with the heterogeneous acceleration program; after the heterogeneous acceleration program is run based on the runtime system, the method further comprises the following steps: transmitting the process identification of the heterogeneous acceleration program to the shared memory through the runtime system; the obtaining performance test data of each process according to each process identifier includes: and transmitting the performance test data of each process to the shared memory through the runtime system according to each process identifier.
Specifically, after the runtime system transmits the process identifier of the heterogeneous acceleration program to the shared memory, the performance test system reads the process identifier through the shared memory; when the system obtains the performance test data of each process during operation and transmits the performance test data to the shared memory, the performance test system can also read the performance test data through the shared memory; compared with the traditional technical scheme, the test data transmission is carried out by reading and writing the data file, the shared memory greatly improves the data transmission speed, and the acquisition efficiency of the performance test data is improved.
Optionally, in the embodiment of the present invention, after the performance test data of each process is respectively obtained according to each process identifier, the method further includes: and if the performance test of the heterogeneous acceleration program is determined to be completed according to the process identification and the performance test data of each process, creating a test database of the heterogeneous acceleration program, and storing the performance test data of each process to the test database. In the process of calling the heterogeneous accelerator by the heterogeneous acceleration program, the system performs local caching on the acquired performance test data during operation, and after the heterogeneous acceleration program finishes operation, the performance test data cached locally is directly transmitted to the performance test system or is transmitted to the performance test system through a shared memory; and the performance test system determines that the performance test of the heterogeneous acceleration program is completed if the matched performance test data is obtained under each process according to each process identifier in the process management table, and then realizes the persistent storage of the performance test data by creating a test database, thereby providing a data basis for the generation of a performance test report.
Optionally, in the embodiment of the present invention, the performance test data includes interface performance data and calculation performance data; the interface performance data comprises interface calling time and interface returning time of the runtime system; the computing performance data includes a computing start time and a computing end time of the heterogeneous accelerator. The heterogeneous acceleration program sends the data calculation task to the heterogeneous accelerator interface by calling the runtime system interface, wherein the interface calling time is the time point when the heterogeneous acceleration program calls the runtime system interface, and the interface returning time is the time point when the runtime system interface is called and then returns a calling identifier; after acquiring a data calculation task through a self interface, the heterogeneous accelerator performs data calculation and feeds back a data calculation result to the runtime system; the calculation starting time is the time point of returning the calling identifier after the heterogeneous accelerator interface is called, namely the heterogeneous accelerator executes a data calculation task after the interface of the heterogeneous accelerator is called; the calculation end time is the return time of the heterogeneous accelerator for completing the data calculation task and returning the data calculation result through the interface; the interface performance data and the calculation performance data respectively reflect the calling efficiency of the heterogeneous acceleration program to the runtime system and the heterogeneous accelerator, and the performance test is performed from the two ends of the runtime system and the heterogeneous accelerator, so that a more comprehensive performance test result is obtained.
Optionally, in this embodiment of the present invention, the obtaining, according to the process identifier, performance test data of each process separately includes: and respectively acquiring the performance test data of each process based on different communication channels according to each process identifier. When the run-time system transmits the process identifier to the performance test system or transmits the process identifier to the shared memory, the association relationship between the communication channel and the process, that is, the corresponding relationship between the channel identifier and the process identifier can be synchronously transmitted; the performance test system can acquire the process identification of each process and also can acquire a communication channel used by each process; therefore, after the performance test data of each process is acquired, the system does not need to add a process identifier in the transmission protocol, the performance test data can be directly transmitted through a matched communication channel, and the data combination of the transmission protocol is avoided; the performance test system can directly acquire the performance test data under the corresponding process through different communication channels, so that the data analysis of a transmission protocol is avoided, and the transmission efficiency of the performance test data is further improved.
According to the technical scheme provided by the embodiment of the invention, the process identification of each process is managed by creating the process management table of the heterogeneous acceleration program to be tested, and the performance test data of each process is respectively obtained according to the obtained process identification, so that the performance test time of the heterogeneous acceleration program is reduced, the test data obtaining efficiency is improved, the performance test data of multiple processes is obtained under the single operation of the heterogeneous acceleration program, the phenomenon of data errors caused by manual data combination is avoided, and the accuracy of the performance test result is improved.
Example two
Fig. 2 is a flowchart of a performance testing method for a heterogeneous acceleration program according to a second embodiment of the present invention, which is embodied on the basis of the foregoing technical solution, and in this embodiment, a visual structure diagram is displayed according to performance testing data of each process in a testing database, where the method specifically includes:
s210, creating a process management table of the heterogeneous acceleration program to be tested, and running the heterogeneous acceleration program based on a runtime system.
And S220, if the heterogeneous acceleration program is detected to comprise a plurality of processes, respectively recording the process identification of each process through the process management table.
And S230, respectively acquiring performance test data of each process according to each process identifier.
S240, if the performance test of the heterogeneous acceleration program is determined to be completed according to the process identification and the performance test data of each process, a test database of the heterogeneous acceleration program is created, and the performance test data of each process is stored in the test database.
And S250, displaying the visual structure chart according to the performance test data of each process in the test database.
The performance test system generates a visual script file according to the performance test data, and generates a front-end page through rendering, so as to display a visual structure diagram (such as a Gantt chart); taking the above technical solution as an example, the performance test data of each process includes four time nodes, that is, the interface call time and the interface return time of the runtime system, and the calculation start time and the calculation end time of the heterogeneous accelerator, the performance test node of each process is displayed in the form of a gantt chart according to the sequence of each time node, and the gantt chart under each process is displayed in different display rows respectively, so as to visually display the performance test result to a tester.
Optionally, in this embodiment of the present invention, after the running the heterogeneous acceleration program based on the runtime system, the method further includes: recording initialization time points of each process of the heterogeneous acceleration program through the runtime system; the displaying a visual structure diagram according to the performance test data of each process in the test database comprises: acquiring the relative delay time of each process according to the initialization time point of each process; and displaying a visual structure chart according to the relative delay time of each process and the performance test data.
Specifically, the heterogeneous acceleration program often starts processes at different calculation stages respectively according to different data calculation tasks, so that the starting time of different processes is often different; according to the technical scheme, the runtime system records the initialization time point of each process of the heterogeneous acceleration program; the performance test system acquires the relative delay time of each process according to the initialization time point of each process; for example, the first process is process a, and the relative delay times of process B and process C with process a are 3 seconds and 5 seconds, respectively; when the visual structure chart is drawn, the display sequence of each process is determined based on the relative delay time, so that the performance test data of each process is sequentially displayed through different display lines, and Gantt charts of a process A, a process B and a process C are sequentially displayed by taking the technical scheme as an example; and when the time node of the performance test is drawn in each display line, the relative delay time between different processes is removed, and the starting point of each display line is ensured to be the same (for example, the time starting point of each display line is the interface calling time of the runtime system), so that the time difference between the performance test nodes of each process is visually shown when the visual structure diagram is drawn in sequence according to the initialization time point of each process.
According to the technical scheme provided by the embodiment of the invention, after the test database of the heterogeneous acceleration program is created and the performance test data of each process is stored in the test database, the performance test result is visually displayed in a visual structure diagram mode according to the performance test data of each process in the test database, and the relative delay time between different processes is removed in each display line, so that the starting point of each display line is ensured to be the same, and the time difference between the performance test nodes of each process is more visually displayed.
EXAMPLE III
Fig. 3A is a flowchart of a performance testing method for a heterogeneous acceleration program according to a third embodiment of the present invention, which is embodied on the basis of the foregoing technical solutions, and in the embodiment of the present invention, taking the performance testing system shown in fig. 3B as an example, a performance testing system is used to perform a performance test on the heterogeneous acceleration program, where the method specifically includes:
s301, obtaining the heterogeneous acceleration program to be tested.
Taking fig. 3B as an example, the performance testing system includes a performance analysis module and a test execution module; the test execution module is implanted or integrated in the runtime system in advance; the performance analysis module comprises an instruction acquisition unit, a process management unit, a first data transmission unit, a resource construction unit, a front-end drawing unit and a database management unit; the test execution module comprises a first data acquisition unit, a second data acquisition unit, a performance data caching unit and a second data transmission unit. When the performance test system executes the performance test of the heterogeneous acceleration program, the performance analysis module is used for acquiring a source code file of the heterogeneous acceleration program to be tested, which is uploaded by a user.
S302, obtaining a user test instruction, and obtaining a performance test item by analyzing the user test instruction.
The performance analysis module acquires the user test instruction through the instruction acquisition unit and acquires the performance test item specified in the user test instruction after analysis.
S303, creating a process management table of the heterogeneous acceleration program to be tested and a shared memory matched with the heterogeneous acceleration program, and sending the performance test item to the runtime system.
The performance analysis module creates a process management table of the heterogeneous acceleration program to be tested through the process management unit, creates a shared memory matched with the heterogeneous acceleration program through the resource construction unit, and then sends the obtained designated performance test item to the test execution module through the first data transmission unit.
And S304, operating the heterogeneous acceleration program based on the runtime system.
The performance analysis module runs a heterogeneous acceleration program based on the runtime system.
S305, acquiring a plurality of process identifications of the heterogeneous acceleration program and an initialization time point of each process through the runtime system, and transmitting each process identification and the initialization time point to the shared memory through the runtime system.
And after the test execution module acquires the process identification of each process of the heterogeneous acceleration program and the initialization time point of each process, transmitting each process identification to the shared memory through the second data transmission unit.
S306, acquiring the process identification of each process through the shared memory.
The performance analysis module reads the process identification of each process and the initialization time point of each process through the first data transmission unit, and then records the process identification and the initialization time point of the process through the process management unit.
And S307, acquiring performance test data of each process through the runtime system according to the process identification and the performance test item, and transmitting the performance test data of each process to the shared memory.
The runtime system obtains the interface performance data of the heterogeneous acceleration program through the first data acquisition unit, obtain the computational performance data of the heterogeneous acceleration program through the second data acquisition unit, and carry on the local cache of the above-mentioned performance test data through the performance data cache unit; and then the performance test data in the performance data cache unit is transmitted to the shared memory through the second data transmission unit.
And S308, acquiring the performance test data of each process through the shared memory.
And the performance analysis module reads the performance test data of each process through the shared memory.
S309, if the performance test of the heterogeneous acceleration program is determined to be completed according to the process identification and the performance test data of each process, a test database of the heterogeneous acceleration program is created, and the performance test data of each process is stored in the test database.
And if the performance analysis module determines that the performance test of the heterogeneous acceleration program is finished according to the process identification and the performance test data of each process, a test database of the heterogeneous acceleration program is established through the database management unit, and the performance test data of each process is stored in the test database through the database management unit.
S310, acquiring the relative delay time of each process according to the initialization time point of each process; and displaying the visual structure chart according to the relative delay time of each process and the performance test data.
The performance analysis module acquires the relative delay time of each process according to the initialization time point of each process through the front-end drawing unit; and displaying the visual structure chart according to the relative delay time of each process and the performance test data.
According to the technical scheme provided by the embodiment of the invention, the process identification of each process is managed by creating the process management table of the heterogeneous acceleration program to be tested, and the performance test data of each process is respectively obtained according to the obtained process identification, so that the performance test time of the heterogeneous acceleration program is reduced, the test data obtaining efficiency is improved, the performance test data of multiple processes is obtained under the single operation of the heterogeneous acceleration program, the phenomenon of data errors caused by manual data combination is avoided, and the accuracy of the performance test result is improved.
Example four
Fig. 4 is a schematic structural diagram of a performance testing apparatus for a heterogeneous acceleration program according to a fourth embodiment of the present invention, where the apparatus includes: a process management table acquisition module 410, a process identification acquisition module 420 and a test data acquisition module 430;
a process management table obtaining module 410, configured to create a process management table of a heterogeneous acceleration program to be tested, and run the heterogeneous acceleration program based on a runtime system;
a process identifier obtaining module 420, configured to, if it is detected that the heterogeneous acceleration program includes multiple processes, respectively record, through the process management table, a process identifier of each process;
the test data obtaining module 430 is configured to obtain performance test data of each process according to each process identifier.
According to the technical scheme provided by the embodiment of the invention, the process identification of each process is managed by creating the process management table of the heterogeneous acceleration program to be tested, and the performance test data of each process is respectively obtained according to the obtained process identification, so that the performance test time of the heterogeneous acceleration program is reduced, the test data obtaining efficiency is improved, the performance test data of multiple processes is obtained under the single operation of the heterogeneous acceleration program, the phenomenon of data errors caused by manual data combination is avoided, and the accuracy of the performance test result is improved.
Optionally, the performance testing apparatus for a heterogeneous acceleration program includes:
the shared memory creating module is used for creating a shared memory matched with the heterogeneous acceleration program;
and the process data transmission module is used for transmitting the process identifier of the heterogeneous acceleration program to the shared memory through the runtime system, and transmitting the performance test data of each process to the shared memory through the runtime system according to each process identifier.
Optionally, the performance testing apparatus for a heterogeneous acceleration program includes:
and the test database creating module is used for creating a test database of the heterogeneous acceleration program and storing the performance test data of each process into the test database if the performance test of the heterogeneous acceleration program is determined to be completed according to the process identification and the performance test data of each process.
Optionally, the performance testing apparatus for a heterogeneous acceleration program includes:
and the visual structure chart display module is used for displaying the visual structure chart according to the performance test data of each process in the test database.
Optionally, the performance testing apparatus for a heterogeneous acceleration program includes:
and the initialization time point acquisition module is used for recording the initialization time points of the processes of the heterogeneous acceleration program through the runtime system.
Optionally, the visualization structure diagram display module is specifically configured to obtain the relative delay time of each process according to the initialization time point of each process; and displaying a visual structure chart according to the relative delay time of each process and the performance test data.
Optionally, the test data obtaining module 430 is specifically configured to obtain, according to the process identifier, performance test data of each process based on different communication channels.
Optionally, the performance test data includes interface performance data and calculation performance data; the interface performance data comprises interface calling time and interface returning time of the runtime system; the computing performance data includes a computing start time and a computing end time of the heterogeneous accelerator.
The performance testing device for the heterogeneous acceleration program provided by the embodiment of the invention can execute the performance testing method for the heterogeneous acceleration program provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
FIG. 5 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 may also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as a performance testing method for a heterogeneous acceleration program.
In some embodiments, the performance testing method of the heterogeneous acceleration program may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the performance testing method of the heterogeneous accelerated program described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured by any other suitable means (e.g., by means of firmware) to perform the performance testing method of the heterogeneous acceleration program.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A performance testing method for a heterogeneous acceleration program is characterized by comprising the following steps:
creating a process management table of a heterogeneous acceleration program to be tested, and running the heterogeneous acceleration program based on a runtime system;
if the heterogeneous acceleration program is detected to comprise a plurality of processes, respectively recording the process identification of each process through the process management table;
and respectively acquiring the performance test data of each process according to each process identifier.
2. The method of claim 1, further comprising, before running the heterogeneous acceleration program based on a runtime system:
creating a shared memory matched with the heterogeneous acceleration program;
after the heterogeneous acceleration program is run based on the runtime system, the method further comprises the following steps:
transmitting the process identification of the heterogeneous acceleration program to the shared memory through the runtime system;
the obtaining performance test data of each process according to each process identifier includes:
and transmitting the performance test data of each process to the shared memory through the runtime system according to each process identifier.
3. The method of claim 1, after obtaining performance test data of each process according to each process identifier, further comprising:
and if the performance test of the heterogeneous acceleration program is determined to be completed according to the process identification and the performance test data of each process, creating a test database of the heterogeneous acceleration program, and storing the performance test data of each process to the test database.
4. The method of claim 3, wherein after storing the performance test data for each of the processes in the test database, further comprising:
and displaying a visual structure chart according to the performance test data of each process in the test database.
5. The method of claim 4, further comprising, after running the heterogeneous acceleration program based on a runtime system:
recording initialization time points of each process of the heterogeneous acceleration program through the runtime system;
the displaying a visual structure diagram according to the performance test data of each process in the test database comprises:
acquiring the relative delay time of each process according to the initialization time point of each process;
and displaying a visual structure chart according to the relative delay time of each process and the performance test data.
6. The method according to claim 1, wherein the obtaining performance test data of each process according to each process identifier respectively comprises:
and respectively acquiring the performance test data of each process based on different communication channels according to each process identifier.
7. The method of any of claims 1-6, wherein the performance test data includes interface performance data and computational performance data; the interface performance data comprises interface calling time and interface returning time of the runtime system; the computing performance data includes a computing start time and a computing end time of the heterogeneous accelerator.
8. A performance testing apparatus for a heterogeneous acceleration program, comprising:
the process management table acquisition module is used for creating a process management table of the heterogeneous acceleration program to be tested and operating the heterogeneous acceleration program based on the runtime system;
a process identifier obtaining module, configured to record, if it is detected that the heterogeneous acceleration program includes multiple processes, a process identifier of each process through the process management table;
and the test data acquisition module is used for respectively acquiring the performance test data of each process according to each process identifier.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of performance testing of a heterogeneous acceleration program of any of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the method for performance testing of a heterogeneous acceleration program according to any one of claims 1 to 7 when executed.
CN202210735044.3A 2022-06-27 2022-06-27 Performance test method and device of heterogeneous acceleration program and storage medium Pending CN115061925A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210735044.3A CN115061925A (en) 2022-06-27 2022-06-27 Performance test method and device of heterogeneous acceleration program and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210735044.3A CN115061925A (en) 2022-06-27 2022-06-27 Performance test method and device of heterogeneous acceleration program and storage medium

Publications (1)

Publication Number Publication Date
CN115061925A true CN115061925A (en) 2022-09-16

Family

ID=83202671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210735044.3A Pending CN115061925A (en) 2022-06-27 2022-06-27 Performance test method and device of heterogeneous acceleration program and storage medium

Country Status (1)

Country Link
CN (1) CN115061925A (en)

Similar Documents

Publication Publication Date Title
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN115599438A (en) Method, device, equipment and medium for constructing application program publishing package
CN115061925A (en) Performance test method and device of heterogeneous acceleration program and storage medium
CN115017047A (en) Test method, system, equipment and medium based on B/S architecture
CN115269431A (en) Interface testing method and device, electronic equipment and storage medium
CN115357023A (en) Method, device and equipment for replaying running data of mobile robot and storage medium
CN115509931A (en) System-based performance test method and device, electronic equipment and storage medium
CN115391204A (en) Test method and device for automatic driving service, electronic equipment and storage medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN115309558A (en) Resource scheduling management system, method, computer equipment and storage medium
CN113691403A (en) Topological node configuration method, related device and computer program product
CN109324802B (en) Method and device for configuring server
CN115967638A (en) Equipment simulation system, method, equipment and storage medium
CN113656268B (en) Performance test method and device for business service, electronic equipment and storage medium
CN116954570A (en) Method, device, equipment and storage medium for generating analog data
CN115269055A (en) Nginx request data acquisition method, device, equipment and storage medium
CN115757186A (en) Performance test method, device, equipment and medium of software interface
CN115859300A (en) Vulnerability detection method and device, electronic equipment and storage medium
CN115757275A (en) Asset information management method and device, electronic equipment and storage medium
CN117573776A (en) Data synchronization method and device, storage medium and electronic equipment
CN116319633A (en) Instant messaging method, device, equipment and storage medium
CN116627820A (en) Data creation method, device, equipment and medium
CN115495380A (en) Test case generation method and device, electronic equipment and storage medium
CN115665005A (en) Equipment test method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination