Combined processing method of workloads and electronic device
Patent Information
- Application Number
- CN202611518090.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
相关技术中,可采用硬件性能计数器对应用运行状态进行量化建模的方式或者基于压力注入的多资源竞争的方式,来实现工作负载的组合评估,这些方式主要依赖于静态统计特征,无法准确反映实际运行场景下的资源特征,导致工作负载组合的准确性差
[0011]本申请还提供了一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,其中,计算机程序被处理器执行时实现上述任一种工作负载的组合处理方法的步骤。
Smart Images

Figure CN123011540A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to methods and electronic devices for combined processing of workloads. Background Technology
[0002] With the continuous development of microarchitectural technologies such as wide-issue processors, out-of-order execution, and multi-threaded shared execution resources, multithreading (SMT) has become an important means to improve single-core throughput. In an SMT environment, concurrent workloads are typically distributed to different logical threads running on the same physical core. Related technologies include using hardware performance counters to quantitatively model the application's running state or using multi-resource contention based on pressure injection to evaluate workload composition. However, these methods mainly rely on static statistical characteristics and cannot accurately reflect the resource characteristics of actual operating scenarios, resulting in poor accuracy in workload composition. Therefore, how to accurately and efficiently achieve workload composition is a pressing technical problem that needs to be solved. Summary of the Invention
[0003] This application provides a method and electronic device for combining workloads, in order to at least solve the problem of how to accurately combine workloads in the related art.
[0004] This application provides a method for combined workload processing, including:
[0005] Acquire multiple workloads;
[0006] Based on multiple preset sampling windows, the performance monitoring event count values of the workload running on the physical core are obtained; wherein, the performance monitoring event count values include a first count value and a second count value, the first count value is used to characterize the number of cycles in which the physical core is in the running state and has not performed micro-operations, and the second count value is used to characterize the number of cycles in which the physical core is in the running state;
[0007] Based on the performance monitoring event count and the preset sampling window, the bubble ratio time series of the workload is determined; the bubble ratio time series is used to characterize the resource idleness of physical cores within the preset sampling window.
[0008] Calculate similarity data between multiple workloads based on bubble ratio time series;
[0009] Based on similarity data, determine a strategy for combining multiple workloads.
[0010] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the combined processing method of any of the above-described workloads.
[0011] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the combined processing method of any of the above-described workloads.
[0012] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of a combined processing method for any of the above-described workloads.
[0013] This application provides an accurate workload combination scheme. For multiple workloads, it dynamically collects performance monitoring event counts of the workloads, including a first count representing the number of cycles in which the physical core is running and not performing micro-operations, and a second count representing the number of cycles in which the physical core is running. These data are collected based on short-interval sampling windows, which can fully reflect the dynamic evolution of resource idleness over time during workload operation. By using the sampling windows and performance monitoring event counts, a bubble ratio time series of each workload is determined, which accurately reflects the resource idleness of the physical core when running workloads. The similarity between workloads is evaluated based on the bubble ratio time series, and then the workloads are combined. Based on the above scheme, the dynamic change characteristics of the workload during operation can be preserved, improving the accuracy of workload combination. Attached Figure Description
[0014] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the 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.
[0015] Figure 1 A schematic diagram of a combined workload processing system architecture provided in this application embodiment;
[0016] Figure 2 A flowchart illustrating the combined processing method for workloads provided in this application embodiment;
[0017] Figure 3 This is a schematic diagram of a workload timing graph before outlier removal and two-stage smoothing, provided in an embodiment of this application.
[0018] Figure 4 This is a schematic diagram of a workload timing graph after outlier removal and two-stage smoothing, provided in an embodiment of this application.
[0019] Figure 5A time series comparison of bubble ratios for a candidate workload combination (520 and 557) during the standalone physical core operation phase, provided for an embodiment of this application.
[0020] Figure 6 A comparison chart of bubble ratio time series of another candidate workload combination (525 and 541) provided for embodiments of this application during the standalone physical core operation phase;
[0021] Figure 7 A schematic diagram of the combined processing apparatus for the workload provided in the embodiments of this application;
[0022] Figure 8 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0024] It should be noted that, in the description of the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in the embodiments of this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0025] First, the key terms in the embodiments of this application will be explained:
[0026] Performance Monitoring Unit (PMU): A hardware module integrated inside the processor used to count and monitor various microarchitectural events during processor operation.
[0027] Micro-operations (uops): These are the atomic internal instructions that the processor decoder breaks down into from macro instructions. Each macro instruction is decomposed into one or more uops, which are the basic units of actual scheduling and execution by the processor execution engine. The continuity of uops supply directly affects the utilization efficiency of the processor pipeline. When no uops are dispatched to an execution unit in a certain cycle, a core-level execution bubble is generated.
[0028] Median Absolute Deviation (MAD): A robust statistic used to measure the dispersion of a dataset.
[0029] Microarchitecture bubble ratio: The proportion of cycles in which no UOPs are executed when the processor's physical cores are in a non-idle state out of the total active cycles, used to characterize the degree of idling of core-level execution resources. A higher value indicates a more pronounced idling phenomenon in the physical cores during operation, and a lower utilization rate of execution resources; a lower value indicates stronger continuity of micro-operation execution and higher utilization rate of execution resources. In this embodiment, the microarchitecture bubble ratio is used as a unified metric to quantify the degree of execution resource idleness of each workload during operation, and to construct a bubble ratio time series to support similarity assessment between workloads.
[0030] With the continuous development of microarchitectural technologies such as wide-issue processors, out-of-order execution, and multi-threaded shared execution resources, SMT (Surface Mount Technology) has become an important means to improve single-core throughput. In an SMT environment, multiple logical threads on the same physical core can share critical execution resources such as instruction fetch, decoding, execution ports, and caches, thereby achieving resource reuse during pipeline idle periods and improving overall execution efficiency. However, due to differences in how multiple threads access shared resources during execution, the combined performance of different workloads in an SMT environment exhibits significant uncertainty. Reasonable workload pairing can effectively improve core resource utilization and system throughput, while unreasonable combinations can lead to insufficient uop supply, execution port contention, cache conflicts, and other phenomena, resulting in performance degradation. Therefore, accurately characterizing the resource interaction relationships of different workloads in an SMT environment and performing efficient scheduling accordingly has become an important research problem of widespread concern in academia and industry. Related technologies primarily model resource contention behavior using two main approaches: one based on hardware performance counters, constructing resource utilization characteristics by collecting relevant performance metrics; the other using stress tools to inject targeted load into shared processor resources, further analyzing the competitive behavior of applications across various resource dimensions. While these methods can characterize the complementary and competitive relationships among multiple applications across resource dimensions to some extent, their modeling process mainly relies on static statistical characteristics, lacking the ability to model the dynamic changes in workload execution and failing to reflect the nonlinear interactions within the processor.
[0031] During processor execution, various factors such as insufficient front-end supply, back-end execution blockage, memory access wait, or idle execution ports may cause no UOPs to complete execution on the physical cores within a certain cycle. These phenomena can be abstracted as core-level execution bubbles. If these execution bubbles can be tracked in a fine-grained manner using time series analysis, and the synchronization or misalignment relationships of bubbles across different workloads over time can be analyzed, then more direct and quantifiable quantitative data can be provided for SMT workload pairing optimization.
[0032] The resource feature modeling scheme based on hardware performance counters centers on constructing a unified metric formula for SMT configuration selection. Based on processor execution pipeline behavior, it uses hardware performance counters to quantitatively model the application's runtime state. First, under individual application execution conditions, key performance counter metrics related to the execution process are collected, including execution cycle and execution resource usage. Based on this, a metric factor reflecting pipeline utilization efficiency is constructed. Furthermore, by combining the application's instruction mixing characteristics and thread scalability information, multiple factors affecting SMT performance are integrated to form a unified SMT selection metric formula. Subsequently, under various workload conditions, runtime data is continuously collected through hardware performance counters, and the actual performance changes under different SMT configurations are measured to establish the correspondence between the constructed metric value and performance gains. Based on the above statistical results, the metric formula is calibrated to determine its discriminative boundary with performance improvement, thereby obtaining a fixed threshold for distinguishing the merits of SMT configurations. This approach suffers from problems such as unobservable dynamic changes due to long-term statistics and platform dependency issues caused by joint modeling of multiple counters. Firstly, this type of technology typically relies on accumulating counter data within a fixed long-term window to obtain aggregated characteristics of processor execution resource utilization. The statistical method only reflects the resource usage level of the application within the overall time interval, but cannot characterize the temporal distribution characteristics of resource consumption during execution. In the SMT scenario, the access to shared resources by different workloads has obvious phases and fluctuations, and their resource consumption relationships may show alternating or overlapping changes in the time dimension. Because the above scheme lacks the ability to model fine-grained time series information, it cannot drive the specific temporal relationship of resource competition, thus making it difficult to accurately reflect the dynamic interference and complementary behavior of different workloads running on SMT co-core. Secondly, the scheme relies on multiple hardware performance counters to characterize processor execution behavior during the modeling process. Due to the differences in the definition, semantics, and availability of performance counters for different processors, it is difficult to uniformly map some key counters across different platforms, making it difficult to directly reuse the constructed metrics in cross-platform scenarios. At the same time, the collection of multiple counters increases runtime overhead and implementation complexity. In actual deployment, when counter resources are limited or there are reuse conflicts, it will further affect the stability and accuracy of the modeling results, thus limiting the applicability of this method in general system environments.
[0033] The multi-resource contention modeling scheme based on pressure injection constructs a set of pressure injection programs targeting different shared resources. Each program applies load to a specific resource, such as execution unit pressure, cache access pressure, or memory bandwidth pressure. These pressure programs simulate the occupancy of the target resource by other threads. Subsequently, during the execution of the target application, different types of resource pressure are introduced, and their performance changes are measured. By comparing the changes in execution time or throughput before and after applying pressure, the application's sensitivity to various resources can be obtained, i.e., the degree of performance degradation of the application under corresponding resource constraints. Based on this, a multi-dimensional resource contention model is constructed to predict the performance interference of multiple applications running on a shared SMT core and to infer the performance changes when they are executed together. This approach suffers from a lack of direct interpretability of the processor's internal mechanisms and a deviation between the pressure model and the real load. First, by constructing external resource pressure and observing performance changes to indirectly infer the resource characteristics of the application, the modeling results rely on a black-box mapping relationship from pressure input to performance output. Therefore, the results lack direct interpretability of the processor's internal execution behavior, limiting the ability to analyze and optimize the nature of resources. Secondly, while stress programs simulate resource contention, their stress patterns are typically singular or rule-based access behaviors, differing from the complex and diverse access patterns encountered in real-world applications. In actual execution, resource access by different applications exhibits randomness and phased characteristics, which artificial stress models struggle to cover. Therefore, resource contention characteristics obtained based on stress injection may be biased in real-world scenarios, affecting the accuracy of prediction results.
[0034] The above analysis shows that current technologies for workload composition and evaluation primarily rely on static statistical characteristics, which fail to accurately reflect the resource characteristics of actual operating scenarios, resulting in poor accuracy in workload composition. Therefore, how to accurately and efficiently achieve workload composition is a pressing technical problem that needs to be solved.
[0035] To address the aforementioned technical problems, embodiments of this application provide a workload combination processing method and electronic device. The method involves setting a sampling window with short time intervals to collect performance monitoring event counts of the workload, calculating the bubble ratio time series of each workload reflecting the resource idleness of the physical core while running the workload, evaluating the similarity between workloads based on the bubble ratio time series, and then combining the workloads.
[0036] Optionally, embodiments of this application also aim to address at least one of the following problems: In the SMT execution environment, processor execution behavior lacks a time-series-based modeling method, making it difficult to dynamically characterize the resource competition and complementarity relationships between different workloads; without relying on complex microarchitecture modeling and dedicated hardware modifications, it is difficult to unify a universal measurement method to describe the characteristics of processor core execution bubbles; during processor execution behavior modeling, it is difficult to effectively explain the formation mechanism of performance interference; in the actual operating environment, there is a lack of stable and generalizable methods to effectively screen and identify workload combinations in the SMT scenario, thereby affecting the system performance optimization effect.
[0037] Based on the above-mentioned technical problems, in one possible implementation process, this application embodiment performs competition and complementarity analysis between workloads in the SMT environment based on the microarchitecture bubble ratio timing characteristics. The core steps include at least one of the following: establishing a microarchitecture bubble ratio measurement method, characterizing the dynamic behavior characteristics of workloads, time series data preprocessing, constructing a load competition and complementarity evaluation model, and workload combination screening and performance verification.
[0038] Optionally, the core of establishing a microarchitecture bubble ratio metric method lies in: constructing a core-level bubble ratio index that reflects the degree of idle execution resources based on a small number of performance counter events, thereby quantifying the processor's execution efficiency.
[0039] Optionally, the core of characterizing the dynamic behavior of workloads lies in continuously sampling the target workload at fixed time intervals to construct bubble ratio time series data, thereby capturing the dynamic changes in the load during operation. This approach breaks through traditional long-period statistical methods and can represent the phased fluctuations and behavioral patterns of the load at fine-grained time scales.
[0040] Optionally, the core of time series data preprocessing lies in introducing outlier detection and smoothing to address abnormal fluctuations and noise in the sampled data, thereby improving the stability and analyzability of the time series. The preprocessed bubble ratio sequence provides a reliable data foundation for subsequent correlation analysis and pattern recognition.
[0041] Optionally, the core of constructing a load competition and complementarity assessment model lies in: based on the first-order difference of the bubble ratio time series, combined with the correlation coefficient index, to quantify the resource competition and complementarity relationship between different workloads. This model can characterize the unidirectional or inverse changing trends between workloads from a time dimension, reflecting their interactive behavior under microarchitectural resources.
[0042] Optionally, the core of workload combination screening and performance verification lies in: selecting potentially complementary workload combinations based on the correlation assessment results, and conducting joint operation and performance testing verification in an SMT shared core environment. By comparing and analyzing performance indicators and bubble ratios before and after combination, the actual performance benefits of the selected combinations are evaluated.
[0043] Through the above steps, a workload timing modeling and analysis method based on the microarchitecture bubble ratio can be obtained, enabling fine-grained characterization of processor execution resources and continuous tracking of the dynamic behavior characteristics of workloads. Correlation analysis based on the bubble ratio time series can quantitatively identify the competitive and complementary relationships between different workloads, and guide the selection of workload combinations in SMT scenarios. This provides a quantitative basis with time dimension support and microarchitecture interpretability for performance optimization of multi-load collaborative operation.
[0044] In one possible implementation, this application embodiment uses the microarchitecture bubble ratio for measurement. Specifically, this application embodiment first establishes a microarchitecture bubble ratio measurement method to characterize the idle state of processor physical core execution resources, so as to achieve a quantitative description of core-level execution efficiency during workload operation. This measurement method is designed for processor cores that support SMT (Surface Mount Technology), selects performance monitoring events that reflect that the core is in a running state but has not actually performed micro-operations based on the physical core dimension, and constructs the bubble ratio index accordingly for subsequent time series sampling, load contention analysis, and combination screening.
[0045] For example, taking a processor platform that supports simultaneous multithreading as an example, in this embodiment of the application, the number of cycles in which no micro-operations were performed (uops_executed.core_cycles_none) can be selected as the numerator event, the number of cycles in the running state (cpu_clk_unhalted.thread_any) can be selected as the denominator event, and the ratio of the two can be defined as the microarchitecture bubble ratio of the target physical core within a given observation window. Its calculation formula can be expressed as:
[0046]
[0047] In this paper, the first count value, uops_executed.core_cycles_none, represents the number of cycles on a physical core where all logical threads have not executed any uops within a given period, characterizing the degree of idling in the core pipeline during runtime. The second count value, cpu_clk_unhalted.thread_any, represents the number of cycles on a physical core where at least one logical thread is in a non-idle state. This event reflects the total range of cycles the physical core is in a running state and can serve as a normalization benchmark for bubble statistics.
[0048] Based on the above definition, the bubble ratio can reflect the degree to which processor execution resources are not effectively utilized. The larger the value, the more obvious the idling phenomenon of the corresponding physical core in the observation period; the smaller the value, the stronger the continuity of micro-operation execution of the corresponding physical core and the higher the degree of execution resource utilization.
[0049] Those skilled in the art will understand that the specific performance monitoring event names mentioned above are merely illustrative, and this application is not limited to a specific processor architecture or vendor platform. On different processor platforms, corresponding bubble ratio metrics can be constructed based on the scheme provided in this application by selecting standard performance monitoring events with the same or similar semantics.
[0050] The specific application environment architecture or hardware architecture upon which the combined processing methods for the workload depend is described here. References Figure 1 , Figure 1 This is a schematic diagram of a combined processing system architecture for a workload provided in an embodiment of this application. The combined processing system for this workload is a computer device. Figure 1 As shown, the above architecture includes at least one of a data acquisition device 101, a processing device 102, and a display device 103.
[0051] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the combined processing system architecture for workloads. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.
[0052] In the specific implementation process, the data acquisition device 101 may include an input / output interface or a communication interface, and the data acquisition device 101 can be connected to the processing device through the input / output interface or the communication interface.
[0053] The processing device 102 can collect the performance monitoring event count value of the workload through a short time interval sampling window, and calculate the bubble ratio time series of each workload that reflects the resource idleness of the physical core when running the workload. Based on the bubble ratio time series, the similarity between workloads is evaluated, and then the workloads are combined.
[0054] The display device 103 can also be a touch screen or the screen of a terminal device, used to receive user commands while displaying the above-mentioned content, so as to realize interaction with the user.
[0055] It should be understood that the aforementioned processing device can be implemented by a processor reading instructions from memory and executing those instructions, or it can be implemented by a chip circuit.
[0056] Furthermore, the network architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0057] Figure 2 A flowchart illustrating the combined processing method for workloads provided in this application embodiment is shown below. Figure 2 As shown in the figure, this application provides a method for combined processing of workloads, which is described in detail below:
[0058] S201: Acquire multiple workloads.
[0059] The workload, as the object of analysis and combined scheduling, refers to multiple task instances that need to be evaluated for concurrency adaptation on processor platforms that support simultaneous multi-threading. These multiple task instances can come from server business processes, virtual machine instances, containerized services, batch programs, or high-performance computing jobs.
[0060] Optionally, multiple specified workload identifiers can be read from user input or configuration files, and multiple corresponding workloads can be determined based on the workload identifiers; or, multiple benchmark programs can be selected from a set of performance test benchmark programs as multiple workloads.
[0061] Optionally, the multiple workloads are a combination of pre-screened workloads; the pre-screening includes initial screening based on at least one of the following characteristics: computational intensity, memory access intensity, or input / output intensity of the workload.
[0062] S202: Based on multiple preset sampling windows, obtain the performance monitoring event count value of the workload running on the physical core.
[0063] The performance monitoring event count includes a first count and a second count. The first count represents the number of cycles in which the physical core is in operation and has not performed micro-operations, while the second count represents the number of cycles in which the physical core is in operation.
[0064] In this embodiment, the preset sampling window serves as a time division unit, used to divide the count value of the workload during operation into time periods; the physical core, as the hardware carrier for workload operation and performance monitoring event collection, is a single processor core that supports simultaneous multi-threading; the performance monitoring event count value is the raw monitoring data output by the processor performance monitoring unit.
[0065] Optionally, before acquiring performance monitoring event count values based on multiple preset sampling windows, a step of configuring the processor PMU is included. Specifically, based on the performance monitoring event types corresponding to the first and second count values to be collected, the PMU's event selection register is configured, causing the PMU's counter to count the two types of events respectively. PMU configuration can be achieved through an interface provided by the operating system or by directly reading and writing model-specific registers. After configuration, the PMU counter begins to continuously count the specified events.
[0066] In one possible embodiment, multiple preset sampling windows adopt fixed duration windows, with the window length set to a certain value between 200 microseconds and 20 milliseconds, and the windows are arranged continuously without intervals.
[0067] In another implementation, the preset sampling window can also be driven by a unified clock interrupt. When a workload context switch, logical thread migration, or core entering an idle state is detected, the current preset sampling window is closed in advance and the next preset sampling window is opened immediately, so that the count value corresponds more closely to the actual running stage.
[0068] To ensure the collected data reflects the workload's behavior on the physical core, the event counter base value is read at the beginning of each preset sampling window, and the accumulated value is read again at the end of the preset sampling window. The first and second count values within that preset sampling window are then obtained through a differential method. To prevent counter overflow, the PMU's overflow interrupt function can be enabled: when the counter reaches its maximum value, an overflow interrupt is triggered, the operating system's interrupt handler records the overflow count and continues counting, and at the end of the preset sampling window, the actual count value within that window is calculated based on the current counter value and the overflow count. Alternatively, a sampling window length with a period shorter than the counter overflow time can be used to avoid overflow.
[0069] It's important to note that the first and second counters differ in granularity within the SMT (Surface Mount Technology) scenario. The second counter operates at the physical core level; it increments whenever any logical thread on a physical core is not idle. The first counter, also at the physical core level, increments only when all logical threads on a physical core are not performing micro-operations. Therefore, the ratio of the first to the second counter accurately reflects the idle state of execution resources at the physical core level, rather than the idle state of a single logical thread.
[0070] Optionally, before obtaining the performance monitoring event count value of the workload running on the physical core according to multiple preset sampling windows, the method further includes: obtaining the runtime characteristics of multiple workloads and / or the processor type of the physical core; determining the time interval according to the runtime characteristics and / or processor type; and determining the preset sampling window according to the time interval.
[0071] This application embodiment can determine the time interval based on runtime characteristics and / or processor type, and determine a preset sampling window based on the time interval, thereby achieving adaptive configuration of the sampling window parameters. Different workloads exhibit different frequencies of resource usage changes during operation, and different processor platforms have different microarchitectural characteristics and PMU event response granularities. Dynamically determining the sampling window based on the workload's runtime characteristics and processor type allows the sampling granularity to match the actual behavioral characteristics of the load, avoiding undersampling or oversampling problems caused by a fixed sampling window. This adapts to different operating conditions, improves the accuracy of the bubble ratio time series in reflecting the dynamic changes in workload characteristics, and thus improves the accuracy of workload combination.
[0072] In one possible implementation, the performance monitoring event count value of the workload running on the physical core is obtained according to multiple preset sampling windows, including: binding multiple workloads to different physical cores to run on them; wherein, the physical cores run the corresponding workloads independently; and collecting the performance monitoring event count value of the workload within the preset sampling window on the physical cores.
[0073] In some embodiments, the operating system scheduler or virtualization hypervisor can pin multiple workloads to run queues on different physical cores. The binding method can employ affinity settings, core isolation configurations, or container core quota configurations. Each physical core only carries its corresponding single workload during the sampling period and does not accept other workloads migrating in, so that the count value obtained within the preset sampling window corresponds to the actual behavior of that workload in an independent running state.
[0074] Optionally, when multiple workloads are independently bound to different physical cores, the sampling windows of each physical core use a globally unified clock as a reference, starting the first sampling window at the same time and synchronously switching to the next sampling window at the same time interval. Specifically, the synchronous switching of sampling windows on each physical core is driven by the clock interrupt of the operating system kernel. Synchronous acquisition ensures that the bubble ratio time series of different workloads have a consistent starting time reference point during subsequent alignment processing.
[0075] Optionally, during sampling, the performance monitoring unit periodically reads the event count register according to multiple preset sampling windows. The event count may include the number of unexecuted micro-operation cycles and the number of running cycles, or it may be directly accumulated and output by the corresponding hardware counter. The count result obtained in each preset sampling window is recorded as the basic characteristic sequence of the workload.
[0076] In one possible implementation, multiple preset sampling windows can be configured with fixed durations or fixed periods and aligned with scheduling time slices to ensure the comparability of data from different workloads. When a preset sampling window arrives, the acquisition module reads and clears the counter on the current physical core, or retains the accumulated value and performs differential calculation. The resulting count values are then written to a cache or memory, forming a chronologically ordered counting record. Since multiple workloads run independently on different physical cores, the acquired count values reflect the resource usage characteristics of each workload within its corresponding preset sampling window, providing a stable input for subsequent construction of bubble ratio time series and calculation of similarity between workloads.
[0077] Here, in this embodiment, workloads are bound to different physical cores and run independently. Performance monitoring event counts for the corresponding workload within a preset sampling window are collected on each physical core. This avoids the impact of mutual interference between multiple workloads in a shared core environment (SMT) on feature extraction. Since each workload runs independently on a physical core, the collected bubble ratio data reflects the pure, inherent rhythm of that workload during execution, rather than a mixed state affected by interference from other workloads. Independent core operation and data collection ensure that the bubble ratio time series of each workload accurately reflects its own execution resource usage characteristics, further improving the accuracy of workload combination and resource assessment.
[0078] In one possible implementation, embodiments of this application characterize the dynamic behavior of the workload by collecting performance monitoring event counts within a preset sampling window. The specific method is as follows:
[0079] The workload to be analyzed is run on the target processor, and key events defined by the PMU are continuously collected. During the sampling process, a fixed time interval is set as the sampling window. In this embodiment, the sampling interval can be set to 100ms, and the total sampling duration can be set to 300s.
[0080] Optionally, during data acquisition, a non-aggregated statistical method is used to count different physical cores independently to avoid information interference caused by the superposition of statistical results from multiple cores. Simultaneously, a unified timestamp is used to calibrate the data in each sampling window, ensuring a strict time alignment between workloads and guaranteeing the comparability and consistency of subsequent time-series analysis.
[0081] After obtaining the above raw counting data, for each sampling window, the bubble ratio value of the corresponding sampling window is calculated based on the bubble ratio calculation formula, and arranged in chronological order to construct a bubble ratio time series diagram that changes over time, or to construct a bubble ratio event sequence.
[0082] Based on the aforementioned embodiments, further, the bubble ratio time series of the workload is determined according to the performance monitoring event count value and the preset sampling window, including: determining the bubble ratio value corresponding to the preset sampling window according to the ratio of the first count value and the second count value within the preset sampling window; and arranging the bubble ratio values of the multiple preset sampling windows according to the time order of the multiple preset sampling windows to obtain the bubble ratio time series of the workload.
[0083] The calculation of the bubble ratio here can refer to the microstructure bubble ratio in the above embodiment.
[0084] Optionally, a first count value and a second count value are obtained within each preset sampling window. After confirming the correspondence between the two types of count values within the same preset sampling window, the control module directly divides the first count value by the second count value to obtain the bubble ratio value for that preset sampling window. If the second count value is zero, the preset sampling window is marked as an invalid window, and the bubble ratio value of that window is recorded as a preset anomaly marker, or processed according to a preset protection value to maintain the integrity of the sequence data structure. Subsequently, multiple bubble ratio values are organized sequentially according to the start time of each preset sampling window, and a bubble ratio time series corresponding one-to-one with the sampling period is generated for subsequent similarity analysis.
[0085] In this embodiment, the bubble ratio value is determined based on the ratio of a first count value to a second count value within a preset sampling window. The bubble ratio values are then arranged according to the time sequence of multiple preset sampling windows. This quantifies the idle state of physical core execution resources into time-series data that changes over time. Compared to related technologies that only calculate long-term average values, this approach captures the dynamic fluctuations in the idle state of physical core resources during workload execution. It transforms discrete hardware counter sampling values into a bubble ratio time series with a temporal structure, enabling accurate workload combination.
[0086] S203: Determine the bubble ratio time series of the workload based on the performance monitoring event count and the preset sampling window.
[0087] Among them, the bubble ratio time series is used to characterize the resource idleness of the physical core within a preset sampling window.
[0088] In this embodiment, the bubble ratio time series is a time series feature constructed based on the correspondence between the first count value and the second count value in each preset sampling window, used to uniformly describe the changes in resource idleness when the workload runs on the physical core.
[0089] The first count value provides the number of bubble cycles, and the second count value provides the total number of running cycles. Therefore, the corresponding bubble ratio characterization result can be determined based on the performance monitoring event count values in each preset sampling window, and combined with the preset sampling windows to form the bubble ratio time series of the workload. When the workload does not obtain a valid running cycle within a certain preset sampling window, the preset sampling window can be marked as an invalid window and can be processed as needed.
[0090] S204: Calculate similarity data between multiple workloads based on the bubble ratio time series.
[0091] In this embodiment, the similarity data is used to reflect the degree of correlation between the execution rhythms of multiple workloads, and is a quantitative result calculated based on the bubble ratio time series of each workload. Since the bubble ratio time series has uniformly represented the idling changes of different workloads on the shared core as a numerical sequence arranged by time, the similarity calculation can be directly carried out around the synchronous changes, reverse changes, or misalignment compensation relationships between the sequences.
[0092] Optionally, the bubble ratio time series of multiple workloads are first time-aligned to ensure that the series to be compared have a consistent window numbering range. If different workloads have time offsets due to different start times, they can be aligned based on their sampling start timestamps, or truncated using the maximum common overlap interval. Subsequently, the bubble ratio time series of any two workloads A and B are correlated and calculated.
[0093] In one possible embodiment, the similarity data is calculated using a correlation coefficient, and the similarity value between the two can be obtained through the Pearson correlation coefficient. When the value is close to 1, it indicates that the bubble ratio changes of the two workloads in each preset sampling window are highly synchronized, suggesting that they are likely to experience resource idleness or resource blockage at similar stages on the shared core; when the value is close to -1, it indicates that the two sequences show opposite trends, suggesting that a period with a high bubble ratio for one workload may correspond to a period with a low bubble ratio for the other workload, indicating a temporal mismatch filling relationship between them; when the value is close to 0, it indicates that the linear correlation between the two is weak.
[0094] In another possible embodiment, similarity data can also be represented by cosine similarity, normalized values of dynamic time-normalized distance, or summative values of segmented window relevance, as long as they can reflect the degree of correlation between multiple workloads in terms of changes in resource idleness.
[0095] To generate a unified result covering the overall operation of multiple workloads, similarity can be calculated for any pairwise combination within the workload set, and the results can be populated into a similarity matrix. If it is necessary to further reflect the importance of different stages, a higher weight can be assigned to the preset sampling window corresponding to the high-load interval of the front-end service, and similarity values can be calculated based on weighted correlation. By converting the bubble ratio time series into pairwise similarity data, this embodiment of the application can identify synchronous blocking patterns and misalignment compensation patterns that are difficult to distinguish using only long-period averages, providing a calculable basis for subsequent combination strategies.
[0096] S205: Determine a strategy for combining multiple workloads based on similarity data.
[0097] In this embodiment, the combination strategy is used to guide how multiple workloads are allocated to logical threads on physical cores or executed on different physical cores. In essence, it makes a combination decision based on similarity data regarding the competitive and complementary tendencies between workloads.
[0098] Optionally, the similarity data can be a numerical score between multiple workloads, or corresponding elements in a similarity matrix, based on which the executing entity outputs the results of pairing, separating, sorting, or dispatching.
[0099] Optionally, candidate combination pairs can be established for the set of workloads to be combined, and the similarity value of each candidate combination pair can be read; then, a combination strategy can be generated according to the preset decision rules.
[0100] There is a clear mapping relationship between the overall similarity data and the competition status: when the overall similarity data of two workloads approaches 1, it indicates that their bubble ratio time series are highly synchronized in the time dimension, meaning they are both in an idle execution resource state or both in an active execution resource state. This synchronized change pattern means that when two workloads share a physical core, they will have overlapping demands for shared execution resources within the same time period, thus triggering resource competition. Conversely, when the overall similarity data of two workloads approaches 0, it indicates that their bubble ratio time series exhibit a staggered change pattern in the time dimension, meaning that when one workload is in an idle execution resource state, the other workload is in an active execution resource state. This staggered change pattern means that when two workloads share a physical core, they can alternately utilize shared execution resources, forming a complementary relationship in the time dimension. Based on the above mapping relationship, embodiments of this application can determine the competition status based on whether the overall similarity data exceeds a preset threshold.
[0101] In one possible implementation, when the similarity value is higher than a first threshold, the corresponding workloads are identified as load pairs with similar synchronous idling characteristics. Instead of assigning them to different logical threads on the same physical core, they are split and executed across different physical cores or different time slices. When the similarity value is lower than a second threshold or shows a significant negative correlation, the corresponding workloads are identified as load pairs with a strong misalignment compensation relationship. These are preferentially combined and run concurrently on the same physical core. The first and second thresholds can be determined through offline measurement, for example, set to 0.6 and -0.2 respectively, or they can be adaptively updated by the system based on historical running data.
[0102] It should be noted that the thresholds of 0.6 and -0.2 mentioned above are exemplary values based on the unnormalized original values of the rank correlation coefficient (range [-1, 1]). When the comprehensive similarity data (range [0, 1]) is obtained using the normalization + weighted fusion method in the foregoing embodiments of this application, the corresponding judgment thresholds should be adjusted accordingly. For example, when the comprehensive similarity data is higher than 0.6, it is determined that there is resource contention; when the comprehensive similarity data is lower than 0.4, it is determined that there is no resource contention. Those skilled in the art will understand that the above threshold values are only illustrative examples, and in practical applications, they can be flexibly adjusted according to the characteristics of the processor platform, the type of workload, and the performance optimization goals, and can also be adaptively updated through offline measurement or online learning.
[0103] As an optional implementation, the first and second thresholds can be determined through the following adaptive update method: During system operation, the actual performance of each workload combination is periodically recorded. For each historical combination, the correspondence between its comprehensive similarity data and actual performance is recorded. After accumulating sufficient historical data, the optimal threshold is determined using statistical analysis or machine learning methods, with comprehensive similarity data as features and actual performance as labels.
[0104] In one specific implementation, a grid search method is used to search for the threshold combination that maximizes the overall system throughput on historical data. Specifically, candidate threshold intervals are traversed on historical data (e.g., the first threshold search range is [0.3, 0.8], and the second threshold search range is [-0.4, 0.1]). For each threshold combination, the overall system throughput is calculated, and the threshold combination with the highest throughput is selected as the optimal threshold for the current workload set. This optimal threshold is then used for subsequent combination strategy determination.
[0105] Optionally, if there are more than two workloads to be processed, multiple sets of combined results can be formed based on the similarity matrix using greedy matching, bipartite graph matching, or clustering. Each physical core corresponds to a set of workloads, and the workloads within the set satisfy the target similarity constraint.
[0106] Optionally, in multi-load scenarios (i.e., when the number of workloads is greater than 2), the similarity data can be represented as a similarity matrix, where each element represents the overall similarity between the corresponding two workloads. The process of determining the combination strategy is as follows: First, construct the similarity matrix M between workloads, where M[i][j] represents the overall similarity data between the i-th workload and the j-th workload. Second, based on the similarity matrix, generate the combination strategy using any of the following methods:
[0107] Method 1 (Greedy Matching): Load pairs in the similarity matrix below a preset threshold are sorted from lowest to highest similarity. Unassigned workloads are selected sequentially to form pairs until all workloads are assigned. This method prioritizes pairing workloads with the strongest complementarity (lowest similarity) and is suitable for scenarios with high single-core throughput requirements.
[0108] Method 2 (Bipartite Graph Matching): Divide the workload into two groups, using similarity as edge weights. Use bipartite graph matching algorithms such as the Hungarian algorithm to find the minimum weighted match, minimizing the sum of the overall similarities between successfully matched load pairs. This method is suitable for applications requiring overall optimization of multiple pairing schemes.
[0109] Method 3 (Clustering and Grouping): Using a similarity matrix as the distance metric, hierarchical clustering or K-means clustering algorithms are employed to divide the workload into multiple clusters. Each cluster corresponds to a workload combination on a physical core. Workloads within a cluster satisfy similarity constraints (i.e., the overall similarity is below a preset threshold), while workloads between clusters are assigned to different physical cores. This method is suitable for scenarios with a large number of workloads that require multiple combination schemes. After processing using any of the above methods, multiple workload combinations are output, each corresponding to a logical thread deployment scheme on a physical core.
[0110] In one possible implementation, within a dual-threaded SMT physical core, all candidate workload pairs can be sorted from low to high similarity. Unassigned workloads are then selected sequentially to form a pairing list, which is written to the scheduling engine. The scheduling engine then deploys the corresponding workloads to different logical threads within the same physical core by setting Central Processing Unit (CPU) affinity, thread-core binding masks, or virtual CPU mapping relationships. If the similarity matrix shows that a workload is highly positively correlated with all other workloads, this workload can be marked as an isolated running object, and during scheduling, it can be allocated an exclusive physical core or have its concurrency level reduced.
[0111] This application provides an accurate workload combination scheme. For multiple workloads, it dynamically collects performance monitoring event counts, including a first count representing the number of cycles in which physical cores are running without performing micro-operations, and the second count representing the number of cycles in which physical cores are running. These data are collected based on short-interval sampling windows, which can fully reflect the dynamic evolution of resource idleness over time during workload operation. By using the sampling windows and performance monitoring event counts, a bubble ratio time series for each workload is determined, accurately reflecting the resource idleness of physical cores while running workloads. The similarity between workloads is evaluated based on the bubble ratio time series, and then workloads are combined. This scheme preserves the dynamic characteristics of workload operation and improves the accuracy of workload combination.
[0112] Based on the foregoing embodiments, further, a combination strategy for multiple workloads is determined according to similarity data, including: determining the competition status among multiple workloads according to similarity data; wherein the competition status includes resource competition and no resource competition; and determining the combination strategy for multiple workloads according to the competition status.
[0113] Optionally, after receiving similarity data, the similarity data can be compared with a preset judgment threshold, or the similarity data can be input into a competition judgment model to determine the competition status among multiple workloads. When the similarity data indicates that the bubble ratios of multiple workloads change in a highly synchronized manner over time, it is determined that resource competition exists, and the corresponding workloads are allocated to different physical cores or different resource isolation units. When the similarity data indicates that the bubble ratios of multiple workloads change with low correlation or complementarity over time, it is determined that there is no resource competition, and the corresponding workloads are combined into different logical threads on the same physical core. This combination strategy can be executed in real time by the operating system scheduler or virtualization management program when tasks are enqueued, migrated, or rebound, and the corresponding core binding results can be output.
[0114] This application's embodiments determine the competition state among multiple workloads based on similarity data and determine a combination strategy based on the competition state, thus transforming continuous, comprehensive similarity data into executable discrete decision information. The competition state is clearly distinguished into two states: resource competition and non-resource competition, providing a clear basis for the execution of subsequent combination strategies. By determining the competition state, accurate workload allocation is achieved, effectively utilizing runtime resources and improving operational efficiency.
[0115] Optionally, based on the contention status, a combination strategy for multiple workloads is determined, including: if any two workloads have resource contention, then the corresponding two workloads are assigned to different physical cores; if any two workloads do not have resource contention, then the corresponding two workloads are assigned to the same physical core.
[0116] Specifically, for any two workloads, a pairing determination is performed. If the determination indicates resource contention, the two workloads are mapped to different physical cores, and the operating system scheduler or virtualization hypervisor updates the core binding relationship, ensuring that each workload occupies independent core resources during operation. If the determination indicates no resource contention, the two workloads are mapped to the same physical core, where they are run by different logical threads. For core mapping relationships, the scheduling module can allocate resources based on the current core load, thread occupancy, and preset affinity constraints, and write the allocation results to the task control structure or scheduling queue for direct effect during subsequent execution. In practical applications, this core allocation relationship can also be modified based on the platform's core topology, cache sharing level, and virtual machine isolation strategy; this application does not limit this modification.
[0117] By separating resource-contending workloads onto different physical cores and aggregating non-contending workloads onto the same physical core, the combination strategy can be aligned with the actual interaction between workloads. This isolates tasks that interfere with each other and allows complementary tasks to share core resources, thereby improving core utilization efficiency and reducing performance fluctuations caused by contention.
[0118] It should be understood that any threshold in any embodiment of this application can be determined according to the actual situation, and no specific restrictions are imposed here.
[0119] In one possible implementation, after determining a combination strategy for multiple workloads based on similarity data, the method further includes: deploying the multiple workloads to corresponding physical cores for operation according to the combination strategy; monitoring the performance metrics of the physical cores after deployment; and updating the similarity data and / or the combination strategy based on the performance metrics.
[0120] Optionally, the bubble ratio time series is preprocessed, including: outlier detection and removal; and / or outlier repair; and / or smoothing. The smoothing includes a first-stage smoothing using median filtering and / or a second-stage smoothing using moving average filtering.
[0121] Here, preprocessing the bubble ratio time series using one or more combinations of outlier detection and removal, missing data repair, and smoothing can improve the data quality of the time series from multiple dimensions. Outlier detection and removal can identify and eliminate abnormal spikes caused by instantaneous system disturbances or PMU sampling errors; missing data repair can fill data gaps caused by outlier removal or sampling failures, maintaining the continuity of the time series; and two-stage smoothing based on median filtering and moving average filtering can further suppress high-frequency noise after removing outliers. This flexible combination of preprocessing methods effectively avoids the amplification effect of outlier sampling points on the judgment of competition or complementarity between loads, improving the accuracy of subsequent similarity calculations.
[0122] Specifically, multiple workloads are deployed to corresponding physical cores according to a combination strategy. This includes: for workload combinations determined to have no resource contention (i.e., complementary combinations), multiple workloads are deployed to different logical CPUs on the same physical core for concurrent execution; for workload combinations determined to have resource contention (i.e., competitive combinations), multiple workloads are deployed to different physical cores for execution. After deployment, the workloads begin to run on the target physical cores. Their running status is affected by various microarchitectural factors such as SMT shared resource contention, cache coherency, and memory bandwidth contention. Therefore, it is necessary to continuously monitor post-deployment performance metrics to evaluate the actual effectiveness of the combination strategy.
[0123] Optionally, after deployment, the PMU continuously collects performance metrics of the physical cores. These performance metrics include, but are not limited to, the average bubble ratio of the physical cores, instructions per cycle (IPC), cache miss rate, execution port utilization, and one or more of the throughput or runtime of each workload.
[0124] Optionally, the monitoring period can be consistent with the preset sampling window in S202, or a longer monitoring period (such as seconds or minutes) can be used to smooth out short-term fluctuations.
[0125] Optionally, after monitoring the performance metrics of the deployed physical cores, the system determines whether to trigger an update process based on the degree of difference between the performance metrics and preset expected values. As an optional implementation, preset update conditions include at least one of the following: the average bubble ratio of the deployed physical cores is higher than a first preset threshold (e.g., an average bubble ratio greater than 0.6 indicates excessive idle resources and the combined strategy has not achieved the expected resource utilization); the performance score of each workload decreases by more than a second preset threshold (e.g., a performance score decrease exceeds a preset decrease percentage threshold, indicating that the combined strategy has caused significant performance interference); the number of execution port contentions or cache miss rates of the deployed physical cores exceeds a third preset threshold; or the performance metrics after deployment do not meet the preset performance expectations. When any of the above preset update conditions are met, the update process is triggered. When the preset update conditions are not met, the current combined strategy continues to run, and the performance metrics for the next monitoring cycle continue to be monitored. By setting trigger conditions, unnecessary system overhead caused by update operations is avoided.
[0126] Optionally, if the updated similarity data shows that workload pairs that previously did not have resource contention now exhibit resource contention characteristics (i.e., the similarity data increases above a preset threshold), then the workload pairs that were originally grouped onto the same physical core are split and executed on different physical cores. If the updated similarity data shows that workload pairs that previously had resource contention no longer exhibit resource contention characteristics (i.e., the similarity data decreases below a preset threshold), then the workload pairs that were originally separated onto different physical cores are grouped and executed on different logical CPUs within the same physical core. The redefined grouping strategy is then reissued to the scheduling engine for execution, achieving dynamic adjustment of workload deployment.
[0127] This application's embodiments utilize a closed-loop dynamic update mechanism, enabling workload composition to adaptively adjust to changes in load behavior, thus avoiding the failure of composition strategies due to workload phase switching. Simultaneously, by employing an on-demand update method triggered by actual performance metrics, continuous optimization of workload composition in SMT scenarios can be achieved without introducing excessive system overhead, further improving system throughput and resource utilization efficiency.
[0128] Steps S203 and S204 will be explained below with reference to specific embodiments:
[0129] Optionally, based on the bubble ratio time series, similarity data between multiple workloads is calculated, including: preprocessing the bubble ratio time series to obtain a preprocessed series; and calculating similarity data between multiple workloads based on the preprocessed series.
[0130] In this embodiment, when preprocessing the bubble ratio time series, abnormal bubble ratio values that deviate from the statistical characteristics of the neighborhood in the preset sampling window can be detected and replaced first. Locally missing positions are then interpolated using adjacent valid sampling points. Finally, a moving average or exponential smoothing process is applied to continuous sampling points to preserve the overall trend of the sequence and reduce instantaneous jitter. After preprocessing, similarity calculations can be performed on the preprocessed sequences corresponding to different workloads. For example, similarity data can be generated based on time-series differences, correlation coefficients, or normalized distances between sequences. The similarity data can be a single scalar or a similarity matrix, used to represent the strength of the association between multiple workloads.
[0131] By first performing anomaly suppression, missing data repair, and noise smoothing on the bubble ratio time series, and then calculating similarity data based on this, the similarity results can more stably reflect the consistency of idling changes of multiple workloads on the shared core, thus providing a more reliable basis for subsequent combination strategies.
[0132] Specifically, the possible preprocessing methods for time series data (bubble ratio time series) are as follows:
[0133] Since the original sampling data comes from the statistical results of performance counters within a fixed time window, it is easily affected by factors such as instantaneous system disturbances, measurement noise, and statistical instability of individual sampling windows during actual acquisition, resulting in local spikes, abnormal jumps, or high-frequency jitter in the time series. If trend analysis or correlation calculations are performed directly based on the original data, a few outlier sampling points can easily amplify the overall judgment, reducing the stability and feasibility of subsequent analysis results. Therefore, this step preprocesses the original bubble ratio time series through outlier detection, missing value repair, and two-stage smoothing.
[0134] Let a certain bubble ratio time series be:
[0135]
[0136] in, represents the bubble ratio value corresponding to the i-th sampling time, and N represents the total number of sampling points obtained during the entire observation period.
[0137] Optionally, outlier detection and removal can be performed: Since the mean and standard deviation are easily contaminated by extreme values, while the median is more robust to local spikes, outlier detection and removal are adopted. As an outlier detection method, it identifies abnormal sampling points in the original bubble ratio time series. (The sentence fragment about the sequence appears to be incomplete and lacks context.) Calculate the global median This serves as an estimate of the sequence center location:
[0138]
[0139] After obtaining the center position, the absolute deviation of each sampling point relative to the median is further calculated, and the median is taken as the median. value:
[0140]
[0141] in, Indicates the first The degree of deviation of each sampling point from the global median.
[0142] To ensure a unified determination for each sampling point, embodiments of this application further construct a system based on... Z-score:
[0143]
[0144] in, Indicates the first The standardized deviation of each sampling point, with a coefficient of 0.6745, is used to... The scale is approximately aligned with the standard deviation scale under a normal distribution, making the judgment threshold more intuitive and interpretable.
[0145] Subsequently, This serves as an outlier determination criterion. When the deviation of a sampling point from the center level of the overall sequence exceeds the normal waveform range, it is considered an outlier; otherwise, it is considered a normal point. The specific handling method is as follows:
[0146]
[0147] in, This indicates the result after initial outlier processing. When... When, retain the original value; when When a value is missing, it is first marked as a missing value and represented as Not a Number (NaN).
[0148] Optionally, perform outlier repair: for any data point marked as missing. Let the nearest valid sampling point to its left be... The nearest valid sampling point on the right is ,in Then the missing moment. interpolation results Defined as:
[0149]
[0150] Optionally, a two-stage smoothing process can be performed:
[0151] The first stage involves smoothing, using a sliding median to remove outliers. Prioritizes preserving the dominant trend reflected by the majority of sampling points, while downplaying local deviations at individual sampling points. Let the interpolated and repaired sequence be:
[0152]
[0153] A center-sliding median filter with a window size of 5 is used to calculate the local median for each sampling point. The substitution expression is:
[0154]
[0155] The second stage of smoothing also employs a center-moving mean filter with a window size of 5 to further reduce high-frequency noise, resulting in the final smoothed sequence. for:
[0156]
[0157] In one possible implementation, similarity data between multiple workloads is calculated based on the preprocessed sequences, including: aligning any two preprocessed sequences according to a preset timestamp to obtain any two aligned sequences; and calculating similarity data between the corresponding workloads based on the two aligned sequences.
[0158] Optionally, the preprocessed sequences corresponding to the two workloads are read, and a unified time index is established according to a preset timestamp, mapping the corresponding sampling points in each sequence to the same time position. If there is an offset, missing sampling, or unequal length between the sampling times of the two sequences, interpolation, resampling, or neighbor-point matching is performed based on the preset timestamp to make the two sequences form aligned sequences of the same length on the same time axis. The alignment process can be completed in memory by the time series analysis module, and its output is a pair of time-corresponding dual-sequence data for subsequent similarity calculation.
[0159] Specifically, if the sampling points of two sequences do not correspond perfectly on the time axis, they can be handled as follows: for time positions with missing samples, use linear interpolation to fill in the missing points using the nearest valid sampling points before and after the missing points; for cases where there is an offset in the sampling time, use a preset timestamp as a reference to perform neighbor point matching and map the sampling points to the closest standard time position; for cases where the lengths of the two sequences are inconsistent, use the shorter sequence length as a reference for truncation, or resample to make the two sequences have the same number of sampling points on the time axis.
[0160] After obtaining any two aligned sequences, the sequence values at the same time position are compared point by point, and similarity data is calculated based on the comparison results. The similarity data can be obtained by converting the correlation coefficient, cosine similarity, or normalized distance. The correlation coefficient is used to reflect the consistency of the changing trends of the two sequences, the cosine similarity is used to reflect the consistency of the sequence directions, and the normalized distance is used to reflect the degree of deviation of the sequences.
[0161] Here, by aligning any two preprocessed sequences according to a preset timestamp, the comparability of bubble ratio time series from different workloads across the same time dimension can be ensured. Since bubble ratio sampling data for different workloads correspond to different sampling times, if the time bases are inconsistent, subsequent similarity calculations will lose their temporal correspondence. By aligning with preset timestamps, a one-to-one correspondence is established between the bubble ratio values of any two workloads within the same time window, providing a data foundation with the same time base for subsequent global and local similarity calculations, and avoiding time series analysis biases caused by sampling time offsets.
[0162] In one possible implementation, the similarity data between corresponding workloads is calculated based on any two aligned sequences, including: performing global similarity calculation on any two aligned sequences to obtain a first similarity; performing local similarity calculation on any two aligned sequences to obtain a second similarity; and calculating the similarity data between corresponding workloads based on the first and second similarities.
[0163] Optionally, after receiving any two aligned sequences, the sequence length, sampling interval, and numerical scale are first standardized, and then the two sequences are mapped to the same comparison dimension. Global similarity calculation can employ correlation, distance, or shape matching metrics for the entire sequence to jointly characterize the direction of change, amplitude evolution, and overall fluctuation trend over the entire time span, thus obtaining the first similarity. Local similarity calculation divides the aligned sequence into multiple local time segments, calculates local correlations, peak-valley correspondences, or short-term offsets within each segment, and then aggregates the local results of each segment to obtain the second similarity. Subsequently, the first and second similarities are combined according to a preset fusion relationship, which can be a weighted summation, normalized mapping, or segmented mapping, so that the final output similarity data simultaneously includes overall trend information and local fluctuation information.
[0164] By performing global and local similarity calculations separately to obtain a first similarity and a second similarity, and then combining these two similarities to calculate the overall similarity data between workloads, the similarity of resource usage behavior of two workloads during execution can be comprehensively characterized from two different dimensions. Specifically, the global similarity reflects the consistency of the overall trend of resource idleness changes between the two workloads throughout their entire runtime, while the local similarity reflects the degree of synchronization of their phased behaviors within a short timescale. Compared to evaluation methods that rely on only a single dimension, combining global and local dimensions can more comprehensively capture the complex interactions between workloads over time, avoiding the bias in combined decision-making caused by the one-sidedness of a single indicator.
[0165] Optionally, a global similarity calculation is performed on any two aligned sequences to obtain a first similarity, including: generating a corresponding first-order difference sequence based on any two aligned sequences; and calculating the rank correlation coefficient based on the first-order difference sequence to obtain the first similarity.
[0166] This application's embodiments generate corresponding first-order difference sequences based on any two aligned sequences, and calculate the rank correlation coefficient based on the first-order difference sequences to obtain the first similarity. This transforms the dimension of similarity analysis from comparing the numerical magnitude of resource idleness to comparing the changing trends of resource idleness. The first-order difference can reflect the direction and magnitude of the bubble ratio change over time, and the rank correlation coefficient based on the first-order difference sequences can quantify the consistency of the changing trends of two workloads globally. When the changing trends of the bubble ratios of two workloads are highly consistent, it indicates that they have the same resource occupancy pattern in the time dimension, making them more likely to generate resource competition; when the changing trends are opposite, it indicates that they have a staggered and complementary relationship in the time dimension. Compared with the static comparison method based on statistical averages in related technologies, similarity analysis based on changing trends can more accurately reflect the dynamic temporal interaction relationship between workloads in the SMT shared core scenario.
[0167] Optionally, a second similarity is obtained by performing local similarity calculation on any two aligned sequences, including: generating corresponding first-order difference sequences based on any two aligned sequences; dividing the first-order difference sequences into windows using a preset sliding window to obtain multiple sets of corresponding local window sequences; calculating the local correlation coefficient within the preset sliding window based on the local window sequences; and determining the second similarity based on the local correlation coefficient.
[0168] This application's embodiments generate corresponding first-order difference sequences based on any two aligned sequences, divide the first-order difference sequences into windows using a preset sliding window, calculate the local correlation coefficient within each sliding window, and determine the second similarity based on the local correlation coefficient. This quantifies the frequency of synchronous changes between two workloads on a local time scale. Compared to methods that rely solely on global trend consistency judgment, capturing local synchronization behavior through a sliding window avoids missing strong local competition or strong complementarity relationships due to unclear global trends, making the similarity assessment results more comprehensive and accurate.
[0169] Optionally, the similarity data between corresponding workloads is calculated based on the first similarity and the second similarity, including: normalizing the first similarity to obtain a normalized first similarity; and performing a weighted fusion process based on the normalized first similarity and the second similarity to obtain the similarity data between corresponding workloads.
[0170] By normalizing the first similarity score and then weighting and fusing it with the second similarity score, two similarity indices with different dimensions can be mapped to the same numerical range for comprehensive analysis. The first similarity score ranges from [-1, 1] to [0, 1], while the second similarity score ranges from [0, 1]. Their inconsistent dimensions prevent direct fusion. Normalization maps the first similarity score to the [0, 1] range, making the two indices comparable and fusionable. Weighted fusion then yields a comprehensive similarity score. This comprehensive similarity score reflects both the global trend consistency of the two workloads and the frequency of their synchronization at local time scales, improving the accuracy of resource assessment for workloads.
[0171] In one possible implementation, embodiments of this application construct a load competition and complementarity evaluation model to determine the similarity.
[0172] The basic idea behind this step is that if two workloads exhibit a highly consistent bubble ratio trend during operation, it indicates a high degree of similarity in their microarchitectural resource usage patterns. When sharing physical cores, such workload combinations are more likely to generate overlapping demands for similar resources within similar time periods, thus leading to competition. Conversely, if the bubble ratio changes of two workloads show less consistency over time, it indicates a misalignment in their resource usage rhythms, making them more likely to complement each other and improve the overall resource utilization efficiency in a shared execution environment. Therefore, this application's embodiments construct an evaluation model based on the consistency of the bubble ratio time series change trend, thereby basing the judgment of whether workloads are competing or complementary on dynamic behavioral characteristics.
[0173] Suppose the workload bubble ratio time series executed on the two physical cores are as follows:
[0174]
[0175]
[0176] in, and Let represent the bubble ratio values of the two workloads at the t-th sampling time, and N represent the total length of the time series. A first-order difference series is used to analyze its changing trend.
[0177]
[0178]
[0179] Alternatively, the global similarity can be calculated using the Spearman rank correlation coefficient (SCR) trend consistency measure based on first-order differences.
[0180] The Spearman correlation coefficient quantifies the degree of consistency in the trends of two sequences from a global perspective by ranking the changes in sequences and calculating the inter-rank correlation.
[0181]
[0182] in, Let represent the Spearman correlation coefficient constructed based on the first difference, with a value range of [-1, 1]. When When the value is close to 1, it indicates that the bubble ratio changes in the same direction for both workloads throughout the observation period; when When the value is close to 0, it indicates that the changes in the two are relatively independent; when... When the value is close to -1, it indicates that the two trends are opposite. For correlation calculation function, This is a sorting function.
[0183] Alternatively, the calculation of local similarity can be a local synchronization ratio measure based on a sliding window. .
[0184] This metric measures the frequency of synchronous growth or decline of two loads on a local time scale by statistically analyzing the proportion of locally positive correlations using a sliding window. A sliding window of length W is set on two first-order difference sequences, resulting in a total of K local windows. Within each window... Within each interval, the local correlation coefficient is taken. Then, the proportion of windows with values greater than 0 is calculated and defined as:
[0185]
[0186] in, This is an indicator function; it takes the value 1 when the correlation coefficient within the k-th local window is greater than 0, and 0 otherwise. Therefore, The value range is [0, 1].
[0187] Optionally, the comprehensive similarity scoring function is constructed as follows: Since the Spearman correlation coefficient ranges from [-1, 1], and The values of and are in the range [0, 1]. Since their dimensions and numerical ranges are different, they cannot be directly fused. Therefore, the Spearman coefficients are first normalized to map them to the [0, 1] interval. :
[0188]
[0189] Based on this, the normalized Spearman metric and We perform weighted fusion and define the comprehensive similarity scoring function as follows:
[0190]
[0191] The value of Score ranges from [0,1].
[0192] By employing the methods described in the above embodiments, the embodiments of this application can achieve accurate workload combination and evaluation of the combination. A possible workload combination screening and performance verification is given below.
[0193] Ten integer (INT rate) workloads from the benchmark were selected as a candidate set. Test pairs were constructed using a pairwise combination method, resulting in a total of Group candidate workload combinations.
[0194] Phase 1: Independent Physical Core Operation and Timing Modeling: Before the combined screening, each workload group is bound to two independent physical cores for operation. The comprehensive score, performance score, and bubble ratio are collected following the steps described above. After removing abnormal curves, the workloads are sorted from highest to lowest score (comprehensive similarity score), as shown in Table 1 below. Table 1 is a ranking table of comprehensive similarity scores for candidate workload combinations provided in this application embodiment.
[0195] Table 1. Ranking of Candidate Workload Combinations by Overall Similarity Score
[0196]
[0197] Based on the ranking results, the combinations with the highest similarity were 520+557 and 500+520, while the combinations with the lowest similarity were 500+523 and 525+541.
[0198] Phase Two: SMT Shared Core Verification: In the performance verification phase, with SMT enabled, the selected target combinations are bound to two logical CPUs on the same physical core for execution, and the same combination is deployed on another physical core in the same manner. During the experimental run, the mean bubble ratio at the physical core granularity and the performance score corresponding to each use case are collected simultaneously. The results are shown in Table 2 below. Table 2 is an example table of performance comparison data for various workload combinations in the SMT shared core verification phase provided by an embodiment of this application.
[0199] Table 2. Example of performance comparison data for various workload combinations during the SMT shared core verification phase.
[0200]
[0201] Optionally, Figure 3This is a schematic diagram of a workload timing graph before outlier removal and two-stage smoothing, provided in an embodiment of this application. Figure 4 This is a schematic diagram illustrating outlier removal and two-stage smoothing of a workload timing graph, as provided in an embodiment of this application. Figure 5 A time series comparison chart of bubble ratios for a candidate workload combination (520 and 557) during the independent physical core operation phase, provided as an embodiment of this application. Figure 6 A time series comparison of bubble ratios for another candidate workload combination (525 and 541) provided in this application embodiment during the standalone physical core operation phase. Among them, Figure 3 The horizontal axis represents time (seconds), with values from 0 to 300, and the vertical axis represents the bubble ratio, with values from 0.1 to 0.6. Figure 3 The original bubble ratio time series curves of the workload before outlier removal and two-stage smoothing are shown. Figure 4 The horizontal axis represents time (seconds), with values ranging from 0 to 300, and the vertical axis represents the bubble ratio, with values ranging from 0.1 to 0.5. Figure 4 The bubble ratio time series curves of the same workload after outlier detection and removal based on median absolute deviation (MAD), linear interpolation repair, and two-stage smoothing are shown. A comparison is made. Figure 3 and Figure 4 As can be seen, after the above preprocessing, the local spikes and abnormal jumps in the two bubble ratio time series (workload 1 represented by the upper curve and workload 2 represented by the lower curve) are effectively suppressed, and the stability of the time series data is significantly improved. Figure 5 The horizontal axis represents time (seconds), with values ranging from 0 to 300, and the vertical axis represents the bubble ratio, with values ranging from 0.1 to 0.5. Figure 5 The chart shows the candidate combinations with the highest overall similarity scores (520 and 557, with the upper curve representing workload 520 and the lower curve representing workload 557) during the independent physical core runtime phase, representing their respective bubble ratio time series. Figure 5 It can be seen that the bubble ratio of the two workloads shows a high degree of consistency in the global scope, indicating that they have the same resource consumption pattern in the time dimension. Figure 6 The horizontal axis represents time (seconds), with values ranging from 0 to 300, and the vertical axis represents the bubble ratio, with values ranging from 0.05 to 0.30. Figure 6 This shows the bubble ratio time series of the two workloads during the independent physical core run phase, representing the candidate combinations with the lowest overall similarity scores (525 and 541, with the upper curve representing workload 525 and the lower curve representing workload 541). Figure 6It can be seen that the bubble ratio changes of the two workloads show a clear misalignment on a global scale, indicating that they have complementary resource usage patterns in the time dimension.
[0202] The validation results show that combinations with low similarity or low competition tendencies are more likely to achieve better overall benefits in the SMT environment. However, combinations that are relatively synchronized with another workload in terms of time series are more likely to experience limited or even decreased benefits for individual use cases. Therefore, the bubble ratio time series correlation score constructed based on the independent physical core operation phase can effectively screen out better workload combinations in the SMT shared core scenario.
[0203] To address the issue that existing methods in related technologies struggle to dynamically characterize the resource competition and complementarity relationships between different workloads, this application's embodiments construct a corresponding bubble ratio time series by continuously sampling bubble ratio-related performance monitoring events at a fixed time granularity, and further utilize first-order difference Spearman and... The coefficients jointly evaluate the trend consistency and local synchronicity of two loads in the time dimension, thereby expanding the original static and coarse-grained judgment of load relationship into a dynamic analysis process oriented towards time evolution.
[0204] To address the issue that related technologies rely on complex microarchitecture events for resource modeling, this application's embodiments select a small number of standard performance monitoring events to construct a core-level microarchitecture bubble ratio index. This index uniformly describes the execution idle state of the processor's physical cores by the proportion of cycles in which no UOPs are executed within the activity cycle. It has good versatility, feasibility, and engineering promotion value.
[0205] In related technologies, the pressure injection method is difficult to effectively explain the formation mechanism of performance interference. The embodiments of this application use the bubble ratio, a core indicator with microarchitectural implications, to link performance changes with the degree of idle execution resources and trend synchronization behavior, thereby explaining the causes of performance improvement or interference. This allows the evaluation results to move beyond empirical judgments or black-box conclusions and have clear underlying behavioral support.
[0206] To address the challenge of effectively screening and determining workload combinations in real-world operating environments using existing technologies, this application employs a two-stage approach: independent physical core modeling followed by shared physical core verification. First, candidate workloads are run on two independent physical cores to obtain bubble ratio time series and calculate a comprehensive score, then all candidate combinations are uniformly ranked. Subsequently, high-similarity and low-similarity combinations are selected from the ranking results and verified on two logical CPUs within an SMT environment. In this way, this application can prioritize the screening of potentially competitive and potentially complementary combinations, forming a repeatable, scalable, and transferable methodological framework.
[0207] In multi-core processor scheduling optimization scenarios, the bubble ratio time series construction and correlation evaluation method in this application embodiment can be applied to task allocation between different physical cores. By analyzing the idle characteristics of each task execution and their temporal change relationship, the method can guide the reasonable distribution of tasks in the multi-core system to improve the overall resource utilization.
[0208] Figure 7 This is a schematic diagram of the combined processing apparatus for the workload provided in an embodiment of this application. Figure 7 As shown in the embodiments of this application, a combined workload processing device is also provided. The device includes: a first acquisition module 701, a second acquisition module 702, a first determination module 703, a calculation module 704, and a second determination module 705.
[0209] The first acquisition module is used to acquire multiple workloads;
[0210] The second acquisition module is used to acquire the performance monitoring event count value of each workload running on the physical core according to multiple preset sampling windows; wherein, the performance monitoring event count value includes a first count value and a second count value, the first count value is used to characterize the number of cycles in which the physical core is in the running state and has not performed micro-operations, and the second count value is used to characterize the number of cycles in which the physical core is in the running state.
[0211] The first determination module is used to determine the bubble ratio time series of each workload based on the performance monitoring event count value and the preset sampling window; wherein, the bubble ratio time series is used to characterize the resource idleness of physical cores within the preset sampling window;
[0212] The calculation module is used to calculate similarity data between multiple workloads based on the bubble ratio time series of each workload;
[0213] The second determination module is used to determine a combination strategy for multiple workloads based on similarity data.
[0214] In one possible embodiment, the first determining module is specifically used for:
[0215] The bubble ratio value corresponding to the preset sampling window is determined based on the ratio of the first count value and the second count value within the preset sampling window.
[0216] The bubble ratio values of multiple preset sampling windows are arranged according to their time sequence to obtain the bubble ratio time series of the workload.
[0217] In one possible embodiment, the calculation module includes a preprocessing unit and a similarity calculation unit;
[0218] The preprocessing unit is used to preprocess the bubble ratio time series to obtain the preprocessed series;
[0219] The similarity calculation unit is used to calculate similarity data between multiple workloads based on the preprocessed sequence.
[0220] In one possible embodiment, the preprocessing unit is specifically used for:
[0221] Outlier detection and removal are performed on the bubble ratio time series; and / or,
[0222] Outlier repair processing is performed on the bubble ratio time series; and / or,
[0223] The bubble ratio time series is smoothed; the smoothing process includes a first-stage smoothing process using median filtering and / or a second-stage smoothing process using moving average filtering.
[0224] In one possible embodiment, the similarity calculation unit is specifically used for:
[0225] Based on a preset timestamp, any two preprocessed sequences are aligned to obtain any two aligned sequences.
[0226] Calculate the similarity data between the corresponding workloads based on any two aligned sequences.
[0227] In one possible embodiment, the similarity calculation unit is specifically used for:
[0228] For any two aligned sequences, perform global similarity calculation to obtain the first similarity score;
[0229] For any two aligned sequences, perform local similarity calculation to obtain the second similarity.
[0230] Based on the first similarity and the second similarity, the similarity data between the corresponding workloads is calculated.
[0231] In one possible embodiment, the similarity calculation unit is specifically used for:
[0232] Generate the corresponding first-order difference sequence from any two aligned sequences;
[0233] The rank correlation coefficient is calculated based on the first-order difference sequence to obtain the first similarity.
[0234] In one possible embodiment, the similarity calculation unit is specifically used for:
[0235] Generate the corresponding first-order difference sequence from any two aligned sequences;
[0236] A preset sliding window is used to divide the first-order difference sequence into multiple local window sequences.
[0237] Calculate the local correlation coefficient within the preset sliding window based on the local window sequence;
[0238] The second similarity is determined based on the local correlation coefficient.
[0239] In one possible embodiment, the similarity calculation unit is specifically used for:
[0240] The first similarity score is normalized to obtain the normalized first similarity score.
[0241] Based on the normalized first and second similarities, a weighted fusion process is performed to obtain the similarity data between the corresponding workloads.
[0242] In one possible embodiment, the second determining module is specifically used for:
[0243] Based on similarity data, determine the competition status among multiple workloads; the competition status includes the presence of resource competition and the absence of resource competition.
[0244] Determine a strategy for combining multiple workloads based on the competition status.
[0245] In one possible embodiment, the second determining module is specifically used for:
[0246] If any two workloads compete for resources, the two workloads will be assigned to different physical cores.
[0247] If no two workloads compete for resources, the two workloads will be assigned to the same physical core.
[0248] In one possible embodiment, the second acquisition module is specifically used for:
[0249] Multiple workloads are bound to different physical cores to run; each physical core runs its corresponding workload independently.
[0250] On the physical core, collect the performance monitoring event count values of the workload within a preset sampling window.
[0251] In one possible embodiment, the device further includes a third determining module, configured to acquire runtime characteristics of multiple workloads and / or processor types of physical cores before the second acquiring module acquires performance monitoring event count values according to multiple preset sampling windows; determine time intervals according to runtime characteristics and / or processor types; and determine preset sampling windows according to time intervals.
[0252] In one possible embodiment, the device further includes a deployment module, a monitoring module, and an update module;
[0253] The deployment module is used to deploy multiple workloads to the corresponding physical cores for operation according to the combination strategy determined by the second determination module.
[0254] The monitoring module is used to monitor the performance metrics of the physical cores after deployment.
[0255] The update module is used to update similarity data and / or combination strategies based on performance metrics.
[0256] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device 80 provided in this embodiment includes at least one processor 801 and a memory 802. In one possible implementation, the electronic device 80 further includes a communication component 803. The processor 801, memory 802, and communication component 803 are connected via a bus.
[0257] In a specific implementation, at least one processor 801 executes computer execution instructions stored in memory 802, causing at least one processor 801 to perform the above-described combined processing embodiment of the workload.
[0258] The specific implementation process of processor 801 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0259] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0260] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0261] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings of this application's embodiments are not limited to only one bus or one type of bus.
[0262] An embodiment of this application also provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described combined workload processing method embodiments when running.
[0263] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0264] An embodiment of this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described combined workload processing method embodiments.
[0265] The embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described combined workload processing method embodiments.
[0266] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of this application.
[0267] The above provides a detailed description of a workload combination processing method and electronic device provided by the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the embodiments of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of the embodiments of this application. It should be noted that those skilled in the art can make several improvements and modifications to the embodiments of this application without departing from the principles of the embodiments of this application, and these improvements and modifications also fall within the protection scope of the embodiments of this application.
Claims
1. A method for combined processing of workloads, characterized in that, include: Acquire multiple workloads; Based on multiple preset sampling windows, the performance monitoring event count value of the workload running on the physical core is obtained; wherein, the performance monitoring event count value includes a first count value and a second count value, the first count value is used to characterize the number of cycles in which the physical core is in the running state and has not performed micro-operations, and the second count value is used to characterize the number of cycles in which the physical core is in the running state; Based on the performance monitoring event count and the preset sampling window, the bubble ratio time series of the workload is determined; wherein, the bubble ratio time series is used to characterize the resource idle degree of the physical core within the preset sampling window; Based on the bubble ratio time series, similarity data among the multiple workloads is calculated; Based on the similarity data, a combination strategy for multiple workloads is determined.
2. The method according to claim 1, characterized in that, The step of determining the bubble ratio time series of the workload based on the performance monitoring event count value and the preset sampling window includes: The bubble ratio value corresponding to the preset sampling window is determined based on the ratio of the first count value to the second count value within the preset sampling window; The bubble ratio values of the multiple preset sampling windows are arranged according to their time sequence to obtain the bubble ratio time series of the workload.
3. The method according to claim 1, characterized in that, The step of calculating similarity data among multiple workloads based on the bubble ratio time series includes: The bubble ratio time series is preprocessed to obtain a preprocessed series; Based on the preprocessed sequence, similarity data among the multiple workloads is calculated.
4. The method according to claim 3, characterized in that, The preprocessing of the bubble ratio time series includes: Outlier detection and removal are performed on the bubble ratio time series; and / or, The bubble ratio time series is subjected to outlier repair processing; and / or, The bubble ratio time series is smoothed; wherein the smoothing process includes a first-stage smoothing process using median filtering and / or a second-stage smoothing process using moving average filtering.
5. The method according to claim 3, characterized in that, The step of calculating similarity data among multiple workloads based on the preprocessed sequence includes: Based on a preset timestamp, any two preprocessed sequences are aligned to obtain any two aligned sequences. Calculate the similarity data between the corresponding workloads based on any two aligned sequences.
6. The method according to claim 5, characterized in that, The step of calculating the similarity data between the corresponding workloads based on any two aligned sequences includes: Based on any two aligned sequences, a global similarity calculation is performed to obtain the first similarity. Based on any two aligned sequences, perform local similarity calculation to obtain a second similarity. Based on the first similarity and the second similarity, the similarity data between the corresponding workloads is calculated.
7. The method according to claim 6, characterized in that, The step of performing a global similarity calculation based on any two aligned sequences to obtain a first similarity includes: Generate the corresponding first-order difference sequence based on any two aligned sequences; The rank correlation coefficient is calculated based on the first-order difference sequence to obtain the first similarity.
8. The method according to claim 6, characterized in that, The step of performing local similarity calculation based on any two aligned sequences to obtain a second similarity includes: Generate the corresponding first-order difference sequence based on any two aligned sequences; The first-order difference sequence is divided into multiple local window sequences by using a preset sliding window. Calculate the local correlation coefficient within the preset sliding window based on the local window sequence; The second similarity is determined based on the local correlation coefficient.
9. The method according to claim 6, characterized in that, The step of calculating the similarity data between the corresponding workloads based on the first similarity and the second similarity includes: The first similarity is normalized to obtain a normalized first similarity. Based on the normalized first similarity and the second similarity, a weighted fusion process is performed to obtain the similarity data between the corresponding workloads.
10. The method according to any one of claims 1 to 9, characterized in that, The step of determining a combination strategy for multiple workloads based on the similarity data includes: Based on the similarity data, the competition status among the multiple workloads is determined; wherein, the competition status includes resource competition and no resource competition. Based on the competition state, a combination strategy for multiple workloads is determined.
11. The method according to claim 10, characterized in that, The step of determining a combination strategy for multiple workloads based on the competition state includes: If any two workloads compete for resources, the two workloads will be assigned to different physical cores. If no two workloads compete for resources, the two workloads will be assigned to the same physical core.
12. The method according to any one of claims 1 to 9, characterized in that, The step of obtaining the performance monitoring event count value of the workload running on the physical core according to multiple preset sampling windows includes: The multiple workloads are each bound to a different physical core for execution; wherein, each physical core independently runs its corresponding workload. On the physical core, the performance monitoring event count value of the workload within the preset sampling window is collected.
13. The method according to any one of claims 1 to 9, characterized in that, Before obtaining the performance monitoring event count value of the workload running on the physical core according to multiple preset sampling windows, the method further includes: Obtain the runtime characteristics of multiple workloads and / or the processor type of the physical cores; The time interval is determined based on the runtime characteristics and / or the processor type; The preset sampling window is determined based on the time interval.
14. The method according to any one of claims 1 to 9, characterized in that, After determining the combination strategy for multiple workloads based on the similarity data, the method further includes: According to the combined strategy, multiple workloads are deployed to run on the corresponding physical cores; Monitor the performance metrics of the physical core after deployment; Update the similarity data and / or the combined strategy based on the performance metrics.
15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the combined processing method for the workload as described in any one of claims 1 to 9.
