Screening sorting operator performance overhead model processing method, data processing method based on screening sorting operator, electronic equipment, storage medium and program

CN122431840BActive Publication Date: 2026-10-27SHANGHAI SUIYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610883367.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-10-27
Estimated Expiration
2046-06-18

AI Technical Summary

Technical Problem

[0003]当前,现有技术中确定筛选排序算子的方式主要分为两类,均存在明显的技术缺陷:一类是依赖简单的阈值规则选择筛选排序算子,该方式无法适应数据规模和数据分布动态变化的场景,易导致算子选择与实际输入场景不匹配,造成资源浪费或性能瓶颈;另一类是依赖自动寻优的离线搜索方式确定筛选排序算子,该方式前期测试会消耗大量的时间成本与计算资源,且离线搜索得到的最优算子仅适用于预设的固定输入场景,无法实时适配动态变化的输入需求,实用性较差

Benefits of technology

[0013]本发明实施例通过根据目标设备的硬件资源参数和各筛选排序算子的算子配置参数确定各筛选排序算子的性能开销计算关联参数,进而根据各筛选排序算子的性能开销计算关联参数生成各筛选排序算子的性能开销模型。在得到各筛选排序算子的性能开销模型之后,调用多个筛选排序算子的性能开销模型计算各筛选排序算子对待处理张量数据执行筛选排序操作时的总体性能开销。进一步的,根据各筛选排序算子对待处理张量数据执行筛选排序操作时的总体性能开销筛选目标筛选排序算子,进而利用目标筛选排序算子对待处理张量数据进行筛选排序处理。上述方案解决了现有筛选排序算子选型方案存在的场景适配性差、资源消耗大以及动态适配能力弱的缺陷,能够通过构建筛选排序算子的性能开销模型精准模拟各类筛选排序算子运行过程中的性能开销,实现在任务调度环节自适应择优选用最优执行筛选排序算子,有效提升数据处理过程中筛选排序算子的整体运算效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431840B_ABST
    Figure CN122431840B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of screening sorting operator performance overhead model processing method and data processing method based on screening sorting operator, electronic equipment, storage medium and program, wherein, method includes: according to the hardware resource parameter of target device and each screening sorting operator operator configuration parameter determines the performance overhead calculation associated parameter of each screening sorting operator;According to the performance overhead calculation associated parameter of each screening sorting operator generates the performance overhead model of each screening sorting operator.The technical scheme of the embodiment of the application can accurately simulate the performance overhead in the running process of various screening sorting operators by constructing the performance overhead model of screening sorting operator, realize self-adapting optimal execution screening sorting operator in task scheduling link, effectively improve the overall operation efficiency of screening sorting operator in data processing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing, and in particular to a performance overhead model processing method for a filtering and sorting operator, as well as a data processing method, electronic device, storage medium, and program based on the filtering and sorting operator. Background Technology

[0002] The sorting and filtering operator is a core fundamental operation in deep learning training and inference, and its performance directly determines the overall efficiency and computational accuracy of the model. The core objective of this operator is to accurately identify and filter out the K largest or smallest elements from N input elements according to a preset sorting criterion.

[0003] Currently, existing technologies for determining filtering and sorting operators mainly fall into two categories, both of which have significant technical drawbacks: one category relies on simple threshold rules to select filtering and sorting operators. This method cannot adapt to scenarios with dynamically changing data scale and distribution, and is prone to causing mismatches between operator selection and actual input scenarios, resulting in resource waste or performance bottlenecks. The other category relies on offline search methods with automatic optimization to determine filtering and sorting operators. This method consumes a lot of time and computing resources in the early stages of testing, and the optimal operator obtained from offline search is only applicable to preset fixed input scenarios, and cannot adapt to dynamically changing input requirements in real time, resulting in poor practicality.

[0004] In the process of realizing this invention, the inventors discovered that existing screening and sorting operator selection schemes have defects such as poor scenario adaptability, high resource consumption, and weak dynamic adaptability. The root cause is that an operator performance cost model adapted to multiple working conditions has not been built. It is impossible to calculate the performance cost of different screening and sorting operators in real time through the operator performance cost model, making it difficult to make optimal operator decisions based on dynamic input data, which greatly limits the improvement of training and inference efficiency of deep learning models. Summary of the Invention

[0005] This invention provides a performance overhead model processing method for filtering and sorting operators, as well as a data processing method, electronic device, storage medium, and program based on filtering and sorting operators. By constructing a performance overhead model for filtering and sorting operators, it can accurately simulate the performance overhead of various filtering and sorting operators during operation, and achieve adaptive selection of the optimal filtering and sorting operator during task scheduling, thereby effectively improving the overall computational efficiency of filtering and sorting operators in data processing.

[0006] According to one aspect of the present invention, a method for processing the performance overhead model of a screening and sorting operator is provided, comprising: The performance overhead calculation correlation parameters of each filtering and sorting operator are determined based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator. The performance cost model of each filtering and sorting operator is generated by calculating the associated parameters based on the performance cost of each filtering and sorting operator.

[0007] According to another aspect of the present invention, a data processing method based on a filtering and sorting operator is provided, comprising: The performance overhead model of calling multiple filtering and sorting operators is used to calculate the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device. The performance overhead model of each of the filtering and sorting operators is generated by the performance overhead model processing method of the filtering and sorting operators described in any embodiment of the present invention. Target filtering and sorting operators are selected based on the overall performance overhead of performing filtering and sorting operations on the tensor data to be processed according to each of the aforementioned filtering and sorting operators. The target filtering and sorting operator is used to filter and sort the tensor data to be processed.

[0008] According to another aspect of the present invention, a performance overhead model processing apparatus for a screening and sorting operator is provided, comprising: The performance overhead calculation correlation parameter determination module is used to determine the performance overhead calculation correlation parameters of each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator. The performance overhead model generation module is used to generate the performance overhead model of each of the filtering and sorting operators by calculating the associated parameters based on the performance overhead of each filtering and sorting operator.

[0009] According to another aspect of the present invention, a data processing apparatus based on a filtering and sorting operator is provided, comprising: The overall performance overhead calculation module is used to call the performance overhead model of multiple filtering and sorting operators to calculate the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device. The performance overhead model of each of the filtering and sorting operators is generated by the performance overhead model processing method of the filtering and sorting operators described in any embodiment of the present invention. The target filtering and sorting operator filtering module is used to filter target filtering and sorting operators based on the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. The filtering and sorting processing module is used to perform filtering and sorting processing on the tensor data to be processed using the target filtering and sorting operator.

[0010] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and a memory communicatively connected to said at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the performance overhead model processing method of the filtering and sorting operator or the data processing method based on the filtering and sorting operator as described in any embodiment of the present invention.

[0011] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the performance overhead model processing method of the filtering and sorting operator or the data processing method based on the filtering and sorting operator as described in any embodiment of the present invention.

[0012] According to another aspect of the present invention, a computer program product is also provided, comprising a computer program that, when executed by a processor, implements the performance overhead model processing method of the filtering and sorting operator or the data processing method based on the filtering and sorting operator as described in any embodiment of the present invention.

[0013] This invention determines the performance overhead calculation parameters of each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator. Then, it generates a performance overhead model for each filtering and sorting operator based on these parameters. After obtaining the performance overhead models, it calculates the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. Further, it selects a target filtering and sorting operator based on the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, and then uses the target filtering and sorting operator to perform filtering and sorting processing on the tensor data to be processed. This solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptability. It can accurately simulate the performance overhead of various filtering and sorting operators during operation by constructing performance overhead models, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators during data processing.

[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 2 of the present invention; Figure 3 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 3 of the present invention; Figure 4 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 4 of the present invention; Figure 5 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 5 of the present invention; Figure 6 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment Six of the present invention; Figure 7 This is a flowchart of a data processing method based on a filtering and sorting operator provided in Embodiment 7 of the present invention; Figure 8 This is a schematic diagram of a performance overhead model processing device for a screening and sorting operator provided in Embodiment 8 of the present invention; Figure 9 This is a schematic diagram of a data processing device based on a filtering and sorting operator provided in Embodiment 9 of the present invention; Figure 10 This is a schematic diagram of the structure of an electronic device provided in Embodiment 10 of the present invention. Detailed Implementation

[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0018] It should be noted that the terms "first," "second," and "target," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0019] Example 1 Figure 1 This is a flowchart of a performance overhead model processing method for filtering and sorting operators provided in Embodiment 1 of the present invention. This embodiment is applicable to constructing performance overhead models for each filtering and sorting operator to accurately simulate the performance overhead of each filtering and sorting operator during operation. This method can be executed by a performance overhead model processing device for filtering and sorting operators. This device can be implemented in software and / or hardware and is generally integrated into an electronic device. This electronic device can be a terminal device or a server device, as long as it can execute the performance overhead model processing method for filtering and sorting operators. The present invention does not limit the specific type of electronic device. Correspondingly, as... Figure 1 As shown, the method includes the following operations: S110. Determine the performance overhead calculation correlation parameters of each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator.

[0020] The target device can be the device to which the filtering and sorting operation is to be performed. For example, the target device may include, but is not limited to, a GPU (Graphics Processing Unit), etc. This embodiment of the invention does not limit the specific type of the target device. Hardware resource parameters can be a collection of various quantitative and characteristic parameters of the target device's hardware configuration specifications, hardware capability attributes, and hardware resource availability status. For example, hardware resource parameters may include, but are not limited to, the number of thread blocks, the number of threads, memory capacity, computing unit specifications, and read / write bandwidth, etc. This embodiment of the invention does not limit the specific content included in the hardware resource parameters. The filtering and sorting operator can be an operation operator used for data filtering and data sorting. For example, the filtering and sorting operator may include, but is not limited to, a first filtering and sorting operator, a second filtering and sorting operator, a third filtering and sorting operator, and a fourth filtering and sorting operator, etc. This embodiment of the invention does not limit the specific type of the filtering and sorting operator. Operator configuration parameters can be various parameters that set the execution rules, running dimensions, filtering conditions, sorting rules, and hardware scheduling configuration of the filtering and sorting operator. For example, operator configuration parameters may include, but are not limited to, the number of targets selected, the target splitting axis, the data type, and the sorting mode. The target selection quantity can be the number of data points that the filtering and sorting operator needs to output. The target split axis can be the data axis dimension on which the filtering and sorting operator operates. The data type can be the storage and operational data type of the tensor data to be processed. The sorting mode can be a configuration flag indicating whether the filtering and sorting process uses a stable sorting rule. The performance overhead calculation parameters can be parameters used to calculate the performance overhead incurred by each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. The tensor data to be processed can be the input data for the filtering and sorting operation.

[0021] In this embodiment of the invention, to accurately quantify and estimate the performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator can first be obtained. Based on the obtained hardware resource parameters and operator configuration parameters, performance overhead calculation correlation parameters for each filtering and sorting operator used for overhead modeling can be further obtained.

[0022] S120. Calculate the correlation parameters based on the performance overhead of each of the filtering and sorting operators to generate the performance overhead model of each of the filtering and sorting operators.

[0023] Among them, the performance overhead model can be a model that quantifies the actual performance overhead of the filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed.

[0024] Accordingly, after determining the performance overhead calculation parameters of each filtering and sorting operator, the inherent correlation of the performance overhead calculation parameters of each filtering and sorting operator can be analyzed based on the operation logic of each filtering and sorting operator. Then, the performance overhead model of each filtering and sorting operator can be generated based on the inherent correlation of the performance overhead calculation parameters of each filtering and sorting operator. This allows for the accurate quantification and prediction of the various performance overheads generated by the corresponding filtering and sorting operator on the target device when performing filtering and sorting operations on the tensor data to be processed, providing a reliable quantitative basis for subsequent operator scheduling selection.

[0025] Therefore, the performance overhead model processing method for filtering and sorting operators provided in this embodiment of the invention, by combining the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator, determines the performance overhead calculation correlation parameters corresponding to each filtering and sorting operator. This enables the generation of dedicated performance overhead models adapted to the characteristics of different types and configuration specifications of filtering and sorting operators. After constructing the performance overhead model for each filtering and sorting operator based on the determined performance overhead calculation correlation parameters, the runtime performance overhead of the filtering and sorting operator when processing tensor data can be accurately quantified. Furthermore, during the task scheduling phase, the optimal filtering and sorting operator can be adaptively selected and matched for task execution, effectively improving the overall computational efficiency and data processing throughput performance of the filtering and sorting operators during tensor data processing, while further enhancing the utilization efficiency of hardware resources.

[0026] This invention determines the performance overhead calculation parameters for each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator. Then, it generates a performance overhead model for each filtering and sorting operator based on these parameters. This solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptability. By constructing a performance overhead model for filtering and sorting operators, it accurately simulates the performance overhead of various filtering and sorting operators during operation, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators in data processing.

[0027] Example 2 Figure 2 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 2 of the present invention. This embodiment is a specific embodiment based on the above embodiment. In this embodiment, specific optional implementation methods are given for determining the performance overhead calculation correlation parameters of each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator. Correspondingly, as Figure 2As shown, the method in this embodiment may include: S210. Determine the data parallel configuration parameters of the tensor data to be processed for each of the filtering and sorting operators based on the hardware resource parameters of the target device.

[0028] The data parallel configuration parameters are a series of configurable parameters used to control the rules for parallel data splitting, distribution, and collaborative operation. For example, these parameters may include, but are not limited to, the maximum element capacity of each thread, the number of calculation loop unrolls, the data splitting granularity, and the data block size. This embodiment of the invention does not limit the specific content included in the data parallel configuration parameters. The number of calculation loop unrolls can be the total number of loop iterations required to complete the traversal and computation of all the tensor data to be processed in the execution logic of each filtering and sorting operator. The data splitting granularity can be the data size and dimension standard of a single partition unit set when splitting and partitioning the tensor data to be processed. The data block size can be the number of data elements carried by a single data block after the tensor data to be processed is divided into blocks.

[0029] In this embodiment of the invention, to accurately quantify and predict the various performance overheads incurred by different types of filtering and sorting operators during the filtering and sorting operations on the tensor data to be processed, the actual carrying capacity and architectural characteristics of the underlying hardware can be fully considered. First, the hardware resource parameters of the target device can be obtained. These parameters accurately reflect the underlying hardware endowments of the target device, such as computing power specifications, storage bandwidth, number of computing cores, and hardware parallelism capabilities. Furthermore, based on the hardware resource parameters of the target device, adaptation parsing and rule matching can be performed to reasonably determine data parallelism configuration parameters that adapt to the operating characteristics of each filtering and sorting operator and match the hardware resource carrying capacity. This provides reliable parameter input and basis for subsequently constructing an accurate performance overhead model and quantifying the actual operating overhead of the operators.

[0030] In an optional embodiment of the present invention, determining the data parallel configuration parameters of the tensor data to be processed for each of the filtering and sorting operators based on the hardware resource parameters of the target device may include: determining the maximum element capacity and the number of calculation loop unrolling times for each thread in the target device based on the hardware resource parameters of the target device; and determining the data segmentation granularity and data block size of the tensor data to be processed based on the maximum element capacity of each thread in the target device.

[0031] Specifically, when determining the data parallel configuration parameters for each filtering and sorting operator on the tensor data to be processed based on the hardware resource parameters of the target device, the maximum element capacity of each thread in the target device and the number of computational loop unrolling operations adapted to the hardware pipeline execution characteristics can be reasonably determined first. During the filtering and sorting process executed by various filtering and sorting operators, each data block of the tensor data to be processed can be subjected to an expanded comparison operation on each element within the block according to the preset number of computational loop unrolling operations. It is understood that the number of computational loop unrolling operations can be obtained by calibrating the actual performance of the target device. Furthermore, based on clarifying the maximum element capacity of each thread, the data processing logic of the filtering and sorting operators and the dimensional characteristics of the tensor data can be combined to adaptively match and determine the data segmentation granularity and data block size corresponding to the tensor data to be processed, so that the data fragment size and the degree of fineness of partitioning can be adapted to the processing capacity of a single thread, laying the parameter foundation for the subsequent efficient parallel distribution of tensor data and the balanced load operation of filtering and sorting operators.

[0032] S220. Determine the target split axis, non-target split axis, and target selection quantity for the tensor data to be processed by each of the filtering and sorting operators according to the operator configuration parameters of each of the filtering and sorting operators.

[0033] The non-target split axis can be any axis in the tensor data to be processed other than the target split axis. For example, the non-target split axis can be the batch axis of the tensor data to be processed. This embodiment of the invention does not limit the specific type of the non-target split axis.

[0034] Specifically, after obtaining the operator configuration parameters of each filtering and sorting operator, the operator configuration parameters of each filtering and sorting operator can be parsed, so as to determine the target split axis, non-target split axis and target selection quantity of the tensor data to be processed by each filtering and sorting operator based on the above parsing results.

[0035] S230. Determine the block performance overhead parameters of each filtering and sorting operator for the data block of the tensor data to be processed based on the data parallel configuration parameters of each filtering and sorting operator, the target split axis, the non-target split axis, and the number of target selections.

[0036] Among them, the block performance overhead parameter can be a parameter that can characterize the runtime performance overhead generated by each filtering and sorting operator when performing filtering and sorting operations on each data block of the tensor data to be processed.

[0037] Accordingly, after obtaining the data parallel configuration parameters, target split axis, non-target split axis and target selection number of each filtering and sorting operator for the tensor data to be processed, the tensor data to be processed can be divided into blocks by combining the constraint characteristics of the above multiple dimension parameters and the operation characteristics of the operators, and the block performance overhead parameters of each filtering and sorting operator for the data block of the tensor data to be processed can be determined.

[0038] S240. Use the data parallel configuration parameters and the block performance overhead parameters as the performance overhead calculation association parameters.

[0039] Correspondingly, after obtaining the data parallel configuration parameters and the block performance overhead parameters, the data parallel configuration parameters and the block performance overhead parameters can be used as performance overhead calculation correlation parameters. Then, the performance overhead model of each filtering and sorting operator can be generated based on the performance overhead calculation correlation parameters of each filtering and sorting operator.

[0040] S250. Calculate the associated parameters based on the performance overhead of each of the filtering and sorting operators to generate the performance overhead model of each of the filtering and sorting operators.

[0041] This invention determines the data parallel configuration parameters of each filtering and sorting operator for the tensor data to be processed based on the hardware resource parameters of the target device, and determines the target split axis, non-target split axis, and target selection quantity for each filtering and sorting operator based on the operator configuration parameters of each filtering and sorting operator. Further, it determines the block performance overhead parameters for each filtering and sorting operator's data segmentation of the tensor data to be processed based on the data parallel configuration parameters, target split axis, non-target split axis, and target selection quantity of each filtering and sorting operator, and then uses the data parallel configuration parameters and block performance overhead parameters as performance overhead calculation correlation parameters. After obtaining the performance overhead calculation correlation parameters, a performance overhead model for each filtering and sorting operator is generated based on these parameters. This solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptability. By constructing a performance overhead model for the filtering and sorting operators, it accurately simulates the performance overhead during the operation of various filtering and sorting operators, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators during data processing.

[0042] Example 3 Figure 3This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 3 of the present invention. This embodiment is based on the above embodiment and is further specified. In this embodiment, when the filtering and sorting operator includes a first filtering and sorting operator, a specific optional implementation method is given for generating the performance overhead model of each filtering and sorting operator by calculating the correlation parameters according to the performance overhead of each filtering and sorting operator. Correspondingly, as Figure 3 As shown, the method in this embodiment may include: S310. Determine the data parallel configuration parameters of the tensor data to be processed by each of the filtering and sorting operators based on the hardware resource parameters of the target device.

[0043] In an optional embodiment of the present invention, determining the data parallel configuration parameters of the tensor data to be processed for each of the filtering and sorting operators based on the hardware resource parameters of the target device may include: determining the maximum element capacity and the number of calculation loop unrolling times for each thread in the target device based on the hardware resource parameters of the target device; and determining the data segmentation granularity and data block size of the tensor data to be processed based on the maximum element capacity of each thread in the target device.

[0044] S320. Determine the target split axis, non-target split axis, and target selection quantity for the tensor data to be processed by each of the filtering and sorting operators according to the operator configuration parameters of each of the filtering and sorting operators.

[0045] S330. Determine the block performance overhead parameters of each filtering and sorting operator for the data block of the tensor data to be processed based on the data parallel configuration parameters of each filtering and sorting operator, the target split axis, the non-target split axis, and the number of target selections for the tensor data to be processed.

[0046] In an optional embodiment of the present invention, the filtering and sorting operator includes a first filtering and sorting operator. The step of determining the block performance overhead parameters of each filtering and sorting operator for data block partitioning of the tensor data to be processed, based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the target selection quantity, may include: partitioning the tensor data to be processed along the target split axis and the non-target split axis according to the data partitioning granularity and the data block size, respectively, to obtain multiple first target axis inner layer data blocks and multiple first non-target axis outer layer data blocks; determining the number of elements and the number of blocks in the first target axis inner layer data blocks, and determining the number of blocks in the first non-target axis outer layer data blocks; and determining the single-element selection overhead, single-time reduction overhead, and utilization factor when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0047] The first filtering and sorting operator can be an axis splitting iterative selection operator. The first target axis inner data block can be obtained by dividing the tensor data to be processed along the target splitting axis when performing the filtering and sorting operation using the first filtering and sorting operator. The first non-target axis outer data block can be obtained by dividing the tensor data to be processed along a non-target splitting axis when performing the filtering and sorting operation using the first filtering and sorting operator. The single-element selection overhead can be the performance overhead incurred by the first filtering and sorting operator when selecting a single element from the batch data during the filtering and sorting operation on the target device. The single-reduction overhead can be the performance overhead incurred by performing a basic pairwise reduction and merging operation. The utilization factor can be a coefficient used to quantify the hardware data handling efficiency and reduction communication overhead of the target device.

[0048] Specifically, when the filtering and sorting operators include a first filtering and sorting operator, when determining the block performance overhead parameters for data segmentation of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections, the tensor data to be processed can be segmented along both the target split axis and the non-target split axis according to the data segmentation granularity and the data block size. This results in multiple inner-layer data blocks along the first target axis and multiple outer-layer data blocks along the first non-target axis, forming a nested data block structure of inner-layer target axis blocks and outer-layer non-target axis blocks. Based on this, the number of elements and the number of blocks in the inner-layer data blocks along the first target axis, as well as the number of blocks in the outer-layer data blocks along the first non-target axis, can be determined.

[0049] At the same time, by combining the operator operation characteristics of the first screening and sorting operator itself with the hardware resource configuration conditions of the target device, the single element selection cost and single reduction cost of the first screening and sorting operator in the process of performing screening and sorting operation on the tensor data to be processed can be accurately quantified and verified, providing a basic quantitative basis for solving the block performance cost parameters of the data block of the screening and sorting operator in the future.

[0050] Furthermore, in the existing technical solutions, the first screening and sorting operator needs to separately calculate the data transport loss and protocol communication overhead during the screening and sorting operation. The operation evaluation process is complicated and redundant. Moreover, the method of evaluating by splitting the items has obvious error accumulation and low evaluation accuracy. It cannot efficiently and accurately correct the theoretical peak computing power of the hardware to the actual effective computing power that can be deployed, thereby restricting the performance optimization and intelligent computing power scheduling effect of high-performance computing hardware.

[0051] This solution introduces a utilization factor, which unifies the modeling of data transfer efficiency losses and protocol communication overhead in the hardware data transfer engine. It merges these two types of core performance losses into a single conversion factor, eliminating the need for separate calculations for each type of loss. This significantly simplifies the performance evaluation modeling process for high-performance computing hardware and improves evaluation execution efficiency. For example, the utilization factor can be determined by the ratio of actual performance overhead to theoretical performance overhead. Based on this utilization factor, accurate correction and quantitative evaluation of the hardware's effective computing power can be quickly completed. While simplifying the performance modeling logic, this effectively improves the accuracy and engineering practicality of computing power evaluation.

[0052] The data parallel configuration parameters and the block performance overhead parameters are used as the associated parameters for performance overhead calculation.

[0053] S340. Based on the number of targets selected, the number of loop expansions, the number of elements in the inner layer data block of the first target axis, and the single element selection cost, calculate the total cost of single data block selection when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0054] The total cost of selecting a single data block can be the performance cost incurred by the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device, in selecting the target number of data within a single data block.

[0055] Specifically, after determining the performance overhead calculation correlation parameters of the first filtering and sorting operator, the performance overhead of selecting the target selection quantity, the number of calculation loops, the number of elements in the inner layer data block of the first target axis, and the single element selection overhead in the performance overhead calculation correlation parameters of the first filtering and sorting operator can be used to calculate the performance overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device, i.e., the total cost of selecting the target selection quantity within a single data block.

[0056] In a specific example, the total cost of selecting a single data block when the first filtering and sorting operator performs a filtering and sorting operation on the tensor data to be processed can be calculated based on the following formula: ; in, The total cost of selecting a single data block when performing a filtering and sorting operation on the tensor data to be processed by the first filtering and sorting operator. Select the quantity for the target. The number of elements in the inner layer data block of the first target axis. To calculate the number of loop unrollings, The cost of selecting a single element.

[0057] S350. Based on the number of targets selected, the number of calculation loop expansions, the number of blocks in the inner layer data block of the first target axis, and the single reduction cost, calculate the in-thread reduction cost when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0058] Among them, the in-thread reduction overhead can be the computational overhead generated by the first filtering and sorting operator performing filtering and sorting operations on the tensor data to be processed on the target device, and merging and summarizing the selection results of each data block within a single thread.

[0059] Specifically, after determining the performance overhead calculation parameters of the first filtering and sorting operator, the computational overhead generated by the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device, i.e., the in-thread reduction overhead, can also be calculated based on the number of target selections, the number of calculation loop expansions, the number of blocks of the inner layer data blocks of the first target axis, and the single reduction overhead.

[0060] In a specific example, the in-thread reduction overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The in-thread reduction overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. The product of the number of data blocks in the inner layer of the first target axis and the number of target selections, i.e., the number of reduced data processed within a single thread. This is the cost of a single reduction.

[0061] S360. Based on the number of blocks in the first non-target axis outer layer data block, the total overhead of selecting a single data block, the in-thread reduction overhead, and the utilization factor, calculate the total parallel thread computation overhead when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0062] The total overhead of parallel thread computation can be the overall computational overhead generated by a single thread merging, summarizing, and reducing the selection results of each thread after the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed on the target device.

[0063] Specifically, after determining the performance overhead calculation parameters of the first filtering and sorting operator, the overall computational overhead generated by a single thread merging and summarizing the selection results of each thread and reducing and integrating them after the corresponding operation logic is executed in a loop, can also be calculated based on the number of blocks of the outer layer data block of the first non-target axis, the total overhead of selecting a single data block, the reduction overhead within the thread, and the utilization factor. That is, the total computational overhead of parallel threads.

[0064] In a specific example, the total overhead of parallel thread computation when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, This represents the total overhead of parallel thread computation when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. The number of blocks in the outer layer data segment for the first non-target axis represents the number of outer layer loops during the calculation process. This is the utilization factor.

[0065] S370. Based on the number of blocks in the first non-target axis outer layer data block, the number of targets selected, the number of calculation loop expansions, the total number of threads in the target device, the single reduction overhead, and the utilization factor, calculate the cross-thread reduction overhead when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0066] Among them, the cross-thread reduction overhead can be the computational overhead generated when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed on the target device, and merges and summarizes the selection results of multiple threads.

[0067] Specifically, after determining the performance overhead calculation parameters of the first filtering and sorting operator, the computational overhead generated by merging and summarizing the selection results of multiple threads when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed on the target device can also be calculated based on the number of blocks of the first non-target axis outer layer data block, the number of target selections, the number of calculation loop expansions, the total number of threads in the target device, the single reduction overhead, and the utilization factor.

[0068] In a specific example, the cross-thread reduction overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The cross-thread reduction overhead is the cost of performing filtering and sorting operations on the tensor data to be processed by the first filtering and sorting operator. The product of the total number of threads and the target selection number represents the total number of reduced data output by each thread.

[0069] S380. Generate an overall performance overhead model for the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, based on the total overhead of the single data block selection, the intra-thread reduction overhead, the total overhead of the parallel thread operation, and the cross-thread reduction overhead.

[0070] Accordingly, after obtaining the total overhead of single data block selection, intra-thread reduction overhead, total overhead of parallel thread computation, and cross-thread reduction overhead through the above steps, the sum of these overheads can be calculated as the overall performance overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. Based on this, an overall performance overhead model adapted to the operation logic of the first filtering and sorting operator and the block processing characteristics of the tensor data to be processed can be generated by combining the above parameters, thereby achieving accurate modeling and quantitative evaluation of the overall computation time and performance loss during the execution of the first filtering and sorting operator.

[0071] In a specific example, the overall performance overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The first filtering and sorting operator represents the overall performance overhead when performing filtering and sorting operations on the tensor data to be processed.

[0072] This invention, in its embodiments, determines the data parallel configuration parameters of each filtering and sorting operator for the tensor data to be processed based on the hardware resource parameters of the target device, and determines the target split axis, non-target split axis, and target selection quantity for each filtering and sorting operator based on the operator configuration parameters of each filtering and sorting operator. Further, it determines the block performance overhead parameters for each filtering and sorting operator's data segmentation of the tensor data to be processed based on the data parallel configuration parameters, target split axis, non-target split axis, and target selection quantity of each filtering and sorting operator, and then uses the data parallel configuration parameters and block performance overhead parameters as performance overhead calculation correlation parameters. After determining the performance overhead calculation correlation parameters, it calculates the total single data block selection overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed based on the target selection quantity, the number of calculation loop unrolling times, the number of elements in the inner data block of the first target axis, and the single element selection overhead. Simultaneously, it calculates the in-thread reduction overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed based on the target selection quantity, the number of calculation loop unrolling times, the number of blocks in the inner data block of the first target axis, and the single reduction overhead. Furthermore, based on the number of blocks in the first non-target axis outer layer data block, the total overhead of single data block selection, the intra-thread reduction overhead, and the utilization factor, the total parallel thread computation overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated. In addition, based on the number of blocks in the first non-target axis outer layer data block, the number of target selections, the number of computation loop unrollings, the total number of threads in the target device, the single reduction overhead, and the utilization factor, the cross-thread reduction overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated. Based on this, an overall performance overhead model of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is generated based on the total overhead of single data block selection, the intra-thread reduction overhead, the total parallel thread computation overhead, and the cross-thread reduction overhead. The above solution addresses the shortcomings of existing screening and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptation capabilities. It can accurately simulate the performance overhead of various screening and sorting operators during operation by constructing a performance overhead model of the screening and sorting operators, and achieve adaptive selection of the optimal screening and sorting operators during task scheduling, thereby effectively improving the overall computational efficiency of screening and sorting operators in data processing.

[0073] Example 4 Figure 4 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 4 of the present invention. This embodiment is based on the above embodiment and is further specified. In this embodiment, when the filtering and sorting operator includes a second filtering and sorting operator, a specific optional implementation method is given for generating the performance overhead model of each filtering and sorting operator by calculating the correlation parameters according to the performance overhead of each filtering and sorting operator. Correspondingly, as Figure 4 As shown, the method in this embodiment may include: S410. Determine the data parallel configuration parameters of the tensor data to be processed by each of the filtering and sorting operators based on the hardware resource parameters of the target device.

[0074] In an optional embodiment of the present invention, determining the data parallel configuration parameters of the tensor data to be processed for each of the filtering and sorting operators based on the hardware resource parameters of the target device may include: determining the maximum element capacity and the number of calculation loop unrolling times for each thread in the target device based on the hardware resource parameters of the target device; and determining the data segmentation granularity and data block size of the tensor data to be processed based on the maximum element capacity of each thread in the target device.

[0075] S420. Determine the target split axis, non-target split axis, and target selection quantity for the tensor data to be processed by each of the filtering and sorting operators according to the operator configuration parameters of each of the filtering and sorting operators.

[0076] S430. Determine the block performance overhead parameters of each filtering and sorting operator for the data block of the tensor data to be processed based on the data parallel configuration parameters of each filtering and sorting operator, the target split axis, the non-target split axis, and the number of target selections.

[0077] In an optional embodiment of the present invention, the filtering and sorting operator includes a second filtering and sorting operator. The step of determining the block performance overhead parameters of each filtering and sorting operator for data blocks of the tensor data to be processed, based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections, may include: determining the transport bandwidth coefficient, sorting coefficient, and variable attenuation coefficient of the second filtering and sorting operator when performing filtering and sorting operations on the target device; dividing the tensor data to be processed into blocks along the target split axis and the non-target split axis according to the data splitting granularity and the data block size, respectively, to obtain multiple second target axis inner layer data blocks and multiple second non-target axis outer layer data blocks; determining the number of elements and the number of blocks in the second target axis inner layer data blocks, and determining the number of blocks in the second non-target axis outer layer data blocks; and determining the non-target axis head overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed based on the number of blocks in the second non-target axis outer layer data blocks.

[0078] The second filtering and sorting operator can be a batch axis splitting and iterative selection operator. The transport bandwidth coefficient can be the ratio of the actual effective data transport bandwidth achievable by the hardware data transmission path when handling the transport task of the tensor data to be processed to the nominal theoretical peak transport bandwidth of the hardware. The sorting coefficient can be a quantitative representation parameter of the difference in computational overhead between different sorting modes when the target device runs. For example, the sorting mode can include, but is not limited to, stable sorting mode and unstable sorting mode. The variable decay coefficient can be a dynamic correction coefficient introduced in the multi-round iterative selection scenario of the filtering and sorting operator, used to quantify the decrease in the effective comparison computation in each round of iteration and correct the theoretical overhead of the multi-round selection process. The second target axis inner layer data block can be obtained by dividing the tensor data to be processed along the target splitting axis when performing the filtering and sorting operation using the second filtering and sorting operator. The second non-target axis outer layer data block can be obtained by dividing the tensor data to be processed along the non-target splitting axis when performing the filtering and sorting operation using the second filtering and sorting operator. Non-target axis head overhead can be the basic upfront overhead generated by task initialization, thread scheduling, hierarchical reduction and synchronization waiting during the multi-threaded parallel processing and reduction merging process of the second filtering sorting operator.

[0079] Specifically, when the filtering and sorting operator includes a second filtering and sorting operator, when determining the block performance overhead parameters of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters, target split axis, non-target split axis, and target selection quantity of the tensor data to be processed by each filtering and sorting operator, the measured performance data collected by the second filtering and sorting operator during the actual execution of the filtering and sorting operation process on the target device, combined with the theoretical performance data derived under the corresponding operation scenario, can be used to accurately calibrate and determine the transport bandwidth coefficient and sorting coefficient through data fitting, error correction, and normalization conversion. Simultaneously, a K-round decay mechanism can be introduced to dynamically correct the multi-round data selection process. When performing subsequent rounds of data selection operations, elements that have already been filtered and selected will be set to invalid values, such as -inf, and will no longer participate in subsequent rounds of comparison operations, resulting in a progressively decreasing number of elements effectively participating in the comparison and a continuous decrease in the actual comparison quantity. Based on this, the variable decay coefficient can be quantitatively determined according to the changing patterns of the selected iterative comparison rounds and the decay magnitude of the effective comparison quantity. This corrects the theoretical computational overhead in the multi-round iteration process and improves the accuracy of the performance modeling of the screening and ranking operator. For example, the variable decay coefficient can be calculated based on the following formula: ; in, Let be the variable decay coefficient for the i-th round of screening. Select the quantity for the target.

[0080] Furthermore, the tensor data to be processed can be divided into blocks along both the target split axis and the non-target split axis according to the data segmentation granularity and data block size. This results in multiple inner-layer data blocks along the second target axis and multiple outer-layer data blocks along the second non-target axis, forming a nested data block structure of inner target axis blocks and outer non-target axis blocks. Based on this, the number of elements and blocks in the inner-layer data blocks along the second target axis, as well as the number of blocks in the outer-layer data blocks along the second non-target axis, can be determined. Based on this, the logarithmic non-target axis head overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated according to the number of blocks in the outer-layer data blocks along the second non-target axis.

[0081] The data parallel configuration parameters and the block performance overhead parameters are used as the associated parameters for performance overhead calculation.

[0082] S440. Determine the data transfer overhead and result write-back overhead when the second filtering and sorting operator performs the filtering and sorting operation based on the transfer bandwidth coefficient and the total data volume of the tensor data to be processed.

[0083] The data transfer overhead can be the performance overhead incurred during the loading and writing of the tensor data to be processed into on-chip memory for the filtering and sorting operators to perform operations. The result write-back overhead can be the performance overhead incurred during the process of writing the output results back to the corresponding storage location after the filtering and sorting operations are completed by the second filtering and sorting operator and the output results are obtained.

[0084] Specifically, after determining the performance overhead calculation parameters of the second filtering and sorting operator, the data transport overhead and result write-back overhead during the filtering and sorting operation of the second filtering and sorting operator can be calculated based on whether the tensor data to be processed needs to be transposed, combined with the transport bandwidth coefficient and the total amount of tensor data to be processed.

[0085] In a specific example, the data transfer overhead in a scenario where the tensor data to be processed requires dimensionality transposition can be calculated based on the following formula: ; in, The data transfer overhead when performing the filtering and sorting operation for the second filtering and sorting operator. The total amount of tensor data to be processed. This refers to the bandwidth factor for scenarios requiring dimensional transposition.

[0086] The data transfer overhead in scenarios where the tensor data to be processed does not require dimension transposition can be calculated based on the following formula: ; in, This is the bandwidth factor for scenarios where dimensionality transposition is not required.

[0087] The write-back cost for scenarios where dimensionality transpose is required in the tensor data to be processed can be calculated using the following formula:

[0088] in, The overhead of writing back the results for scenarios where dimensionality transpose is required for tensor data to be processed. This refers to the total amount of data used to complete the filtering and sorting operation through the second filtering and sorting operator to obtain the output results.

[0089] It should be noted that in scenarios where the tensor data to be processed does not require dimension transposition, the overhead of writing back the result is zero.

[0090] S450. Calculate the single data selection overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, based on the number of elements in the inner layer data block of the second target axis, the number of loop expansions, and the sorting coefficient.

[0091] Among them, the single data selection overhead can be the performance overhead incurred by the second filtering and sorting operator when selecting a single element data within a single data block when performing filtering and sorting operations on the tensor data to be processed on the target device.

[0092] Specifically, after determining the performance overhead calculation parameters of the second filtering and sorting operator, the performance overhead of selecting a single element data within a single data block when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed on the target device can also be calculated based on the number of elements in the inner layer data block of the second target axis, the number of calculation loop expansions, and the sorting coefficient.

[0093] In a specific example, the single-data selection cost when the second filtering and sorting operator performs a filtering and sorting operation on the tensor data to be processed can be calculated based on the following formula: ; in, The single-data selection cost for the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. The number of elements in the inner layer data block for the second target axis represents the size of the data fragment in a single sorting operation. To calculate the number of loop unrollings, This is the ranking coefficient.

[0094] It should be noted that for the last data block, the actual amount of remaining data can be used instead of the fixed value of data fragments processed in a single operation, thereby avoiding the overestimation of the tail block overhead.

[0095] S460. Calculate the total cost of selecting target batch data when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the single data selection cost, the target selection quantity, and the variable decay coefficient.

[0096] The total overhead of selecting the target batch of data can be the overall selection performance overhead generated when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed on the target device to complete the filtering and extraction of the target selection quantity K data.

[0097] Specifically, after determining the performance overhead calculation parameters of the second filtering and sorting operator, the overall selection performance overhead generated by the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device, i.e., the total overhead of selecting the target batch of data, can also be calculated based on the single data selection overhead, the target selection quantity, and the variable decay coefficient.

[0098] In a specific example, the total cost of selecting the target batch of data when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The total cost of selecting target batch data when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0099] S470. Based on the number of blocks in the inner layer data block of the second target axis, the total overhead of selecting the target batch data, the number of blocks in the outer layer data block of the second non-target axis, and the overhead of the non-target axis head, calculate the total overhead of sorting calculation when the second filtering and sorting operator performs filtering and sorting operation on the tensor data to be processed.

[0100] The total overhead of sorting computation can be the computational overhead incurred by the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device, specifically the filtering and sorting processing of each data block of the tensor data to be processed.

[0101] Specifically, after determining the performance overhead calculation correlation parameters of the second filtering and sorting operator, the computational overhead generated by the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device can also be calculated based on the number of blocks of the inner layer data block of the second target axis, the total overhead of selecting the target batch data, the number of blocks of the outer layer data block of the second non-target axis, and the non-target axis head overhead.

[0102] In a specific example, the total computational cost of sorting when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, This represents the total computational cost of sorting when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. The number of blocks for dividing the inner layer data of the second target axis. The number of blocks for the second non-target axis outer layer data block. This is the overhead for non-target axial head.

[0103] S480. Generate an overall performance overhead model for the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, based on the data transport overhead, the result write-back overhead, and the total sorting calculation overhead.

[0104] Specifically, after obtaining the data transfer overhead, result write-back overhead, and total sorting computation overhead through the above steps, the sum of these three overheads can be calculated as the overall performance overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. Based on this, an overall performance overhead model adapted to the operational logic of the second filtering and sorting operator and the block processing characteristics of the tensor data to be processed can be generated by combining the above parameters. This allows for accurate modeling and quantitative evaluation of the overall computation time and performance loss during the execution of the second filtering and sorting operator.

[0105] The above scheme employs a nested computation approach combining batch processing and target split axis segmentation. Simultaneously, an outer loop segments the non-target split axis to simulate the serial correlation characteristics of the data along the non-target split axis. The overall overhead scales linearly along the non-target split axis dimension, with an additional logarithmic header overhead to characterize the performance loss caused by multiple rounds of off-chip memory access.

[0106] In a specific example, the overall performance overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The overall performance overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed.

[0107] This invention, in its embodiments, determines the data parallel configuration parameters of each filtering and sorting operator for the tensor data to be processed based on the hardware resource parameters of the target device, and determines the target split axis, non-target split axis, and target selection quantity for each filtering and sorting operator based on the operator configuration parameters of each filtering and sorting operator for the tensor data to be processed. Further, it determines the block performance overhead parameters for each filtering and sorting operator for the data blocks of the tensor data to be processed based on the data parallel configuration parameters, target split axis, non-target split axis, and target selection quantity of each filtering and sorting operator for the tensor data to be processed, and then uses the data parallel configuration parameters and block performance overhead parameters as performance overhead calculation correlation parameters. After determining the performance overhead calculation correlation parameters, it determines the data transport overhead and result write-back overhead when the second filtering and sorting operator performs the filtering and sorting operation based on the transport bandwidth coefficient and the total data volume of the tensor data to be processed. Simultaneously, it calculates the single data selection overhead when the second filtering and sorting operator performs the filtering and sorting operation on the tensor data to be processed based on the number of elements in the inner data block of the second target axis, the number of calculation loop unrolling times, and the sorting coefficient. Based on this, the total cost of selecting target batch data when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed is calculated according to the single data selection cost, the number of target selections, and the variable decay coefficient. Furthermore, the total sorting computation cost when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed is calculated according to the number of blocks in the inner layer data segment of the second target axis, the total cost of selecting target batch data, the number of blocks in the outer layer data segment of the second non-target axis, and the non-target axis head cost. Further, an overall performance cost model of the second filtering and sorting operator performing filtering and sorting operations on the tensor data to be processed is generated based on the data transport cost, result write-back cost, and total sorting computation cost. The above solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptability. It can accurately simulate the performance cost of various filtering and sorting operators during operation by constructing a performance cost model, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators during data processing.

[0108] Example 5 Figure 5 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment 5 of the present invention. This embodiment is based on the above embodiment and is further specified. In this embodiment, when the filtering and sorting operator includes a third filtering and sorting operator, a specific optional implementation method is given for generating the performance overhead model of each filtering and sorting operator by calculating the correlation parameters according to the performance overhead of each filtering and sorting operator. Correspondingly, as Figure 3 As shown, the method in this embodiment may include: S510. Determine the data parallel configuration parameters of the tensor data to be processed by each of the filtering and sorting operators based on the hardware resource parameters of the target device.

[0109] In an optional embodiment of the present invention, determining the data parallel configuration parameters of the tensor data to be processed for each of the filtering and sorting operators based on the hardware resource parameters of the target device may include: determining the maximum element capacity and the number of calculation loop unrolling times for each thread in the target device based on the hardware resource parameters of the target device; and determining the data segmentation granularity and data block size of the tensor data to be processed based on the maximum element capacity of each thread in the target device.

[0110] S520. Determine the target split axis, non-target split axis, and target selection quantity for the tensor data to be processed by each of the filtering and sorting operators according to the operator configuration parameters of each of the filtering and sorting operators.

[0111] S530. Determine the block performance overhead parameters of each filtering and sorting operator for the data block of the tensor data to be processed based on the data parallel configuration parameters of each filtering and sorting operator, the target split axis, the non-target split axis, and the number of target selections for the tensor data to be processed.

[0112] In an optional embodiment of the present invention, the filtering and sorting operator includes a third filtering and sorting operator. The step of determining the block performance overhead parameters of each filtering and sorting operator for data block partitioning of the tensor data to be processed, based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections, may include: partitioning the tensor data to be processed along the non-target split axis according to the data partitioning granularity and the data block size to obtain multiple third non-target axis outer layer data blocks; determining the number of blocks in the third non-target axis outer layer data blocks; and determining the measured clock cycle data table and nonlinear fitting correction coefficients of the third filtering and sorting operator when performing the filtering and sorting operation on the target device.

[0113] The third filtering and sorting operator can be a cardinality selection operator. The third non-target axis outer data block can be obtained by dividing the tensor data to be processed along the non-target splitting axis during the filtering and sorting operation using the third filtering and sorting operator. The measured clock cycle data table can be a structured data table formed by measuring the hardware clock cycles consumed by the complete execution process of the third filtering and sorting operator on the target device for different amounts of tensor data to be processed, and then summarizing the data. The nonlinear fitting correction coefficient can be a correction parameter used to characterize the nonlinear effect of the target selection quantity K on the cardinality sorting traversal rounds.

[0114] Specifically, when the filtering and sorting operator includes a third filtering and sorting operator, when determining the block performance overhead parameters for data segmentation of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections, the tensor data to be processed can be segmented along the non-target split axis according to the data segmentation granularity and data block size, resulting in multiple third non-target axis outer layer data blocks, and the number of blocks in the third non-target axis outer layer data blocks can be determined. It can be understood that when performing filtering and sorting operations using the third filtering and sorting operator, it is not necessary to segment the tensor data to be processed along the target split axis; instead, the data elements of the tensor data to be processed on the target split axis are treated as a single complete data block. Simultaneously, different sizes of tensor data to be processed can be configured for the third filtering and sorting operator on the target device, and filtering and sorting operations can be performed. The hardware clock cycles consumed by the operator under various operating conditions can be collected, and a corresponding clock cycle measured data table can be compiled accordingly. Furthermore, the measured sample data can be compared and fitted with the theoretical cost model to obtain the nonlinear fitting correction coefficients that adapt to the characteristics of the operator's operation. This provides reliable parameters and data support for subsequent performance cost model correction and accurate evaluation. For example, when the number of elements in the tensor data to be processed on the target split axis is less than or equal to 50,000 and the number of target selections is greater than 64, the nonlinear fitting correction coefficient can be 3; when the number of elements in the tensor data to be processed on the target split axis is less than or equal to 50,000 and the number of target selections is less than or equal to 64, the nonlinear fitting correction coefficient can be 2. The cardinality selection is not sensitive to the number of target selections in large data scenarios. Therefore, when the number of elements in the tensor data to be processed on the target split axis is greater than 50,000, the nonlinear fitting correction coefficient can be 1. This embodiment of the invention does not limit the specific value of the nonlinear fitting correction coefficient.

[0115] In a specific example, suppose the number of elements of the tensor data to be processed corresponding to the clock cycle measured data table on the target split axis are as follows: ; The clock cycles consumed under the corresponding operating condition can be: ; It should be noted that the clock cycle measurement data table was obtained when the number of targets selected was 1.

[0116] The data parallel configuration parameters and the block performance overhead parameters are used as the associated parameters for performance overhead calculation.

[0117] S540. Based on the number of elements of the tensor data to be processed on the target split axis, query the clock cycle measured data table to obtain the single cardinality selection cost when the third filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0118] Among them, the single cardinality selection overhead can be the performance overhead generated by completing a single round of cardinality selection processing and realizing the single element screening and classification process through the third filtering and sorting operator.

[0119] Specifically, after determining the performance overhead calculation parameters of the third filtering and sorting operator, the clock cycle measured data table can be queried based on the number of elements in the tensor data to be processed on the target split axis, and the two sampling data points closest to that number of elements can be selected. By performing linear interpolation on the two adjacent sampling points, the single cardinality selection overhead corresponding to the third filtering and sorting operator performing the filtering and sorting operation on the tensor data to be processed can be obtained. The above scheme uses a combination of measured point marking and piecewise linear interpolation to replace the traditional analytical formula modeling, which can adapt to the complex coupling characteristics of the instruction pipeline caused by histogram statistics and shrinkage range adjustment in the cardinality selection algorithm, and avoid the problem that it is difficult to accurately model through theoretical analytical formulas.

[0120] S550. Generate the overall performance overhead model of the third filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, based on the number of blocks of the third non-target axis outer layer data block, the single cardinality selection overhead, and the nonlinear fitting correction coefficient.

[0121] Accordingly, after obtaining the single cardinality selection cost of the third filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, the overall performance cost of the third filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the number of blocks in the outer layer data of the third non-target axis, the single cardinality selection cost, and the nonlinear fitting correction coefficient. Based on this, an overall performance cost model adapted to the operational logic of the third filtering and sorting operator and the block processing characteristics of the tensor data to be processed can be generated by combining the above parameters, thereby achieving accurate modeling and quantitative evaluation of the overall computation time and performance loss during the execution of the third filtering and sorting operator.

[0122] In a specific example, the overall performance overhead of the third filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The overall performance overhead of the third filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. Cost selection for a single cardinality The number of blocks for the third non-target axis outer layer data block. These are the correction coefficients for nonlinear fitting.

[0123] This invention, in its embodiments, determines the data parallel configuration parameters of each filtering and sorting operator for the tensor data to be processed based on the hardware resource parameters of the target device, and determines the target split axis, non-target split axis, and target selection quantity for each filtering and sorting operator based on the operator configuration parameters of each filtering and sorting operator. Further, it determines the block performance overhead parameters for each filtering and sorting operator's data segmentation of the tensor data to be processed based on the data parallel configuration parameters, target split axis, non-target split axis, and target selection quantity of each filtering and sorting operator, and then uses the data parallel configuration parameters and block performance overhead parameters as performance overhead calculation correlation parameters. After determining the performance overhead calculation correlation parameters, it queries the clock cycle measured data table based on the number of elements in the tensor data to be processed on the target split axis to obtain the single cardinality selection overhead when the third filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. Further, it generates an overall performance overhead model for the third filtering and sorting operator's filtering and sorting operations on the tensor data to be processed based on the number of blocks in the outer layer data segmentation of the third non-target axis, the single cardinality selection overhead, and the nonlinear fitting correction coefficient. The above solution addresses the shortcomings of existing screening and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptation capabilities. It can accurately simulate the performance overhead of various screening and sorting operators during operation by constructing a performance overhead model of the screening and sorting operators, and achieve adaptive selection of the optimal screening and sorting operators during task scheduling, thereby effectively improving the overall computational efficiency of screening and sorting operators in data processing.

[0124] Example 6 Figure 6 This is a flowchart of a performance overhead model processing method for a filtering and sorting operator provided in Embodiment Six of the present invention. This embodiment is based on the above embodiment and is further specified. In this embodiment, when the filtering and sorting operator includes a fourth filtering and sorting operator, a specific optional implementation method is given for generating the performance overhead model of each filtering and sorting operator by calculating the correlation parameters according to the performance overhead of each filtering and sorting operator. Correspondingly, as Figure 6 As shown, the method in this embodiment may include: S610. Determine the data parallel configuration parameters of the tensor data to be processed by each of the filtering and sorting operators based on the hardware resource parameters of the target device.

[0125] In an optional embodiment of the present invention, determining the data parallel configuration parameters of the tensor data to be processed for each of the filtering and sorting operators based on the hardware resource parameters of the target device may include: determining the maximum element capacity and the number of calculation loop unrolling times for each thread in the target device based on the hardware resource parameters of the target device; and determining the data segmentation granularity and data block size of the tensor data to be processed based on the maximum element capacity of each thread in the target device.

[0126] S620. Determine the target split axis, non-target split axis, and target selection quantity for the tensor data to be processed by each of the filtering and sorting operators according to the operator configuration parameters of each of the filtering and sorting operators.

[0127] S630. Determine the block performance overhead parameters of each filtering and sorting operator for the data block of the tensor data to be processed based on the data parallel configuration parameters of each filtering and sorting operator, the target split axis, the non-target split axis, and the number of target selections for the tensor data to be processed.

[0128] In an optional embodiment of the present invention, the filtering and sorting operator includes a fourth filtering and sorting operator. The step of determining the block performance overhead parameters of each filtering and sorting operator for data block partitioning of the tensor data to be processed, based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the target selection quantity, may include: partitioning the tensor data to be processed along the target split axis and the non-target split axis according to the data partitioning granularity and the data block size, respectively, to obtain multiple fourth target axis inner-layer data blocks and multiple fourth non-target axis outer-layer data blocks; determining the number of elements and the number of blocks in the fourth target axis inner-layer data blocks, and determining the number of blocks in the fourth non-target axis outer-layer data blocks; determining the effective heap capacity of the target heap based on the target selection quantity; and determining the single-level node comparison overhead and the single-thread reduction overhead of the fourth filtering and sorting operator when performing the filtering and sorting operation on the target device.

[0129] The fourth filtering and sorting operator can be a heap sort operator. When performing the filtering and sorting operation along the target axis, the inner data blocks are obtained by dividing the tensor data to be processed along the target split axis. Similarly, when performing the filtering and sorting operation along the non-target axis, the outer data blocks are obtained by dividing the tensor data to be processed along the non-target split axis. The effective heap capacity of the target heap can be the element capacity that the target heap generated by calling the fourth filtering and sorting operator can hold. The single-level node comparison overhead can be the computational overhead incurred when comparing the size of the parent node with its left and right child nodes and adjusting the position of the parent node during the filtering and sorting operation. The single-thread reduction overhead can be the computational overhead incurred when performing a single-thread heap adjustment process during the filtering and sorting operation.

[0130] Specifically, when the filtering and sorting operator includes a fourth filtering and sorting operator, when determining the block performance overhead parameters for data block division of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections, the tensor data to be processed can be divided into blocks along both the target split axis and the non-target split axis according to the data splitting granularity and the data block size. This results in multiple inner-layer data blocks along the fourth target axis and multiple outer-layer data blocks along the fourth non-target axis, forming a nested data block structure of inner-layer target axis blocks and outer-layer non-target axis blocks. Based on this, the number of elements and the number of blocks in the inner-layer data blocks along the fourth target axis, as well as the number of blocks in the outer-layer data blocks along the fourth non-target axis, can be determined. Simultaneously, a target heap corresponding to the fourth filtering and sorting operator can be generated based on the number of target selections, and the effective heap capacity of this target heap can be determined. For example, the effective heap capacity of the target heap can be a value not less than the least power of 2 of K minus 1. In addition, based on actual hardware operation test data, the single-level node comparison overhead and single-thread reduction overhead corresponding to the fourth screening and sorting operator deployed in the target device operating environment and executing the screening and sorting business process can be statistically calibrated, so as to accurately quantify the node comparison operation cost and the performance overhead of a single adjustment of the heap structure of the fourth screening and sorting operator under the actual hardware architecture.

[0131] The data parallel configuration parameters and the block performance overhead parameters are used as the associated parameters for performance overhead calculation.

[0132] S640. Calculate the initial heap construction cost when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the effective heap carrying capacity.

[0133] The initial heap construction overhead can be the overall computational overhead incurred when loading the data required to build the target heap and adjusting the unordered array of elements into a valid heap structure that conforms to the heap order rules during the filtering and sorting operation by calling the fourth filtering and sorting operator.

[0134] Specifically, after determining the performance overhead calculation parameters of the fourth filtering and sorting operator, the overall computational overhead generated by the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, including loading the data required to build the target heap and adjusting the unordered array of elements into a legal heap structure that conforms to the heap order rules, can be calculated based on the effective heap capacity. This overhead is the initial heap construction overhead. This is to simulate the initialization and heap adjustment processes during heap construction.

[0135] S650. Calculate the single-time heap adjustment cost when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the effective heap carrying capacity and the single-level node comparison cost.

[0136] Among them, the single heap adjustment cost can be the maximum computational cost generated when the fourth filtering sorting operator is called to perform the filtering sorting operation and complete a full heap sorting process.

[0137] Specifically, after determining the performance overhead calculation parameters of the fourth filtering sorting operator, the maximum computational overhead generated when calling the fourth filtering sorting operator to perform a complete heap sorting operation, i.e., the single heap adjustment overhead, can also be calculated based on the effective heap carrying capacity and the single-level node comparison overhead.

[0138] In a specific example, the single heap adjustment cost of the fourth filter sort operator when performing a filter sort operation on the tensor data to be processed can be calculated based on the following formula: ; in, The cost of a single heap adjustment when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. For the effective load-bearing capacity of the stack, The depth of the target heap, The overhead is for comparing nodes at a single level.

[0139] S660. Calculate the single data block heap adjustment cost when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the single heap adjustment cost and the number of elements in the inner layer data block of the fourth target axis.

[0140] Among them, the single data block heap adjustment overhead can be the maximum computational overhead generated when performing heap filtering and heap order adjustment on a single data block when calling the fourth filtering and sorting operator to perform filtering and sorting operations.

[0141] Specifically, after determining the correlation parameters for the single heap adjustment cost and the performance cost of the fourth filtering and sorting operator, the maximum computational cost generated by heap filtering and heap order adjustment of a single data block when calling the fourth filtering and sorting operator to perform filtering and sorting operations can also be calculated based on the single heap adjustment cost and the number of elements in the inner layer data block of the fourth target axis. That is, the single data block heap adjustment cost.

[0142] In a specific example, the single-block heap adjustment cost of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The single-block heap adjustment overhead for the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. The number of elements in the inner layer data block for the fourth target axis.

[0143] S670. Calculate the thread-in-heap maintenance overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the number of blocks in the fourth non-target axis outer layer data block, the number of blocks in the fourth target axis inner layer data block, the single data block heap adjustment overhead, and the initial heap building overhead.

[0144] Among them, the in-thread heap maintenance overhead can be the maximum computational overhead generated by heap filtering and heap order adjustment for each data block within a single thread when the fourth filtering and sorting operator is called to perform filtering and sorting operations.

[0145] Specifically, after determining the correlation parameters for single data block heap adjustment overhead, initial heap construction overhead, and the performance overhead of the fourth filtering and sorting operator, the number of blocks in the fourth non-target axis outer layer data block and the number of blocks in the fourth target axis inner layer data block can be calculated based on the correlation parameters for performance overhead. The maximum computational overhead generated by heap filtering and heap order adjustment for each data block within a single thread when calling the fourth filtering and sorting operator to perform filtering and sorting operations is calculated based on the single data block heap adjustment overhead and initial heap construction overhead. That is, the in-thread heap maintenance overhead.

[0146] In a specific example, the thread heap maintenance overhead of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The thread-level heap maintenance overhead for the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. The number of blocks for the fourth non-target axis outer layer data block. The number of blocks for dividing the inner layer data of the fourth target axis.

[0147] S680. Based on the number of local blocks of the fourth non-target axis outer layer data block corresponding to each thread, the number of local blocks of the fourth target axis inner layer data block corresponding to each thread, the effective carrying capacity of the heap, and the single-thread reduction overhead, calculate the total cross-thread reduction overhead when the fourth filtering and sorting operator performs filtering and sorting operation on the tensor data to be processed.

[0148] The total overhead of cross-thread reduction can be the computational overhead incurred when merging and reducing the target heaps corresponding to each thread in the target device during the filtering and sorting operation by calling the fourth filtering and sorting operator. The number of local blocks can be the number of fourth non-target axis outer layer data blocks or fourth target axis inner layer data blocks processed by each thread.

[0149] In this embodiment of the invention, a binary merge strategy can be used to merge and reduce the target heaps corresponding to each thread until global normalization is completed. Specifically, the processing overhead of each round of heap merging and reduction can be calculated iteratively and cumulatively based on the number of local blocks in the outer layer of the fourth non-target axis data block corresponding to each thread, the number of local blocks in the inner layer of the fourth target axis data block corresponding to each thread, the effective heap carrying capacity, and the reduction overhead between threads in a single operation, thereby accurately simulating the execution process of tree-shaped reduction.

[0150] In a specific example, the processing overhead for each round of heap merging and reduction can be calculated based on the following formula: ; in, For the processing overhead of each round of heap merging and reduction, The number of local blocks for the fourth non-target axis outer layer data block corresponding to each thread. The number of local blocks for the inner layer data of the fourth target axis corresponding to each thread. For the effective load-bearing capacity of the stack, This is the overhead of a single thread-to-thread reduction.

[0151] S690. Calculate the global aggregated heap sorting overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the effective heap carrying capacity and the single heap adjustment overhead.

[0152] Among them, the global aggregate heap sorting overhead can be the maximum computational overhead generated when sorting the global aggregate heap obtained after cross-thread reduction during the fourth filtering sorting operator's filtering sorting operation.

[0153] Specifically, after performing a cross-thread reduction operation by calling the fourth filtering and sorting operator, a global aggregate heap can be obtained. Based on this, the maximum computational overhead of sorting the global aggregate heap by calling the fourth filtering and sorting operator can be calculated, i.e., the global aggregate heap sorting overhead.

[0154] In a specific example, the global aggregate heap sort overhead of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The global aggregate heap sort overhead for the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. For the effective load-bearing capacity of the stack, This reduces the overhead of single-time heap adjustment.

[0155] S6100. Generate the overall performance overhead model of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed, based on the thread-in-thread heap maintenance overhead, the cross-thread reduction total overhead, and the global aggregate heap sorting overhead.

[0156] Accordingly, after obtaining the in-thread heap maintenance overhead, cross-thread reduction total overhead, and global aggregated heap sorting overhead through the above steps, the sum of these three overheads can be calculated as the overall performance overhead of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. Based on this, an overall performance overhead model adapted to the fourth filtering and sorting operator's operational logic and the block processing characteristics of the tensor data to be processed can be generated by combining the above parameters, thereby achieving accurate modeling and quantitative evaluation of the overall computation time and performance loss during the execution of the fourth filtering and sorting operator.

[0157] In a specific example, the overall performance overhead of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed can be calculated based on the following formula: ; in, The overall performance overhead of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed. For the rounds of cross-thread reduction, This represents the total overhead of cross-thread reduction.

[0158] This invention, in its embodiments, determines the data parallel configuration parameters of each filtering and sorting operator for the tensor data to be processed based on the hardware resource parameters of the target device, and determines the target split axis, non-target split axis, and target selection quantity for each filtering and sorting operator based on the operator configuration parameters of each filtering and sorting operator for the tensor data to be processed. Further, it determines the block performance overhead parameters for each filtering and sorting operator's data segmentation of the tensor data to be processed based on the data parallel configuration parameters, target split axis, non-target split axis, and target selection quantity of each filtering and sorting operator, and then uses the data parallel configuration parameters and block performance overhead parameters as performance overhead calculation correlation parameters. After determining the performance overhead calculation correlation parameters, it calculates the initial heap construction overhead when the fourth filtering and sorting operator performs the filtering and sorting operation on the tensor data to be processed based on the effective heap capacity. Simultaneously, it calculates the single heap adjustment overhead when the fourth filtering and sorting operator performs the filtering and sorting operation on the tensor data to be processed based on the effective heap capacity and single-level node comparison overhead. Furthermore, the single-block heap adjustment cost of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the single heap adjustment cost and the number of elements in the inner layer data block of the fourth target axis. Furthermore, the thread-internal heap maintenance cost of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the number of blocks in the outer layer data block of the fourth non-target axis, the number of blocks in the inner layer data block of the fourth target axis, the single-block heap adjustment cost, and the initial heap construction cost. Based on this, the total cross-thread reduction cost of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the number of local blocks in the outer layer data block of the fourth non-target axis corresponding to each thread, the number of local blocks in the inner layer data block of the fourth target axis corresponding to each thread, the effective heap capacity, and the single-thread reduction cost. Furthermore, the global aggregate heap sorting cost of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the effective heap capacity and the single heap adjustment cost. Based on this, a fourth filtering and sorting operator is generated to perform filtering and sorting operations on the tensor data under processing, according to the in-thread heap maintenance overhead, cross-thread reduction total overhead, and global aggregate heap sorting overhead. This solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptation capabilities. By constructing a performance overhead model for filtering and sorting operators, it accurately simulates the performance overhead of various filtering and sorting operators during operation, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators in data processing.

[0159] Example 7 Figure 7This is a flowchart of a data processing method based on filtering and sorting operators provided in Embodiment 7 of the present invention. This embodiment is applicable to calculating the overall performance cost of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed using the performance cost model of each filtering and sorting operator, and determining the optimal filtering and sorting operator based on the overall performance cost. This method can be executed by a data processing device based on filtering and sorting operators. This device can be implemented by software and / or hardware, and is generally integrated into an electronic device. The electronic device can be a terminal device or a server device, as long as it can execute the data processing method based on filtering and sorting operators. The embodiments of the present invention do not limit the specific device type of the electronic device. Accordingly, as... Figure 1 As shown, the method includes the following operations: S710. Calculate the overall performance cost of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device by calling the performance cost model of multiple filtering and sorting operators.

[0160] In this embodiment of the invention, the performance overhead model of the filtering and sorting operator generated by the performance overhead model processing method of the filtering and sorting operator described in any embodiment of the invention can be invoked to calculate the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device.

[0161] Optionally, before calling the performance overhead model of multiple filtering and sorting operators to calculate the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device, if it is determined that the tensor data to be processed has excessive dimensions or belongs to a one-dimensional small-volume data scenario, the corresponding filtering and sorting operator can be directly selected and returned without entering the subsequent overhead evaluation process.

[0162] S720. Filter the target filtering and sorting operators based on the overall performance overhead of performing filtering and sorting operations on the tensor data to be processed according to each of the filtering and sorting operators.

[0163] Among them, the target filtering and sorting operator can be the filtering and sorting operator with the minimum overall performance cost among all filtering and sorting operators.

[0164] Accordingly, after obtaining the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device, the filtering and sorting operator with the smallest overall performance overhead can be selected as the target filtering and sorting operator.

[0165] S730. The tensor data to be processed is filtered and sorted using the target filtering and sorting operator.

[0166] Accordingly, after determining the target filtering and sorting operator, the selected target filtering and sorting operator can be used to filter and sort the tensor data to be processed.

[0167] This invention calculates the overall performance overhead of each filtering and sorting operator on the target device when performing filtering and sorting operations on the tensor data to be processed by calling performance overhead models of multiple filtering and sorting operators. Then, it selects a target filtering and sorting operator based on the overall performance overhead of each operator. On this basis, the target filtering and sorting operator is used to perform filtering and sorting processing on the tensor data to be processed. This solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptation capabilities. It can accurately simulate the performance overhead of various filtering and sorting operators during operation by constructing performance overhead models, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators during data processing.

[0168] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information in this technical solution comply with relevant laws and regulations and do not violate public order and good morals.

[0169] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant regions.

[0170] It should be noted that any arrangement or combination of the technical features in the above embodiments also falls within the protection scope of this invention.

[0171] Example 8 Figure 8 This is a schematic diagram of a performance overhead model processing device for a screening and sorting operator provided in Embodiment 8 of the present invention, as shown below. Figure 8 As shown, the device includes: a performance overhead calculation correlation parameter determination module 810 and a performance overhead model generation module 820, wherein: The performance overhead calculation correlation parameter determination module 810 is used to determine the performance overhead calculation correlation parameters of each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator.

[0172] The performance overhead model generation module 820 is used to generate the performance overhead model of each of the filtering and sorting operators by calculating the associated parameters based on the performance overhead of each filtering and sorting operator.

[0173] This invention determines the performance overhead calculation parameters for each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator. Then, it generates a performance overhead model for each filtering and sorting operator based on these parameters. This solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptability. By constructing a performance overhead model for filtering and sorting operators, it accurately simulates the performance overhead of various filtering and sorting operators during operation, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators in data processing.

[0174] Optionally, the performance overhead calculation correlation parameter determination module 810 is specifically used for: determining the data parallel configuration parameters of each of the filtering and sorting operators for the tensor data to be processed based on the hardware resource parameters of the target device; determining the target split axis, non-target split axis, and target selection quantity of each of the filtering and sorting operators for the tensor data to be processed based on the operator configuration parameters of each of the filtering and sorting operators; determining the block performance overhead parameters of each of the filtering and sorting operators for the data blocks of the tensor data to be processed based on the data parallel configuration parameters, target split axis, non-target split axis, and target selection quantity of each of the filtering and sorting operators; and using the data parallel configuration parameters and the block performance overhead parameters as the performance overhead calculation correlation parameters.

[0175] Optionally, the performance overhead calculation association parameter determination module 810 is further configured to: determine the maximum element capacity of each thread in the target device and the number of loop unrolling operations based on the hardware resource parameters of the target device; and determine the data segmentation granularity and data block size of the tensor data to be processed based on the maximum element capacity of each thread in the target device.

[0176] Optionally, the filtering and sorting operator includes a first filtering and sorting operator, and the performance overhead calculation and correlation parameter determination module 810 is further configured to: divide the tensor data to be processed into blocks along the target splitting axis and the non-target splitting axis according to the data splitting granularity and the data block size, respectively, to obtain multiple first target axis inner layer data blocks and multiple first non-target axis outer layer data blocks; determine the number of elements and the number of blocks in the first target axis inner layer data blocks, and determine the number of blocks in the first non-target axis outer layer data blocks; determine the single element selection overhead, single reduction overhead, and utilization factor when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

[0177] Optionally, the performance overhead model generation module 820 is specifically used for: calculating the total cost of selecting a single data block when the first filtering and sorting operator performs a filtering and sorting operation on the tensor data to be processed, based on the target selection quantity, the number of calculation loops, the number of elements in the first target axis inner layer data block, and the single element selection cost; calculating the in-thread reduction cost when the first filtering and sorting operator performs a filtering and sorting operation on the tensor data to be processed, based on the target selection quantity, the number of calculation loops, the number of blocks in the first target axis inner layer data block, and the single reduction cost; and calculating the in-thread reduction cost based on the number of blocks in the first non-target axis outer layer data block, the total cost of selecting a single data block, and the single reduction cost. The total parallel thread computation overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the number of blocks in the outer layer data block of the first non-target axis, the number of target selections, the number of calculation loop expansions, the total number of threads in the target device, the single reduction overhead, and the utilization factor. The cross-thread reduction overhead of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the total single data block selection overhead, the intra-thread reduction overhead, the total parallel thread computation overhead, and the cross-thread reduction overhead.

[0178] Optionally, the filtering and sorting operator includes a second filtering and sorting operator. The performance overhead calculation and correlation parameter determination module 810 is further configured to: determine the transport bandwidth coefficient, sorting coefficient, and variable attenuation coefficient of the second filtering and sorting operator when performing filtering and sorting operations on the target device; divide the tensor data to be processed into blocks along the target split axis and the non-target split axis according to the data segmentation granularity and the data block size, respectively, to obtain multiple second target axis inner layer data blocks and multiple second non-target axis outer layer data blocks; determine the number of elements and the number of blocks in the second target axis inner layer data blocks, and determine the number of blocks in the second non-target axis outer layer data blocks; and determine the non-target axis head overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed according to the number of blocks in the second non-target axis outer layer data blocks.

[0179] Optionally, the performance overhead model generation module 820 is further configured to: determine the data transport overhead and result write-back overhead when the second filtering and sorting operator performs the filtering and sorting operation based on the transport bandwidth coefficient and the total data volume of the tensor data to be processed; calculate the single data selection overhead when the second filtering and sorting operator performs the filtering and sorting operation on the tensor data to be processed based on the number of elements in the inner layer data block of the second target axis, the number of calculation loop expansions, and the sorting coefficient; calculate the total target batch data selection overhead when the second filtering and sorting operator performs the filtering and sorting operation on the tensor data to be processed based on the single data selection overhead, the target selection quantity, and the variable attenuation coefficient; calculate the total sorting calculation overhead when the second filtering and sorting operator performs the filtering and sorting operation on the tensor data to be processed based on the number of blocks in the inner layer data block of the second target axis, the total target batch data selection overhead, the number of blocks in the outer layer data block of the second non-target axis, and the non-target axis head overhead; and generate an overall performance overhead model when the second filtering and sorting operator performs the filtering and sorting operation on the tensor data to be processed based on the data transport overhead, the result write-back overhead, and the total sorting calculation overhead.

[0180] Optionally, the filtering and sorting operator includes a third filtering and sorting operator. The performance overhead calculation correlation parameter determination module 810 is further configured to: divide the tensor data to be processed into blocks along the non-target splitting axis according to the data segmentation granularity and the data block size to obtain multiple third non-target axis outer layer data blocks; determine the number of blocks of the third non-target axis outer layer data blocks; and determine the clock cycle measured data table and nonlinear fitting correction coefficient of the third filtering and sorting operator when the target device performs the filtering and sorting operation.

[0181] Optionally, the performance overhead model generation module 820 is further configured to: query the clock cycle measured data table based on the number of elements of the tensor data to be processed on the target split axis to obtain the single cardinality selection overhead when the third filtering and sorting operator performs filtering and sorting operation on the tensor data to be processed; and generate an overall performance overhead model when the third filtering and sorting operator performs filtering and sorting operation on the tensor data to be processed based on the number of blocks of the outer layer data blocks of the third non-target axis, the single cardinality selection overhead, and the nonlinear fitting correction coefficient.

[0182] Optionally, the filtering and sorting operator includes a fourth filtering and sorting operator. The performance overhead calculation and correlation parameter determination module 810 is further configured to: divide the tensor data to be processed into blocks along the target splitting axis and the non-target splitting axis according to the data segmentation granularity and the data block size, respectively, to obtain multiple fourth target axis inner layer data blocks and multiple fourth non-target axis outer layer data blocks; determine the number of elements and the number of blocks in the fourth target axis inner layer data blocks, and determine the number of blocks in the fourth non-target axis outer layer data blocks; determine the effective heap carrying capacity of the target heap according to the target selection quantity; and determine the single-level node comparison overhead and single-thread reduction overhead of the fourth filtering and sorting operator when performing filtering and sorting operations on the target device.

[0183] Optionally, the performance overhead model generation module 820 is further configured to: calculate the initial heap building overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed based on the effective heap capacity; calculate the single heap adjustment overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed based on the effective heap capacity and the single-level node comparison overhead; calculate the single data block heap adjustment overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed based on the single heap adjustment overhead and the number of elements in the fourth target axis inner layer data block; and calculate the single data block heap adjustment overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed based on the number of blocks in the fourth non-target axis outer layer data block, the number of blocks in the fourth target axis inner layer data block, the single data block heap adjustment overhead, and the initial heap building overhead. The following calculations are performed: First, the thread-level heap maintenance overhead during tensor data filtering and sorting operations. Second, the total cross-thread reduction overhead during tensor data filtering and sorting operations is calculated based on the number of local blocks in the fourth non-target axis outer layer data block corresponding to each thread, the number of local blocks in the fourth target axis inner layer data block corresponding to each thread, the effective heap capacity, and the single-thread reduction overhead. Third, the global aggregated heap sorting overhead during tensor data filtering and sorting operations is calculated based on the effective heap capacity and the single-threaded heap adjustment overhead. Finally, the overall performance overhead model during tensor data filtering and sorting operations is generated based on the thread-level heap maintenance overhead, the total cross-thread reduction overhead, and the global aggregated heap sorting overhead.

[0184] The above-described performance overhead model processing apparatus for the filtering and sorting operator can execute the performance overhead model processing method for the filtering and sorting operator provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment can be found in the performance overhead model processing method for the filtering and sorting operator provided in any embodiment of the present invention.

[0185] Since the performance overhead model processing device for the filtering and sorting operator described above is an apparatus capable of executing the performance overhead model processing method for the filtering and sorting operator in the embodiments of the present invention, those skilled in the art can understand the specific implementation methods and various variations of the performance overhead model processing device for the filtering and sorting operator in this embodiment based on the performance overhead model processing method for the filtering and sorting operator described in the embodiments of the present invention. Therefore, how the performance overhead model processing device for the filtering and sorting operator implements the performance overhead model processing method for the filtering and sorting operator in the embodiments of the present invention will not be described in detail here. Any apparatus used by those skilled in the art to implement the performance overhead model processing method for the filtering and sorting operator in the embodiments of the present invention falls within the scope of protection of this application.

[0186] Example 9 Figure 9 This is a schematic diagram of a data processing device based on a filtering and sorting operator provided in Embodiment 9 of the present invention, as shown below. Figure 9 As shown, the device includes: an overall performance overhead calculation module 910, a target filtering and sorting operator filtering module 920, and a filtering and sorting processing module 930, wherein: The overall performance overhead calculation module 910 is used to call the performance overhead model of multiple filtering and sorting operators to calculate the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device.

[0187] The target filtering and sorting operator filtering module 920 is used to filter target filtering and sorting operators based on the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed.

[0188] The filtering and sorting processing module 930 is used to perform filtering and sorting processing on the tensor data to be processed using the target filtering and sorting operator.

[0189] The performance overhead model of each of the filtering and sorting operators is generated by the performance overhead model processing method of the filtering and sorting operators described in any embodiment of the present invention.

[0190] This invention calculates the overall performance overhead of each filtering and sorting operator on the target device when performing filtering and sorting operations on the tensor data to be processed by calling performance overhead models of multiple filtering and sorting operators. Then, it selects a target filtering and sorting operator based on the overall performance overhead of each operator. On this basis, the target filtering and sorting operator is used to perform filtering and sorting processing on the tensor data to be processed. This solution addresses the shortcomings of existing filtering and sorting operator selection schemes, such as poor scenario adaptability, high resource consumption, and weak dynamic adaptation capabilities. It can accurately simulate the performance overhead of various filtering and sorting operators during operation by constructing performance overhead models, enabling adaptive selection of the optimal filtering and sorting operator during task scheduling, effectively improving the overall computational efficiency of filtering and sorting operators during data processing.

[0191] The data processing apparatus based on the filtering and sorting operator described above can execute the data processing method based on the filtering and sorting operator provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the data processing method based on the filtering and sorting operator provided in any embodiment of the present invention.

[0192] Since the data processing device based on the filtering and sorting operator described above is an apparatus capable of executing the data processing method based on the filtering and sorting operator in the embodiments of the present invention, those skilled in the art can understand the specific implementation and various variations of the data processing device based on the filtering and sorting operator in this embodiment based on the data processing method based on the filtering and sorting operator described in the embodiments of the present invention. Therefore, how the data processing device based on the filtering and sorting operator implements the data processing method based on the filtering and sorting operator in the embodiments of the present invention will not be described in detail here. Any apparatus used by those skilled in the art to implement the data processing method based on the filtering and sorting operator in the embodiments of the present invention falls within the scope of protection of this application.

[0193] Example 10 Figure 10 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0194] like Figure 10 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0195] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0196] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as performance overhead model processing methods based on sifting and sorting operators or data processing methods based on sifting and sorting operators.

[0197] In some embodiments, the performance overhead model processing method of the filtering and sorting operator or the data processing method based on the filtering and sorting operator can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the performance overhead model processing method of the filtering and sorting operator or the data processing method based on the filtering and sorting operator described above can be performed. Alternatively, in other embodiments, processor 11 can be configured by any other suitable means (e.g., by means of firmware) to execute the performance overhead model processing method of the filtering and sorting operator or the data processing method based on the filtering and sorting operator.

[0198] Optionally, the method for processing the performance overhead model of the filtering and sorting operators may include: determining the performance overhead calculation correlation parameters of each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator; and generating the performance overhead model of each filtering and sorting operator based on the performance overhead calculation correlation parameters of each filtering and sorting operator.

[0199] Optionally, the data processing method based on filtering and sorting operators may include: calling a performance overhead model of multiple filtering and sorting operators to calculate the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device; wherein, the performance overhead model of each filtering and sorting operator is generated by the performance overhead model processing method of filtering and sorting operators according to any embodiment of the present invention; selecting a target filtering and sorting operator according to the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed; and using the target filtering and sorting operator to perform filtering and sorting processing on the tensor data to be processed.

[0200] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0201] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0202] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0203] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0204] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0205] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0206] This application also discloses a computer program product, which includes a computer program that, when executed by a processor, implements the performance overhead model processing method for the filtering and sorting operator or the data processing method based on the filtering and sorting operator provided in any embodiment of this application. This program product belongs to the same inventive concept as the performance overhead model processing method for the filtering and sorting operator or the data processing method based on the filtering and sorting operator disclosed in the embodiments of this application, and therefore will not be described in detail here.

[0207] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0208] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for processing the performance overhead model of a screening and sorting operator, characterized in that, include: The performance overhead calculation correlation parameters of each filtering and sorting operator are determined based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator. Based on the performance overhead of each of the filtering and sorting operators, the associated parameters are calculated to generate the performance overhead model of each of the filtering and sorting operators. The step of determining the performance overhead calculation correlation parameters of each filtering and sorting operator based on the hardware resource parameters of the target device and the operator configuration parameters of each filtering and sorting operator includes: The data parallel configuration parameters for the tensor data to be processed by each of the filtering and sorting operators are determined based on the hardware resource parameters of the target device. The target split axis, non-target split axis, and target selection number of each of the filtering and sorting operators are determined for the tensor data to be processed based on the operator configuration parameters of each of the filtering and sorting operators. The block performance overhead parameters of each filtering and sorting operator for the data block of the tensor data to be processed are determined based on the data parallel configuration parameters of each filtering and sorting operator, the target split axis, the non-target split axis, and the number of target selections. The data parallel configuration parameters and the block performance overhead parameters are used as the associated parameters for performance overhead calculation.

2. The method according to claim 1, characterized in that, The step of determining the data parallel configuration parameters of the tensor data to be processed by each of the filtering and sorting operators based on the hardware resource parameters of the target device includes: Based on the hardware resource parameters of the target device, determine the maximum element capacity of each thread in the target device and calculate the number of loop unrolling operations; The data segmentation granularity and data block size of the tensor data to be processed are determined based on the maximum element capacity of each thread in the target device.

3. The method according to claim 2, characterized in that, The filtering and sorting operators include a first filtering and sorting operator. The step of determining the block performance overhead parameters for data partitioning of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections includes: The tensor data to be processed is divided into blocks along the target split axis and the non-target split axis according to the data segmentation granularity and the data block size, respectively, to obtain multiple inner layer data blocks along the first target axis and multiple outer layer data blocks along the first non-target axis; Determine the number of elements and the number of blocks in the first target axis inner layer data block, and determine the number of blocks in the first non-target axis outer layer data block; Determine the single-element selection cost, single-reduce cost, and utilization factor when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed.

4. The method according to claim 3, characterized in that, The step of generating a performance cost model for each of the filtering and sorting operators by calculating the correlation parameters based on the performance cost of each filtering and sorting operator includes: Based on the number of targets selected, the number of calculation loops expanded, the number of elements in the inner layer data block of the first target axis, and the single element selection cost, calculate the total single data block selection cost when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. Based on the number of targets selected, the number of calculation loops expanded, the number of blocks of the first target axis inner layer data block, and the single reduction cost, calculate the in-thread reduction cost when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. Based on the number of blocks in the first non-target axis outer layer data block, the total overhead of selecting a single data block, the in-thread reduction overhead, and the utilization factor, calculate the total parallel thread computation overhead when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. Based on the number of blocks in the first non-target axis outer layer data block, the number of targets selected, the number of calculation loop expansions, the total number of threads in the target device, the single reduction overhead, and the utilization factor, calculate the cross-thread reduction overhead when the first filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. The overall performance overhead model of the first filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is generated based on the total overhead of single data block selection, the intra-thread reduction overhead, the total overhead of parallel thread operation, and the cross-thread reduction overhead.

5. The method according to claim 2, characterized in that, The filtering and sorting operators include a second filtering and sorting operator. The step of determining the block performance overhead parameters for data partitioning of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections includes: Determine the transport bandwidth coefficient, sorting coefficient, and variable attenuation coefficient of the second screening and sorting operator when the target device performs a screening and sorting operation; The tensor data to be processed is divided into blocks along the target split axis and the non-target split axis according to the data segmentation granularity and the data block size, respectively, to obtain multiple inner layer data blocks along the second target axis and multiple outer layer data blocks along the second non-target axis; Determine the number of elements and the number of blocks in the inner layer data block of the second target axis, and determine the number of blocks in the outer layer data block of the second non-target axis; The non-target axis header overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is determined based on the number of blocks in the second non-target axis outer layer data block.

6. The method according to claim 5, characterized in that, The step of generating a performance cost model for each of the filtering and sorting operators by calculating the correlation parameters based on the performance cost of each filtering and sorting operator includes: The data transport overhead and result write-back overhead when the second filtering and sorting operator performs the filtering and sorting operation are determined based on the transport bandwidth coefficient and the total data volume of the tensor data to be processed. The single data selection overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the number of elements in the inner layer data block of the second target axis, the number of calculation loop expansions, and the sorting coefficient. Calculate the total cost of selecting target batch data when the second filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the single data selection cost, the target selection quantity, and the variable decay coefficient; Based on the number of blocks in the inner layer data of the second target axis, the total overhead of selecting the target batch data, the number of blocks in the outer layer data of the second non-target axis, and the overhead of the non-target axis head, calculate the total overhead of sorting calculation when the second filtering and sorting operator performs filtering and sorting operation on the tensor data to be processed. Based on the data transfer overhead, the result write-back overhead, and the total sorting calculation overhead, a model is generated to show the overall performance overhead of the second filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed.

7. The method according to claim 2, characterized in that, The filtering and sorting operators include a third filtering and sorting operator. The step of determining the block performance overhead parameters for data partitioning of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections includes: Based on the data segmentation granularity and the data block size, the tensor data to be processed is divided into blocks along the non-target splitting axis to obtain multiple third non-target axis outer layer data blocks; Determine the number of blocks for the third non-target axial outer layer data block; Determine the measured clock cycle data table and nonlinear fitting correction coefficients of the third screening and sorting operator when it performs the screening and sorting operation on the target device.

8. The method according to claim 7, characterized in that, The step of generating a performance cost model for each of the filtering and sorting operators by calculating the correlation parameters based on the performance cost of each filtering and sorting operator includes: Based on the number of elements of the tensor data to be processed on the target split axis, the clock cycle measured data table is queried to obtain the single cardinality selection cost when the third filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. The overall performance overhead model of the third filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is generated based on the number of blocks of the third non-target axis outer layer data block, the single cardinality selection overhead, and the nonlinear fitting correction coefficient.

9. The method according to claim 2, characterized in that, The filtering and sorting operators include a fourth filtering and sorting operator. The step of determining the block performance overhead parameters for data partitioning of the tensor data to be processed by each filtering and sorting operator based on the data parallel configuration parameters of the tensor data to be processed, the target split axis, the non-target split axis, and the number of target selections includes: The tensor data to be processed is divided into blocks along the target split axis and the non-target split axis according to the data segmentation granularity and the data block size, respectively, to obtain multiple fourth target axis inner layer data blocks and multiple fourth non-target axis outer layer data blocks; Determine the number of elements and the number of blocks in the fourth target axis inner layer data block, and determine the number of blocks in the fourth non-target axis outer layer data block; The effective load-bearing capacity of the target pile is determined based on the selected number of targets. Determine the single-level node comparison overhead and single-thread reduction overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the target device.

10. The method according to claim 9, characterized in that, The step of generating a performance cost model for each of the filtering and sorting operators by calculating the correlation parameters based on the performance cost of each filtering and sorting operator includes: Calculate the initial heap construction cost when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the effective heap carrying capacity. The single-time heap adjustment cost of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the effective heap carrying capacity and the single-level node comparison cost. The single-block heap adjustment cost of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the single heap adjustment cost and the number of elements in the inner layer data block of the fourth target axis. The thread-in-thread heap maintenance overhead of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is calculated based on the number of blocks in the fourth non-target axis outer layer data block, the number of blocks in the fourth target axis inner layer data block, the single data block heap adjustment overhead, and the initial heap building overhead. Based on the number of local blocks of the fourth non-target axis outer layer data block corresponding to each thread, the number of local blocks of the fourth target axis inner layer data block corresponding to each thread, the effective carrying capacity of the heap, and the single-thread reduction overhead, calculate the total cross-thread reduction overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed. Calculate the global aggregated heap sorting overhead when the fourth filtering and sorting operator performs filtering and sorting operations on the tensor data to be processed, based on the effective heap carrying capacity and the single heap adjustment overhead. The overall performance overhead model of the fourth filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed is generated based on the in-thread heap maintenance overhead, the cross-thread reduction total overhead, and the global aggregate heap sorting overhead.

11. A data processing method based on a filtering and sorting operator, characterized in that, include: The performance overhead model of calling multiple filtering and sorting operators is used to calculate the overall performance overhead of each filtering and sorting operator when performing filtering and sorting operations on the tensor data to be processed on the target device. The performance overhead model of each of the filtering and sorting operators is generated by the performance overhead model processing method of any of the filtering and sorting operators according to claims 1-10. Target filtering and sorting operators are selected based on the overall performance overhead of performing filtering and sorting operations on the tensor data to be processed according to each of the aforementioned filtering and sorting operators. The target filtering and sorting operator is used to filter and sort the tensor data to be processed.

12. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that is executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the performance overhead model processing method of the filtering and sorting operator according to any one of claims 1-10 or to perform the data processing method based on the filtering and sorting operator according to claim 11.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the performance overhead model processing method of any one of the filtering and sorting operators as described in claims 1-10 or to perform the data processing method based on the filtering and sorting operator as described in claim 11.

14. A computer program product, characterized in that, It includes a computer program / instruction, wherein when the computer program / instruction is executed by a processor, it implements the performance overhead model processing method of the screening and sorting operator according to any one of claims 1-10 or performs the data processing method based on the screening and sorting operator according to claim 11.