Communication performance analysis method and device, computer device, storage medium and product
Patent Information
- Application Number
- CN202311157695.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-09-08
AI Technical Summary
[0004]然而,在上述通信过程中,传统方法无法准确地对核函数的通信性能进行分析
[0054]上述通信性能分析方法、装置、计算机设备、存储介质和计算机程序产品,计算机设备通过响应于针对多个通信域的通信性能分析指令,创建与各通信域分别对应的通信分析实例;针对各通信域,通过通信域对应的通信分析实例对该通信域进行通信监控,得到该通信域的通信数据;并根据该通信域的通信数据对该通信域内的加速卡进行通信性能分析,得到加速卡的通信性能分析结果。也就是说,在本申请实施例中,针对具有多个通信域的复杂通信场景,可以针对每个通信域,分别创建与各通信域对应的通信分析实例;基于此,便可以基于各通信域分别对应的通信分析实例,同步对各通信域进行通信监控,从而得到每个通信域的通信数据;采用本申请的方法,能够同时且相互独立地对各通信域进行通信监控,使得各个通信域的通信数据之间不会出现相互覆盖,避免所记录的通信数据出现混乱;提高对各通信域的通信数据的精确记录和存储,从而有利于基于各个通信域的通信数据,对各通信域涉及的加速卡间的通信进行通信性能分析,提高通信性能分析的准确性。
Smart Images

Figure CN117061374B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a communication performance analysis method, apparatus, computer equipment, storage medium, and product. Background Technology
[0002] With the development of high-performance computing and artificial intelligence, the demand for computational efficiency for large amounts of data is increasing. Currently, large-scale data computation and processing can be accomplished using multiple processors or combinations of multiple computers. However, collaborative computation of large amounts of data involves communication between multiple processors or computers.
[0003] Typically, communication between multiple processors or computers is primarily accomplished through kernel functions running on accelerator cards within the processors or computers. Therefore, the communication performance of kernel functions is crucial for high-performance communication between multiple processors or computers.
[0004] However, in the aforementioned communication process, traditional methods cannot accurately analyze the communication performance of kernel functions. Summary of the Invention
[0005] Therefore, it is necessary to provide a communication performance analysis method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of communication performance analysis of kernel functions in response to the above-mentioned technical problems.
[0006] In a first aspect, this application provides a communication performance analysis method applied to computer equipment, the method comprising:
[0007] In response to communication performance analysis commands targeting multiple communication domains, a communication analysis instance corresponding to each communication domain is created; each communication domain includes different accelerator cards;
[0008] For each communication domain, communication monitoring is performed using the corresponding communication analysis instance to obtain the communication data of the communication domain;
[0009] Based on the communication data in the communication domain, the communication performance of the accelerator card in the communication domain is analyzed to obtain the communication performance analysis results of the accelerator card.
[0010] In this embodiment, the computer device, in response to communication performance analysis instructions for multiple communication domains, creates communication analysis instances corresponding to each communication domain. For each communication domain, the communication analysis instance corresponding to that domain is used to monitor communication and obtain communication data for that domain. Based on the communication data of that domain, communication performance analysis is performed on the accelerator cards within that domain to obtain the communication performance analysis results for the accelerator cards. In other words, in this embodiment, for complex communication scenarios with multiple communication domains, a communication analysis instance corresponding to each communication domain can be created. Based on this, communication monitoring of each communication domain can be performed synchronously based on the communication analysis instances corresponding to each domain, thereby obtaining communication data for each communication domain. Using the method of this application, communication monitoring of each communication domain can be performed simultaneously and independently, ensuring that communication data from different communication domains does not overlap and avoiding confusion in the recorded communication data. This improves the accurate recording and storage of communication data for each communication domain, thereby facilitating communication performance analysis of communication between accelerator cards involved in each communication domain based on the communication data of each communication domain, and improving the accuracy of communication performance analysis.
[0011] In one embodiment, the communication domain includes multiple communication processes, each communication process including at least one communication thread, and each communication thread including communication events of kernel functions running on the accelerator card; the communication domain is monitored through a communication analysis instance corresponding to the communication domain to obtain communication data of the communication domain, including:
[0012] By using the communication analysis instance corresponding to the communication domain, the communication events on each communication thread in the communication domain are monitored to obtain the communication data of each communication thread;
[0013] Based on the communication data of each communication thread, the communication data of the communication domain is obtained.
[0014] In this embodiment, when collecting communication data of the communication domain through the communication analysis instance corresponding to the communication domain, the communication events on each communication thread in the communication domain are monitored through the communication analysis instance corresponding to the communication domain to obtain the communication data of each communication thread; then, based on the communication data of each communication thread, the communication data of the communication domain is obtained; this enables the separate collection and recording of communication events of different communication threads in the communication domain, so as to clearly display the communication events of different communication threads, reduce the difficulty of communication performance analysis, and achieve accurate analysis.
[0015] In one embodiment, in response to a communication performance analysis command for multiple communication domains, a communication analysis instance corresponding to each communication domain is created, including:
[0016] Parse the communication performance analysis commands for multiple communication domains to obtain the communication analysis parameters for each communication domain;
[0017] Based on the communication analysis parameters of each communication domain, create communication analysis instances corresponding to each communication domain.
[0018] In this embodiment, communication performance analysis instructions for multiple communication domains are parsed to obtain communication analysis parameters for each communication domain. Then, based on these parameters, communication analysis instances corresponding to each communication domain are created. Using this method, users can customize communication analysis parameters for each communication domain, enabling computer devices to create targeted communication analysis instances based on user needs, thus achieving flexible testing of the communication domains.
[0019] In one embodiment, the communication analysis parameters of the communication domain include the target communication process to be monitored corresponding to the communication domain, the target communication thread to be monitored under the target communication process, and the data volume corresponding to the target communication thread; the method further includes:
[0020] Based on the data size corresponding to the target communication thread, allocate memory space to the target communication thread that matches the data size;
[0021] By using the communication analysis instance corresponding to the communication domain, the communication events on each communication thread in the communication domain are monitored to obtain the communication data of each communication thread, including:
[0022] By using the communication analysis instance corresponding to the communication domain, the communication events on the target communication thread in the communication domain are monitored;
[0023] The communication data of the communication events on the target communication thread are recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
[0024] In this embodiment, when the communication analysis parameters of the communication domain include the target communication process to be monitored corresponding to the communication domain, the target communication thread to be monitored under the target communication process, and the data size corresponding to the target communication thread, the computer device can first allocate memory space matching the data size of the target communication thread. Then, the computer device can monitor the communication events on the target communication thread in the communication domain through the communication analysis instance corresponding to the communication domain, and record the communication data of the monitored communication events on the target communication thread in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread. Using the method in this embodiment, users can monitor communication events on a specified communication thread to meet different communication analysis needs; it can improve the flexibility and operability of communication performance analysis.
[0025] In one embodiment, the communication analysis parameters of the communication domain further include a communication event identifier that begins to be recorded in the memory space on the target communication thread; the communication data of the monitored communication events on the target communication thread are recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread, including:
[0026] Determine whether the communication event on the monitored target communication thread is the starting communication event corresponding to the communication event identifier;
[0027] If so, starting from the initial communication event, the communication data of the communication events on the target communication thread that are monitored are recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
[0028] In this embodiment, it is determined whether the communication event on the monitored target communication thread is the starting communication event corresponding to the communication event identifier. If so, starting from the starting communication event, the communication data of the monitored communication event on the target communication thread is recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread. That is, in this embodiment, it is possible to monitor a specified communication event, further improving the flexibility of communication performance analysis; it is beneficial to realize the collection of communication data under different communication performance analysis needs of users, and then to conduct targeted analysis of the communication performance of the accelerator card executing a certain communication event.
[0029] In one embodiment, the method further includes:
[0030] In response to communication performance analysis commands targeting multiple communication domains, a time baseline management thread is created;
[0031] The time baseline management thread updates the timestamp information in the page lock memory in real time based on the CPU timestamp information of the computer device; the page lock memory includes different memory spaces allocated by the computer device for the communication analysis instances corresponding to each communication domain.
[0032] In this embodiment, a time baseline management thread is created, and this thread updates the timestamp information in the locked memory corresponding to each communication analysis instance in real time based on the CPU timestamp information of the computer device. This allows the communication analysis instance to obtain the start and end times of the communication events from the locked memory corresponding to the communication analysis instance when recording communication data for communication events of each communication thread. This ensures that communication events occurring on different accelerators within the communication domain are time-consistent, i.e., ensures the time consistency of communication events. It avoids the problem that inconsistent baseline times of different accelerators lead to inconsistent occurrence times of recorded communication events on different accelerators, which could affect the subsequent analysis of the accelerator card's communication performance based on the communication data of these events, resulting in inaccurate communication performance analysis.
[0033] In one embodiment, the communication data of the monitored communication events on the target communication thread is recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread, including:
[0034] If a communication event is detected on the target communication thread, the timestamp information of the communication event is obtained from the locked page memory corresponding to the target communication thread; the timestamp information of the communication event includes at least one of the communication start time and the communication end time.
[0035] Obtain the attribute information of the communication event; the attribute information of the communication event includes at least one of the following: the communication event identifier and the amount of communication data.
[0036] The attribute information and timestamp information of the communication event are recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
[0037] In this embodiment, when collecting communication data of communication events of the target communication thread through a communication analysis instance, the communication start time and communication end time in the communication data of the communication event are obtained from the locked page memory corresponding to the communication analysis instance. That is, the timestamp information of the communication event is determined based on the CPU timestamp information. This avoids the situation where the timestamp information of the communication event is inconsistent, or even time errors occur, due to the inconsistent timestamps of different accelerator cards, when the timestamps of different accelerator cards are inconsistent. By using a unified CPU timestamp to record communication events, the data of different accelerator cards can be displayed uniformly with a unified timeline, thereby improving the accuracy of communication performance analysis.
[0038] In one embodiment, the method further includes:
[0039] In response to communication performance analysis commands targeting multiple communication domains, a data export thread is created;
[0040] In response to the data export command, the communication data of each communication domain is exported through the data export thread.
[0041] In this embodiment, the computer device can also create a data export thread in response to communication performance analysis instructions for multiple communication domains; and export communication data of each communication domain through the data export thread in response to the data export instructions. By adopting the method in this embodiment, in addition to providing a traditional data export interface, a separate thread is added to implement the data export function, increasing the number of data export implementation methods; furthermore, in special cases where export is not normally invoked externally, data export can be manually controlled through the data export thread; thus improving the reliability and flexibility of data export.
[0042] In one embodiment, the data export instruction carries identification information of the target communication domain to be exported; the target communication domain is at least one of a plurality of communication domains.
[0043] In response to the data export command, the communication data of each communication domain is exported through the data export thread, including:
[0044] Based on the identification information of the target communication domain, obtain the communication data of the target communication domain corresponding to the identification information;
[0045] The data export thread exports the communication data of the target communication domain.
[0046] In this embodiment, the data export instruction can also carry the identification information of the target communication domain to be exported, so that the data export thread can export the communication data of the target communication domain; thereby realizing the function of exporting the communication data of the specified communication domain and enriching the diversity of data export.
[0047] Secondly, this application also provides a communication performance analysis device for use in computer equipment, the device comprising:
[0048] The first creation module is used to create communication analysis instances corresponding to each communication domain in response to communication performance analysis commands for multiple communication domains; each communication domain includes different accelerator cards;
[0049] The monitoring module is used to monitor the communication of each communication domain by using the corresponding communication analysis instance to obtain the communication data of the communication domain.
[0050] The analysis module is used to perform communication performance analysis on the accelerator card within the communication domain based on the communication data in the communication domain, and to obtain the communication performance analysis results of the accelerator card.
[0051] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the communication performance analysis method in the first aspect described above.
[0052] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the communication performance analysis method described in the first aspect above.
[0053] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the communication performance analysis method described in the first aspect above.
[0054] The aforementioned communication performance analysis method, apparatus, computer equipment, storage medium, and computer program product include a computer equipment that, in response to communication performance analysis instructions for multiple communication domains, creates communication analysis instances corresponding to each communication domain; for each communication domain, it performs communication monitoring on the communication domain using the corresponding communication analysis instance to obtain communication data for that communication domain; and based on the communication data of that communication domain, it performs communication performance analysis on the accelerator card within that communication domain to obtain the communication performance analysis results of the accelerator card. In other words, in this embodiment of the application, for complex communication scenarios with multiple communication domains, a communication analysis instance corresponding to each communication domain can be created. Based on this, communication monitoring of each communication domain can be performed synchronously based on the communication analysis instance corresponding to each communication domain, thereby obtaining the communication data of each communication domain. Using the method of this application, communication monitoring of each communication domain can be performed simultaneously and independently, so that the communication data of each communication domain will not overlap with each other, avoiding confusion in the recorded communication data. This improves the accuracy of recording and storing the communication data of each communication domain, which is beneficial for performing communication performance analysis on the communication between accelerator cards involved in each communication domain based on the communication data of each communication domain, thereby improving the accuracy of communication performance analysis. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 This is a system architecture diagram of a computer device in one embodiment;
[0057] Figure 2 This is an application environment diagram of the communication performance analysis method in one embodiment;
[0058] Figure 3 This is a flowchart illustrating a communication performance analysis method in one embodiment;
[0059] Figure 4 This is a flowchart illustrating the communication performance analysis method in another embodiment;
[0060] Figure 5 This is a flowchart illustrating the communication performance analysis method in another embodiment;
[0061] Figure 6 This is a flowchart illustrating the communication performance analysis method in another embodiment;
[0062] Figure 7 This is a flowchart illustrating the communication performance analysis method in another embodiment;
[0063] Figure 8 This is a flowchart illustrating the communication performance analysis method in another embodiment;
[0064] Figure 9 This is a flowchart illustrating the communication performance analysis method in another embodiment;
[0065] Figure 10 This is a schematic diagram of the overall structure of a communication performance analysis method in one embodiment;
[0066] Figure 11 This is a structural block diagram of a communication performance analysis device in one embodiment;
[0067] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0069] Before describing the technical solution of this application, the key technical terms involved in this application will be explained.
[0070] 1. Heterogeneous Programs: Applications that use dedicated accelerator computing card hardware for accelerated computing and communication; unlike ordinary applications that use the CPU inside the computer device for data calculation and communication when it comes to computing and communication, heterogeneous programs use dedicated accelerator computing chips for computing and communication when it comes to a large amount of computing, so as to achieve the purpose of efficient computing and communication. Heterogeneous programs can also be called computing card accelerator programs.
[0071] 2. Communication Analysis: By monitoring the steps, code blocks, and interfaces of the communication program's operation, the start and end times, time occupied, communication data volume, communication bandwidth, call relationships, and process data are collected and finally converted into a page for easy observation to display and analyze the operation process.
[0072] 3. Process: refers to the system process of the operating system. An application is scheduled and executed by the operating system to become a set of resources to complete a certain function.
[0073] 4. Multithreading: The smallest unit of scheduling by the operating system, a lightweight process that can share some resources within the process. Functions that a single execution unit of an application cannot complete are accomplished by multiple thread units working in parallel.
[0074] 5. Communication Domain: During the communication process, all processes that need to communicate are initialized and recorded to form a communication domain. Subsequent communication is carried out on a per-communication-domain basis.
[0075] 6. Pin memory: also known as page-locked memory, is a technology used by the operating system to prevent physical memory from being swapped out to disk.
[0076] In the fields of high-performance computing and artificial intelligence, multiple processors or computers organized in clusters are typically used to perform computations and processes on massive amounts of data. There are many types of high-performance computing systems, ranging from large clusters of standard computers to highly specialized hardware. These applications are characterized by high computational complexity and large volumes of data. During computation, these multi-processor systems and multiple computers within a cluster need to collaborate on data processing, inevitably involving inter-system communication. Because of the extremely high requirements for computational efficiency, computational algorithms, and the efficient and rational use of system resources, extremely high communication efficiency is also required.
[0077] The communication process between multiple processors or computers described above is typically executed by a program running on the processor or accelerator card within the computer. This program, referred to as a kernel function, performs the communication algorithm to achieve communication between the multiple processors or computers. Therefore, how to debug and monitor the internal operation and performance of the kernel function during communication, and how to present this information in a way that facilitates analysis of the communication efficiency between systems, is a pressing technical problem that needs to be solved.
[0078] refer to Figure 1 As shown, it illustrates the system architecture diagram of a computer device.
[0079] For communication libraries, RCCL (ROCm Communication Collectives Library) is an independent standard collection of communication libraries for accelerator cards. In existing technologies, NPKIT, a performance analysis tool developed by Microsoft for communication libraries, allows logging and analysis events to be inserted into different communication components, primarily their kernel functions. Through the Google Trace Event Format visualization tool, users can then view and understand the RCCL's workflow and performance, thus enabling communication performance analysis of accelerator cards.
[0080] However, through research on existing technologies, the current technology causes the following problems during performance analysis:
[0081] 1. In complex communication scenarios, where multiple communication domains need to be established, different communication domains contain different communication processes. Communication data from different communication domains may overlap, making it impossible to determine which communication domain the final recorded communication data belongs to. This results in communication data chaos and ultimately makes performance analysis impossible.
[0082] 2. The execution of a high-performance computing or artificial intelligence program involves multiple communications, i.e., multiple communication events, which generate a large amount of communication data. During the analysis process, it is impossible to accurately specify the content to be captured. In addition, after the communication data is captured, it is not clear which communication event in the program corresponds to the content to be displayed, which increases the difficulty of performance analysis and makes accurate analysis impossible.
[0083] 3. After obtaining performance analysis data, it needs to be exported for display and analysis. However, the current method provides the export function as an interface for the communication library to call and trigger the export of communication data. If the application does not call this interface, the export will fail, thus preventing data analysis and display. In addition, the current method only calls the interface to trigger data export after all communication data has been collected, making it impossible to export communication data in real time during the data collection process.
[0084] Based on this, this application proposes a communication performance analysis method. This method enables performance analysis of communication programs for domestically produced heterogeneous accelerators, as well as data capture and export. This improves the efficiency and accuracy of communication performance analysis for accelerator communication programs.
[0085] The communication performance analysis method provided in this application can be applied to, for example... Figure 2 In the application environment shown, computer device 102 can be a terminal or a server. Terminals include, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Servers can be implemented using independent servers or server clusters composed of multiple servers. Computer device 102 can be used for high-performance computing. Internally, computer device 102 may include a Central Processing Unit (CPU) or an accelerator card for high-speed computing.
[0086] In an exemplary embodiment, such as Figure 3 As shown, a communication performance analysis method is provided, which can be applied to... Figure 2 Taking a computer device as an example, the explanation includes the following steps 302 to 306. Wherein:
[0087] Step 302: In response to the communication performance analysis command for multiple communication domains, create a communication analysis instance corresponding to each communication domain.
[0088] Each communication domain includes different accelerator cards. A communication domain refers to multiple communication processes that need to communicate, forming a communication domain; that is, a communication domain involves communication processes between multiple accelerator cards. Therefore, different communication domains contain different accelerator cards, although the same accelerator cards can also exist. For example, when accelerator cards 1, 2, and 3 are communicating, the communication processes between accelerator cards 1, 2, and 3 can form a communication domain; when accelerator cards 1, 4, and 5 are communicating, the communication processes between accelerator cards 1, 4, and 5 can form a communication domain.
[0089] For example, an application can determine multiple communication domains based on the actual computing task and call interfaces in the communication library to organize each communication domain. Each communication domain contains communication processes that need to communicate, and communication algorithms can run within each communication process.
[0090] For example, when communication performance analysis is required for multiple communication domains, communication performance analysis instructions for multiple communication domains can be triggered. These instructions can be a single instruction containing multiple communication domain identifiers, meaning that a single instruction can trigger communication performance analysis for multiple communication domains simultaneously. Alternatively, the instruction can also include multiple instructions; for example, one communication domain can correspond to one communication performance analysis instruction. Therefore, communication performance analysis instructions for each of the multiple communication domains can be triggered separately, thereby achieving communication performance analysis for multiple communication domains.
[0091] For example, when a communication performance analysis command for multiple communication domains is obtained, in response to the command, a communication analysis instance corresponding to each of the multiple communication domains can be created. That is, one communication domain corresponds to one communication analysis instance, enabling each communication analysis instance to perform communication monitoring on the communication domain corresponding to that instance.
[0092] Step 304: For each communication domain, conduct communication monitoring through the corresponding communication analysis instance to obtain the communication data of the communication domain.
[0093] For example, a communication domain may include multiple communication processes, each communication process may include at least one communication thread, and the communication thread includes communication events of kernel functions running on the accelerator card; based on this, for each communication domain, the computer device can monitor the communication events on each communication thread in the communication domain through the communication analysis instance corresponding to the communication domain, and obtain the communication data of each communication thread; then, based on the communication data of each communication thread, the communication data of the communication domain is obtained.
[0094] That is, the communication data of the communication domain includes the communication data of each communication thread in the communication domain, and the communication data of each communication thread includes the communication data of each communication event running on that communication thread. For example, the communication data of a communication event may include, but is not limited to, at least one of the following: communication event process data, communication event attribute information, and communication event timestamp information. The communication event attribute information may include at least one of the following: a communication event identifier and the amount of communication data. The communication event identifier may be a communication event number or a unique identifier that can represent the communication event. The communication event timestamp information may include at least one of the communication start time and the communication end time of the communication event.
[0095] Step 306: Perform communication performance analysis on the accelerator card within the communication domain based on the communication data in the communication domain, and obtain the communication performance analysis results of the accelerator card.
[0096] For example, for each communication domain, once the communication data of that domain is obtained, the communication performance of the accelerator cards within that domain can be analyzed based on that communication data, thereby obtaining the communication performance analysis results of the accelerator cards. Since communication within a communication domain involves communication between multiple accelerator cards, and communication between multiple accelerator cards can include at least one communication event, during the process of obtaining the communication data of the communication domain, the communication data of each communication event on each communication thread is recorded respectively; based on this, the communication performance of communication between the various accelerator cards can be analyzed using the communication data of each communication event.
[0097] For example, when the communication data of a communication event includes a communication start time and a communication end time, the communication duration corresponding to the communication event can be calculated based on the communication start time and the communication end time; based on the communication duration corresponding to the communication event, the communication efficiency between the accelerator cards involved in the communication event can be analyzed.
[0098] For example, when the communication data of a communication event includes the amount of communication data, the actual bandwidth of the communication event can be calculated based on the amount of communication data of the communication event; based on the bandwidth, the communication capabilities between the accelerator cards involved in the communication event can be analyzed.
[0099] In the aforementioned communication performance analysis method, the computer device, in response to communication performance analysis instructions for multiple communication domains, creates communication analysis instances corresponding to each communication domain. For each communication domain, the communication analysis instance corresponding to that domain is used to monitor the communication, obtaining communication data for that domain. Based on the communication data of that domain, communication performance analysis is performed on the accelerator cards within that domain, yielding the communication performance analysis results for the accelerator cards. In other words, in this embodiment, for complex communication scenarios with multiple communication domains, a communication analysis instance corresponding to each communication domain can be created. Based on this, communication monitoring of each communication domain can be performed synchronously using the communication analysis instances corresponding to each domain, thereby obtaining communication data for each communication domain. Using the method of this application, communication monitoring of each communication domain can be performed simultaneously and independently, preventing overlap between communication data of different communication domains and avoiding confusion in the recorded communication data. This improves the accurate recording and storage of communication data for each communication domain, thereby facilitating communication performance analysis of the communication between accelerator cards involved in each communication domain based on the communication data of each communication domain, and improving the accuracy of communication performance analysis.
[0100] In an exemplary embodiment, such as Figure 4 As shown, step 302 above may include steps 402 to 404. Wherein:
[0101] Step 402: Parse the communication performance analysis instructions for multiple communication domains to obtain the communication analysis parameters for each communication domain.
[0102] The communication analysis parameters of the communication domain may include the target communication process to be monitored corresponding to the communication domain, the target communication thread to be monitored under the target communication process, and the data volume corresponding to the target communication thread.
[0103] The communication analysis parameters for each communication domain can be the same or different. In other words, the communication analysis parameters for each of the multiple communication domains that need to be monitored can be set separately to meet the user's different communication performance analysis needs for different communication domains.
[0104] For example, when there is only one communication performance analysis instruction, it may include multiple communication domains and communication analysis parameters for each communication domain. In this case, the communication performance analysis instruction is parsed to obtain the communication analysis parameters corresponding to each communication domain.
[0105] For example, if there are multiple communication performance analysis instructions, and each instruction corresponds to a communication domain, then the instruction may only include the communication analysis parameters for that communication domain. In this case, the multiple instructions are parsed separately to obtain the communication analysis parameters for each communication domain.
[0106] Step 404: Based on the communication analysis parameters of each communication domain, create communication analysis instances corresponding to each communication domain.
[0107] In other words, for each communication domain, a corresponding communication analysis instance is created based on the communication analysis parameters of that domain. This instance can then monitor communication events running on the target communication thread of the target communication process within that domain, based on those parameters. However, communication events running on non-target communication processes and non-target communication threads within the target communication process are not monitored.
[0108] In this embodiment, communication performance analysis instructions for multiple communication domains are parsed to obtain communication analysis parameters for each communication domain. Then, based on these parameters, communication analysis instances corresponding to each communication domain are created. Using this method, users can customize communication analysis parameters for each communication domain, enabling computer devices to create targeted communication analysis instances based on user needs, thus achieving flexible testing of the communication domains.
[0109] In one exemplary embodiment, when the communication analysis parameters in the communication domain include the target communication process to be monitored corresponding to the communication domain, the target communication thread to be monitored under the target communication process, and the data size corresponding to the target communication thread; such as Figure 5 As shown, the above method may also include step 502.
[0110] Step 502: Allocate memory space matching the data size for the target communication thread based on the data size corresponding to the target communication thread.
[0111] For example, when there are multiple target communication threads to be monitored corresponding to a communication domain, the computer device can allocate memory space matching the data size of each target communication thread according to the data size of each target communication thread; that is, allocate memory space for each target communication thread, and the content space is used to store the communication data of the communication events running on the target communication thread.
[0112] It should be noted that the amount of data corresponding to each target communication thread can be the same or different.
[0113] Based on this, the process by which a computer device monitors communication events on each communication thread in a communication domain through a communication analysis instance corresponding to the communication domain, and obtains communication data for each communication thread, may include steps 504 and 506. Among them,
[0114] Step 504: Monitor communication events on the target communication thread in the communication domain using the communication analysis instance corresponding to the communication domain.
[0115] Step 506: Record the communication data of the communication events on the monitored target communication thread in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
[0116] In other words, when a user specifies that certain communication threads should be monitored, the computer device can monitor the communication events running on the target communication thread in the communication domain according to the user's specification, and record the communication data of the monitored communication events on the target communication thread in the memory space corresponding to the target communication thread, thereby obtaining the communication data of the target communication thread.
[0117] In this embodiment, when the communication analysis parameters of the communication domain include the target communication process to be monitored corresponding to the communication domain, the target communication thread to be monitored under the target communication process, and the data size corresponding to the target communication thread, the computer device can first allocate memory space matching the data size of the target communication thread. Then, the computer device can monitor the communication events on the target communication thread in the communication domain through the communication analysis instance corresponding to the communication domain, and record the communication data of the monitored communication events on the target communication thread in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread. Using the method in this embodiment, users can monitor communication events on a specified communication thread to meet different communication analysis needs; it can improve the flexibility and operability of communication performance analysis.
[0118] In one exemplary embodiment, the communication analysis parameters of the aforementioned communication domain may further include a communication event identifier that has begun to be recorded in memory space on the target communication thread; based on this, such as Figure 6 As shown, step 506 above may include steps 602 to 604. Wherein:
[0119] Step 602: Determine whether the communication event on the monitored target communication thread is the starting communication event corresponding to the communication event identifier.
[0120] Step 604: If yes, then starting from the initial communication event, record the communication data of the communication events on the monitored target communication thread in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
[0121] For example, the communication event identifier can be a communication event number; when monitoring communication events on the target communication thread in the communication domain through the communication analysis instance corresponding to the communication domain, if a communication event on the target communication thread is monitored, a communication event number can be added to the monitored communication event.
[0122] Based on this, when a communication event is monitored on the target communication thread, it can be determined whether the communication event number of the currently monitored communication event is consistent with the communication event number at the beginning of recording. If they are consistent, it means that the currently monitored communication event is the starting communication event for recording communication data. Then, starting from this starting communication event, the communication data of the starting communication event and the communication data of the subsequent monitored communication events on the target communication thread are all recorded in the memory space corresponding to the target communication thread, thereby obtaining the communication data of the target communication thread.
[0123] Assuming the initial communication event to be recorded is the fifth communication event, then when the first, second, third, and fourth communication events of the target communication thread are detected, the corresponding communication data for these events are not recorded. Only when the fifth communication event of the target communication thread is detected does the communication data of the fifth communication event, as well as the communication data of the sixth, seventh, and subsequent communication events, begin to be recorded in the memory space corresponding to the target communication thread, until the memory space corresponding to the target communication thread is full, or until the last communication event on the target communication thread is detected, or until the communication data acquisition time ends.
[0124] In this embodiment, it is determined whether the communication event on the monitored target communication thread is the starting communication event corresponding to the communication event identifier. If so, starting from the starting communication event, the communication data of the monitored communication event on the target communication thread is recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread. That is, in this embodiment, it is possible to monitor a specified communication event, further improving the flexibility of communication performance analysis; it is beneficial to realize the collection of communication data under different communication performance analysis needs of users, and then to conduct targeted analysis of the communication performance of the accelerator card executing a certain communication event.
[0125] In an exemplary embodiment, such as Figure 7 As shown, the above communication performance analysis method may further include steps 702 to 704. Wherein:
[0126] Step 702: In response to a communication performance analysis command for multiple communication domains, a time baseline management thread is created.
[0127] In other words, when a computer device receives a communication performance analysis instruction for multiple communication domains, it creates a communication analysis instance corresponding to each communication domain, creates a time baseline management thread on the computer device, and runs the time baseline management thread.
[0128] For example, after creating communication analysis instances corresponding to each communication domain, page lock memory can be allocated to each communication analysis instance for each communication domain, so that both the CPU of the computer device and the communication analysis instance can access the page lock memory corresponding to the communication analysis instance.
[0129] Step 704: The time baseline management thread updates the timestamp information in the locked page memory in real time based on the CPU timestamp information of the computer device.
[0130] Page-locked memory comprises different memory spaces allocated by the computer device for each communication analysis instance corresponding to a communication domain. That is, one page-locked memory space corresponds to one communication analysis instance for each communication domain.
[0131] For example, when collecting communication data from communication domains through communication analysis instances in each communication domain, by running the time baseline management thread, the timestamp information in the locked memory corresponding to each communication analysis instance can be updated in real time based on the CPU timestamp information of the computer device. This allows the communication analysis instance to obtain the start and end times of the communication events from the locked memory corresponding to the communication analysis instance when recording communication data for communication events of each communication thread. This ensures that communication events occurring on different accelerators within the communication domain are time-consistent, i.e., ensures the time consistency of communication events. It avoids the problem of inconsistent occurrence times of recorded communication events on different accelerators due to inconsistent base times, which could affect the subsequent analysis of the accelerator card's communication performance based on the communication data of the communication events, leading to inaccurate communication performance analysis.
[0132] For example, in a communication domain including communication between accelerator card 1 and accelerator card 2, assuming accelerator card 1 sends a communication request to accelerator card 2, for this communication event, accelerator card 1 will record the request sending time, and accelerator card 2 will record the request receiving time. If the reference times of accelerator card 1 and accelerator card 2 are inconsistent, and accelerator card 1 records the request sending time based on its own reference time, while accelerator card 2 records the request receiving time based on its own reference time, then there will be an inaccurate time difference when determining the time difference based on the request sending time and the request receiving time.
[0133] However, if both accelerator card 1 and accelerator card 2 use CPU time as the base time, accelerator card 1 will record the request sending time based on the CPU's base time, and accelerator card 2 will record the request receiving time based on the CPU's base time. Therefore, the time difference determined by the request sending and receiving times will be the accurate time difference between request sending and receiving. Only communication performance analysis based on this time difference will be truly meaningful.
[0134] In an exemplary embodiment, such as Figure 8 As shown above, in the above Figure 7 Based on the illustrated embodiment, step 506 may include steps 802 to 806. Wherein:
[0135] Step 802: If a communication event is detected on the target communication thread, the timestamp information of the communication event is obtained from the locked page memory corresponding to the target communication thread.
[0136] The timestamp information of the communication event may include at least one of the communication start time and the communication end time.
[0137] For example, a computer device can configure page lock memory for each communication analysis instance corresponding to each communication domain; then, for a communication domain, the page lock memory corresponding to each target communication thread in that communication domain is the page lock memory corresponding to the communication analysis instance of that communication domain.
[0138] When collecting communication data for a communication domain through a communication analysis instance corresponding to that communication domain, for each target communication thread in that communication domain, when a communication event is detected running on the target communication thread, the communication analysis instance can obtain the CPU timestamp information from the locked memory corresponding to the communication analysis instance as the start time of the communication event; and when the end of the communication event is detected, it can obtain the CPU timestamp information from the locked memory corresponding to the communication analysis instance as the end time of the communication event.
[0139] For example, when a user-specified target communication thread starts recording a start communication event, the communication analysis instance can obtain the CPU timestamp information from the locked page memory corresponding to the communication analysis instance when it detects that the target communication thread has reached the start communication event, as the communication start time of the start communication event; and when it detects that the start communication event has ended, it can obtain the CPU timestamp information from the locked page memory corresponding to the communication analysis instance, as the communication end time of the start communication event.
[0140] Step 804: Obtain the attribute information of the communication event.
[0141] The attribute information of a communication event includes at least one of the following: the communication event identifier and the amount of communication data.
[0142] For example, when collecting communication data of a communication domain through a communication analysis instance corresponding to that communication domain, for each target communication thread in the communication domain, if a communication event is detected running on the target communication thread, each communication event can be numbered as a communication event identifier; and when monitoring a communication event, the amount of communication data corresponding to that communication event can also be monitored, thereby obtaining the attribute information of the communication event, including the communication event identifier and the amount of communication data corresponding to the communication event.
[0143] Of course, when the user specifies a target communication thread to start recording a starting communication event, the communication analysis instance can continue to number the starting communication event based on the numbers of the communication events that occurred earlier when it monitors the target communication thread running to the starting communication event, so as to obtain the communication event identifier of the starting communication event; at the same time, it can obtain the amount of communication data of the starting communication event to obtain the attribute information of the starting communication event.
[0144] Step 806: Record the attribute information and timestamp information of the communication event in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
[0145] For example, when the attribute information and timestamp information of the communication event are recorded in the memory space corresponding to the target communication thread, the communication analysis instance can also record the communication process data of the communication event in the memory space corresponding to the target communication thread; wherein, the communication process data of the communication event is the actual communication data of the communication event, such as: communication request, request data carried in the communication request, communication request result and other actual communication data.
[0146] In this embodiment, when collecting communication data of communication events of the target communication thread through a communication analysis instance, the communication start time and communication end time in the communication data of the communication event are obtained from the locked page memory corresponding to the communication analysis instance. That is, the timestamp information of the communication event is determined based on the CPU timestamp information. This avoids the situation where the timestamp information of the communication event is inconsistent, or even time errors occur, due to the inconsistent timestamps of different accelerator cards, when the timestamps of different accelerator cards are inconsistent. By using a unified CPU timestamp to record communication events, the data of different accelerator cards can be displayed uniformly with a unified timeline, thereby improving the accuracy of communication performance analysis.
[0147] In one exemplary embodiment, such as Figure 9 As shown, the above method may further include steps 902 to 904. Wherein:
[0148] Step 902: In response to a communication performance analysis command for multiple communication domains, a data export thread is created.
[0149] In other words, when a computer device receives a communication performance analysis instruction for multiple communication domains, it creates a communication analysis instance corresponding to each communication domain. On the other hand, it creates a data export thread on the computer device and runs the data export thread.
[0150] For example, when a computer device receives a communication performance analysis instruction for multiple communication domains, it can simultaneously create a communication analysis instance corresponding to each communication domain, create a time baseline management thread, and create a data export thread.
[0151] Step 904: In response to the data export command, the communication data of each communication domain is exported through the data export thread.
[0152] In other words, during the process of collecting communication data, users can trigger a data export command at any time, which will enable the computer device to export the communication data of each communication domain through the data export thread when the data export command is detected.
[0153] For example, the data export instruction may also carry identification information of the target communication domain to be exported; wherein, the target communication domain may include at least one of a plurality of communication domains. Based on this, when the computer device detects the data export instruction, it can obtain the communication data of the target communication domain corresponding to the identification information carried in the data export instruction; then, the communication data of the target communication domain is exported through the data export thread.
[0154] In other words, users can also specify the real-time export of communication data from one or more communication domains.
[0155] For example, after acquiring the communication data of the target communication domain corresponding to the identification information, the computer device can further perform pre-analysis on the communication data of the target communication domain to obtain the pre-analysis results corresponding to the target communication domain. Then, the computer device can export the communication data of the target communication domain and / or the pre-analysis results corresponding to the target communication domain through a data export thread. For example, pre-analysis of the communication data of the target communication domain may include determining the actual operating bandwidth of the target communication domain based on the communication data; or, formatting the communication data of the target communication domain, such as converting it into the display data format required by the display page, etc.
[0156] For example, if the computer device does not detect a data export instruction, the data export thread can be blocked until it receives an application termination instruction before performing the data export operation, and it will automatically close after the data export is completed.
[0157] In this embodiment, the computer device can also create a data export thread in response to communication performance analysis instructions for multiple communication domains; and export communication data of each communication domain through the data export thread in response to the data export instructions. By adopting the method in this embodiment, in addition to providing a traditional data export interface, a separate thread is added to implement the data export function, increasing the number of data export implementation methods; furthermore, in special cases where export is not normally invoked externally, data export can be manually controlled through the data export thread; thus improving the reliability and flexibility of data export.
[0158] In an exemplary embodiment, such as Figure 10 As shown, it illustrates the overall structure of a communication performance analysis method.
[0159] refer to Figure 10 As shown. First, the application can call the communication library's interface to organize communication domains, resulting in multiple communication domains. Each communication domain contains multiple communication processes that need to communicate, and the communication algorithm runs within these processes. Second, for each communication domain, a communication analysis instance is created. This instance can record parameters such as the number of threads in the target communication processes to be monitored (specified by the user), the memory size of each target communication thread recording data, and the communication event number at which communication data capture began.
[0160] Next, for each communication domain, based on the memory size of each target communication thread in the communication domain, the required memory space is allocated for each target communication thread; at the same time, a memory space for storing timestamps is allocated for the communication analysis instance of the communication domain. This memory space is stored using paged memory, which is used so that programs running on the host (CPU) and accelerator can access it simultaneously.
[0161] Furthermore, a time baseline management thread is started on the host to update the timestamp information in the locked memory corresponding to each communication analysis instance in real time based on the timestamp information of the host CPU.
[0162] Once these preparations are complete, the multiple threads started in the target communication process monitor the communication events in the kernel functions running on each target communication thread, and obtain the attribute information and timestamp information of these communication events, including event number, communication data volume, start time, and end time. The timestamp information is obtained from the paged memory managed by the time baseline management thread during the preparation process. Next, through a communication analysis instance, the attribute information and timestamp information of these communication events running on each target communication thread in the communication domain are recorded in the memory space allocated for each target communication thread according to its memory size.
[0163] In addition, once the data export thread starts, it continuously monitors externally input data export commands. If a command is received, it will export the communication data recorded by the corresponding communication analysis instance. During the export process, it can also calculate information of interest to the user based on the recorded communication event data, such as the actual operating bandwidth; furthermore, it can format the data into the format required for the display page. If the data export thread does not receive a data export command, it will block until it receives an application termination command before performing the data export operation, and then shut down itself upon completion.
[0164] The above-mentioned communication performance analysis method has the following improvement effects:
[0165] (1) In complex communication scenarios, multiple communication domains need to be established. Different communication analysis instances are created for different communication domains. Data of different communication domains are managed through different communication analysis instances, that is, the communication data of different communication domains are distinguished and recorded at the same time. They can be exported and displayed separately to directly perform performance analysis on multiple communication domains and generate communication analysis front-end display files to avoid data chaos.
[0166] (2) During the data capture process, communication events are numbered to correspond to each communication operation in the heterogeneous program. Furthermore, at the start of program execution, the space size for data capture preparation, the number of threads acquiring communication data in the heterogeneous program of the accelerator card, and the communication event number at which the data capture operation begins are specified. This method allows control over the scope of captured communication data, increasing the flexibility of data acquisition and enabling clearer and more accurate communication analysis.
[0167] (3) While providing an export interface, using a separate thread to implement the data export function can increase the number of ways to implement data export; by providing additional data export capabilities, it can avoid the situation where communication data cannot be exported because the single export interface is not called by the application. That is, in special cases, if the export interface is not called normally, data export can also be performed manually through the data export thread.
[0168] (4) Use a unified CPU timestamp to record communication events so that data from different accelerator cards can be displayed in a unified manner and have a unified timeline.
[0169] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0170] Based on the same inventive concept, this application also provides a communication performance analysis apparatus for implementing the communication performance analysis method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more communication performance analysis apparatus embodiments provided below can be found in the limitations of the communication performance analysis method described above, and will not be repeated here.
[0171] In one exemplary embodiment, such as Figure 11 As shown, a communication performance analysis device is provided, applied to computer equipment, including: a first creation module 1102, a monitoring module 1104, and an analysis module 1106, wherein:
[0172] The first creation module 1102 is used to create communication analysis instances corresponding to each communication domain in response to communication performance analysis commands for multiple communication domains; each communication domain includes different accelerator cards.
[0173] The monitoring module 1104 is used to monitor the communication of each communication domain by using the corresponding communication analysis instance to obtain the communication data of the communication domain.
[0174] Analysis module 1106 is used to perform communication performance analysis on the accelerator card in the communication domain based on the communication data in the communication domain, and obtain the communication performance analysis results of the accelerator card.
[0175] In one embodiment, the communication domain includes multiple communication processes, each communication process including at least one communication thread, and the communication thread including communication events of a kernel function running on the accelerator card; the monitoring module 1104 includes:
[0176] The monitoring submodule is used to monitor communication events on each communication thread in the communication domain through the communication analysis instance corresponding to the communication domain, and obtain the communication data of each communication thread.
[0177] The acquisition submodule is used to obtain the communication data of the communication domain based on the communication data of each communication thread.
[0178] In one embodiment, the first creation module 1102 includes:
[0179] The parsing submodule is used to parse communication performance analysis commands for multiple communication domains to obtain communication analysis parameters for each communication domain.
[0180] Create a submodule to create communication analysis instances corresponding to each communication domain based on the communication analysis parameters of each communication domain.
[0181] In one embodiment, the communication analysis parameters of the communication domain include the target communication process to be monitored corresponding to the communication domain, the target communication thread to be monitored under the target communication process, and the data volume corresponding to the target communication thread; the device further includes:
[0182] The allocation module is used to allocate memory space to the target communication thread that matches the size of the data, based on the data size corresponding to the target communication thread.
[0183] The aforementioned monitoring submodule includes:
[0184] The monitoring unit is used to monitor communication events on the target communication thread in the communication domain through the communication analysis instance corresponding to the communication domain;
[0185] The recording unit is used to record the communication data of the communication events on the target communication thread in the memory space corresponding to the target communication thread, thereby obtaining the communication data of the target communication thread.
[0186] In one embodiment, the communication analysis parameters of the communication domain further include a communication event identifier that has begun to be recorded in the memory space on the target communication thread; the recording unit includes:
[0187] The judgment subunit is used to determine whether the communication event on the monitored target communication thread is the starting communication event corresponding to the communication event identifier.
[0188] The recording subunit is used to record the communication data of the monitored communication events on the target communication thread in the memory space corresponding to the target communication thread, starting from the start communication event, when the communication event on the monitored target communication thread is the start communication event corresponding to the communication event identifier.
[0189] In one embodiment, the device further includes:
[0190] The second creation module is used to create a time baseline management thread in response to communication performance analysis commands for multiple communication domains;
[0191] The update module is used to update the timestamp information in the page lock memory in real time based on the timestamp information of the computer device's CPU through the time baseline management thread; the page lock memory includes different memory spaces allocated by the computer device for the communication analysis instances corresponding to each communication domain.
[0192] In one embodiment, the recording unit is configured to, upon monitoring a communication event on the target communication thread, obtain timestamp information of the communication event from the locked page memory corresponding to the target communication thread; the timestamp information of the communication event includes at least one of the communication start time and the communication end time of the communication event; obtain attribute information of the communication event; the attribute information of the communication event includes at least one of the communication event identifier and the amount of communication data; and record the attribute information and the timestamp information of the communication event in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
[0193] In one embodiment, the device further includes:
[0194] The third creation module is used to create a data export thread in response to communication performance analysis commands for multiple communication domains;
[0195] The export module is used to export communication data from various communication domains in response to data export commands via a data export thread.
[0196] In one embodiment, the data export instruction carries identification information of the target communication domain to be exported; the target communication domain is at least one of a plurality of communication domains; the export module includes:
[0197] The acquisition submodule is used to acquire communication data of the target communication domain corresponding to the identification information of the target communication domain.
[0198] The export submodule is used to export communication data from the target communication domain via a data export thread.
[0199] Each module in the aforementioned communication performance analysis device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0200] In one exemplary embodiment, a computer device is provided, wherein, when the computer device is a terminal, its internal structure diagram can be as follows: Figure 12As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a communication performance analysis method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0201] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0202] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the communication analysis method in any of the above embodiments.
[0203] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the communication analysis method in any of the above embodiments.
[0204] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the communication analysis method in any of the above embodiments.
[0205] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0206] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0207] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0208] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A communication performance analysis method, characterized in that, Applied to a computer device, the method includes: In response to a communication performance analysis command for multiple communication domains, a communication analysis instance corresponding to each of the communication domains is created; each communication domain includes multiple communication processes, each communication process includes at least one communication thread, and each communication thread includes communication events of a kernel function running on an accelerator card; the accelerator cards contained in each of the communication domains are at least partially different; For each of the aforementioned communication domains, communication monitoring is performed on the communication domain using the corresponding communication analysis instance to obtain the communication data of the communication domain; Based on the communication data in the communication domain, the communication performance of the accelerator card in the communication domain is analyzed to obtain the communication performance analysis results of the accelerator card.
2. The method according to claim 1, characterized in that, The step of monitoring the communication domain through a communication analysis instance corresponding to the communication domain to obtain the communication data of the communication domain includes: By using the communication analysis instance corresponding to the communication domain, the communication events on each of the communication threads in the communication domain are monitored to obtain the communication data of each of the communication threads; The communication data of the communication domain is obtained based on the communication data of each of the communication threads.
3. The method according to claim 2, characterized in that, The step of creating a communication analysis instance corresponding to each of the multiple communication domains in response to a communication performance analysis command includes: Parse the communication performance analysis commands for multiple communication domains to obtain the communication analysis parameters for each of the communication domains; Based on the communication analysis parameters of each of the communication domains, a communication analysis instance corresponding to each of the communication domains is created.
4. The method according to claim 3, characterized in that, The communication analysis parameters of the communication domain include the target communication process to be monitored corresponding to the communication domain, the target communication thread to be monitored under the target communication process, and the data volume corresponding to the target communication thread; the method further includes: Based on the data size corresponding to the target communication thread, allocate memory space to the target communication thread that matches the data size; The step of monitoring communication events on each communication thread in the communication domain through a communication analysis instance corresponding to the communication domain, and obtaining communication data for each communication thread, includes: The communication events on the target communication thread in the communication domain are monitored through the communication analysis instance corresponding to the communication domain. The communication data of the communication events monitored on the target communication thread are recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
5. The method according to claim 4, characterized in that, The communication analysis parameters of the communication domain also include a communication event identifier that begins recording on the target communication thread in the memory space; the step of recording the communication data of the monitored communication events on the target communication thread in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread includes: Determine whether the communication event monitored on the target communication thread is the starting communication event corresponding to the communication event identifier; If so, starting from the initial communication event, the communication data of the communication events monitored on the target communication thread are recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
6. The method according to claim 4 or 5, characterized in that, The method further includes: In response to the communication performance analysis command for multiple communication domains, a time baseline management thread is created; The time baseline management thread updates the timestamp information in the locked page memory in real time based on the timestamp information of the CPU of the computer device; the locked page memory includes different memory spaces allocated by the computer device for the communication analysis instances corresponding to each communication domain.
7. The method according to claim 6, characterized in that, The step of recording the communication data of the monitored communication events on the target communication thread in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread includes: If a communication event is detected on the target communication thread, the timestamp information of the communication event is obtained from the locked page memory corresponding to the target communication thread; the timestamp information of the communication event includes at least one of the communication start time and the communication end time of the communication event; Obtain the attribute information of the communication event; the attribute information of the communication event includes at least one of the communication event identifier and the amount of communication data. The attribute information and timestamp information of the communication event are recorded in the memory space corresponding to the target communication thread to obtain the communication data of the target communication thread.
8. The method according to any one of claims 1 to 5, characterized in that, The method further includes: In response to the communication performance analysis command for multiple communication domains, a data export thread is created; In response to the data export command, the communication data of each of the communication domains is exported through the data export thread.
9. The method according to claim 8, characterized in that, The data export instruction carries the identification information of the target communication domain to be exported; the target communication domain is at least one of the plurality of communication domains. The step of exporting communication data from each communication domain in response to a data export command via the data export thread includes: Based on the identification information of the target communication domain, obtain the communication data of the target communication domain corresponding to the identification information; The communication data of the target communication domain is exported through the data export thread.
10. A communication performance analysis device, characterized in that, Applied to computer equipment, the device includes: The first creation module is used to create communication analysis instances corresponding to each of the communication domains in response to communication performance analysis commands for multiple communication domains; each communication domain includes multiple communication processes, each communication process includes at least one communication thread, and each communication thread includes communication events of kernel functions running on the accelerator card; the accelerator cards included in each of the communication domains are at least partially different; The monitoring module is used to monitor the communication of each communication domain by means of a communication analysis instance corresponding to that communication domain, and to obtain the communication data of that communication domain. The analysis module is used to perform communication performance analysis on the accelerator card in the communication domain based on the communication data in the communication domain, and obtain the communication performance analysis results of the accelerator card.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
MPI process management interface implementation method based on high-speed interconnection network
CN112929461A
Heterogeneous many-core architecture-oriented parallel characteristic line method transport scanning method and device
CN113391932A