Multi-agent reasoning collaborative arrangement method and system for heterogeneous npus

By constructing an operator spectrum and cross-agent collaborative execution, the problem of collaborative optimization of inference accuracy, latency, energy consumption and resource utilization in heterogeneous NPU clusters is solved, reducing hardware adaptation costs and enhancing fault tolerance in industrial scenarios.

CN123140266APending Publication Date: 2026-11-20CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611347716.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve coordinated optimization of inference accuracy, latency, energy consumption, and resource utilization in heterogeneous NPU clusters, and also suffer from high hardware adaptation costs and poor fault tolerance in industrial scenarios.

Method used

By constructing an operator spectrum and dynamically allocating quantization precision and optimizing operators through cross-agent data interaction and pipelined collaborative execution, and combining real-time input data and NPU core status, a quantization and operator optimization scheme is generated to achieve cross-agent collaborative execution.

Benefits of technology

While ensuring inference accuracy, it reduces latency and energy consumption, improves resource utilization, enhances fault tolerance in industrial scenarios, and meets industrial-grade reliability requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123140266A_ABST
    Figure CN123140266A_ABST
Patent Text Reader

Abstract

The application discloses a multi-agent reasoning collaborative arrangement method and system for heterogeneous NPUs, relates to the technical field of artificial intelligence, and through construction of an operator spectrum covering NPU platforms, input dimensions and quantization precision, unified management of performance data of heterogeneous hardware, avoidance of separate development of adaptation logic for each type of NPU, and reduction of hardware adaptation cost. According to task constraints and real-time states of agents, AI reasoning tasks are fragmented and allocated, and in combination with quantization errors in the operator spectrum and real-time input data distribution, sensitivity of the operators is graded, quantization precision is dynamically allocated, and according to NPU core memory occupation, the operators are fused or split, so that quantization, scheduling and operator optimization are coordinated in a unified framework, delay and energy consumption can be reduced, and resource utilization can be improved. Each agent cooperatively executes in a pipeline mode according to a sub-task allocation table, and through closed-loop monitoring, abnormality is re-optimized or sub-task migration is performed, and fault tolerance in an industrial scene is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a multi-agent reasoning collaborative orchestration method and system for heterogeneous NPUs. Background Technology

[0002] Heterogeneous NPU clusters undertake a large number of AI inference tasks in scenarios such as industrial quality inspection, intelligent video surveillance, and edge fault diagnosis. These tasks usually place strict requirements on inference accuracy, latency, energy consumption, and resource utilization simultaneously. However, existing technologies are difficult to achieve coordinated optimization of these multiple dimensions.

[0003] Regarding quantization, existing solutions fix the quantization accuracy of the entire model before deployment. However, the varying sensitivities of different operators to quantization and the dynamic changes in the distribution of real-time input data make it difficult to effectively control accuracy loss. In terms of task scheduling and operator optimization, existing solutions fragment multi-agent task allocation, quantization strategies, and operator fusion. This results in unbalanced loads between high-performance and low-power NPU cores, insufficient operator fusion leading to high memory copy overhead, and inference latency and resource utilization failing to meet the demands of industrial scenarios. Regarding hardware adaptation, existing solutions require developing separate adaptation scripts for each type of NPU, making it impossible to use a unified performance database and reuse resources. Adding new hardware platforms results in long adaptation cycles and high maintenance costs. In terms of fault tolerance in industrial scenarios, when existing solutions experience sudden changes in NPU core load, hardware failures, or fluctuations in input data, task success rates drop significantly, failing to meet industrial-grade reliability requirements. Summary of the Invention

[0004] The main objective of this application is to propose a multi-agent reasoning collaborative orchestration method and system for heterogeneous NPUs, so as to optimize the scheduling of multi-agents and improve collaborative efficiency.

[0005] To achieve the above objectives, one aspect of this application proposes a multi-agent inference collaborative orchestration method for heterogeneous NPUs, the method comprising the following steps: The performance data of the core operators of the target AI model deployed in the heterogeneous NPU cluster are collected under multiple NPU platforms, input dimensions and quantization precision, and the performance data is stored in a hybrid storage structure to form an operator spectrum. Receive an AI inference task containing task constraints and input data, and obtain the real-time status of the agent corresponding to each NPU core in the heterogeneous NPU cluster; Based on the task constraints and the real-time states of each agent, the AI ​​inference task is divided into multiple subtasks containing operators, each subtask is assigned to a matching agent, and a subtask assignment table is generated. Based on the quantization error in the operator spectrum and the distribution of real-time input data, the operators in each subtask are classified by sensitivity, and corresponding quantization precision is assigned to the operators with different sensitivity levels; based on the quantization precision and the memory usage of each NPU core, the operators are fused or split to generate quantization and operator optimization schemes. The quantization and operator optimization scheme is distributed to the agent corresponding to the subtask. Each agent executes the corresponding subtask according to the subtask allocation table and the quantization and operator optimization scheme, and the subtask is executed in a pipelined collaborative manner through cross-agent data interaction.

[0006] In some embodiments, the process of collecting performance data of core operators of a target AI model deployed in a heterogeneous NPU cluster under multiple NPU platforms, input dimensions, and quantization precision includes the following steps: The core operators in the target AI model are obtained by filtering; wherein, the core operators include convolution operators, normalization operators, activation operators and fully connected operators; Under the multiple NPU platforms, input dimensions, and quantization precision, the values ​​of each performance indicator are repeatedly collected for each core operator, and the average value of each performance indicator is taken as the performance data; wherein, the performance indicators include latency, memory usage, energy consumption, and quantization error; The step of storing the performance data in a hybrid storage structure to form an operator spectrum includes the following steps: The performance data is stored in a hybrid storage structure according to the NPU platform, input dimension, and quantization precision to form an operator spectrum; wherein, the hybrid storage structure includes a relational database and a cache database.

[0007] In some embodiments, the step of dividing the AI ​​inference task into multiple subtasks containing operators based on the task constraints and the real-time states of each agent includes the following steps: Based on the inter-layer dependencies of the model corresponding to the AI ​​inference task, the AI ​​inference task is divided into multiple sub-tasks without cyclic dependencies, wherein each sub-task includes a feature extraction sub-task and a classification sub-task. Assigning each of the subtasks to a matching agent includes the following steps: Based on the performance data of operators in the operator spectrum on different NPU platforms, the task constraints, and the real-time status of each agent, subtasks with computational loads lower than a preset computational load threshold are assigned to the first agent corresponding to the first NPU core, and subtasks with computational loads higher than the preset computational load threshold are assigned to the second agent corresponding to the second NPU core; wherein, the computational power of the first agent is lower than that of the second agent.

[0008] In some embodiments, the sensitivity classification of the operators in each subtask based on the quantization error in the operator spectrum and the distribution of real-time input data includes the following steps: Based on the quantization error in the operator spectrum and the distribution of the real-time input data, the operators in each of the subtasks are divided into high-sensitivity operators, medium-sensitivity operators, and low-sensitivity operators; Assigning corresponding quantization precision to the operators with different sensitivity levels includes the following steps: A first quantization precision is assigned to the high-sensitivity operator, a second quantization precision is assigned to the medium-sensitivity operator, and a third quantization precision is assigned to the low-sensitivity operator; wherein the first quantization precision, the second quantization precision, and the third quantization precision decrease sequentially. When the fluctuation of the real-time input data distribution exceeds a preset fluctuation threshold, the second quantization accuracy of the medium-sensitivity operator is increased; The step of fusing or splitting the operators based on the quantization precision and the memory usage of each NPU core to generate a quantization and operator optimization scheme includes the following steps: Based on the memory usage of each NPU core, operators whose quantization accuracy meets the fusion conditions are fused, and operators whose size is greater than a preset size threshold are split according to the number of computing units to generate the quantization and operator optimization scheme.

[0009] In some embodiments, the pipelined collaborative execution of the subtask through cross-agent data interaction includes the following steps: The various intelligent agents interact across agents via the gRPC protocol to collaboratively execute the subtasks in a pipeline manner.

[0010] In some embodiments, the method further includes the following steps: During the execution of the subtask, the status and task execution data of each NPU core are collected. When an anomaly is detected, the quantization and operator optimization scheme is regenerated or the subtask is migrated until the task constraints are met.

[0011] In some embodiments, the step of collecting the status and task execution data of each NPU core during the execution of the subtask includes the following steps: During the execution of the subtasks, load, memory usage, power consumption, and task execution latency and accuracy data of each NPU core are collected at a set frequency. The step of regenerating the quantization and operator optimization scheme or migrating the subtask when an anomaly is detected until the task constraints are met includes the following steps: When the accuracy loss exceeds a preset loss threshold, the delay exceeds a preset delay constraint, or the agent malfunctions, the quantization and operator optimization scheme is regenerated or the subtask executed by the malfunctioning agent is transferred to the agent that has not malfunctioned. When the task constraints are met or the preset number of iterations is reached, the execution results and structured reports of each subtask are output; wherein, the structured reports include the execution data of each subtask, NPU resource utilization, and quantization error.

[0012] To achieve the above objectives, another aspect of this application proposes a multi-agent inference collaborative orchestration system for heterogeneous NPUs, the system comprising: The operator spectrum generation unit is used to collect performance data of core operators of the target AI model deployed in the heterogeneous NPU cluster under multiple NPU platforms, input dimensions and quantization precision, and store the performance data in a hybrid storage structure to form an operator spectrum. The task receiving and state awareness unit is used to receive AI inference tasks containing task constraints and input data, and to obtain the real-time state of the agent corresponding to each NPU core in the heterogeneous NPU cluster. The subtask allocation unit is used to split the AI ​​inference task into multiple subtasks containing operators according to the task constraints and the real-time state of each agent, allocate each subtask to a matching agent, and generate a subtask allocation table. The subtask quantization unit is used to classify the sensitivity of the operators in each subtask according to the quantization error in the operator spectrum and the distribution of real-time input data, and to assign corresponding quantization precision to the operators with different sensitivity levels; and to fuse or split the operators according to the memory usage of each NPU core to generate quantization and operator optimization schemes. The subtask collaborative execution unit is used to distribute the quantization and operator optimization scheme to the agent corresponding to the subtask, and use each agent to execute the corresponding subtask according to the subtask allocation table and the quantization and operator optimization scheme, and to perform pipeline collaborative execution of the subtask through cross-agent data interaction.

[0013] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0014] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0015] To achieve the above objectives, another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0016] The embodiments of this application include at least the following beneficial effects: This application provides a method and system for collaborative orchestration of multi-agent inference in heterogeneous NPUs. The solution constructs an operator spectrum covering multiple NPU platforms, input dimensions, and quantization precision, uniformly managing operator performance data across heterogeneous hardware. This avoids developing separate adaptation logic for each type of NPU, reducing hardware adaptation costs. At runtime, AI inference tasks are segmented and allocated based on task constraints and the real-time state of the agents. The sensitivity of operators is graded based on quantization errors in the operator spectrum and the distribution of real-time input data, dynamically allocating quantization precision. Simultaneously, operators are fused or split based on NPU core memory usage, enabling deep collaboration between quantization, scheduling, and operator optimization within a unified framework. This reduces latency and energy consumption while ensuring inference accuracy, improving resource utilization of the heterogeneous NPU cluster. Each agent executes collaboratively in a pipeline manner according to the subtask allocation table, and closed-loop monitoring is used to re-optimize or migrate subtasks for anomalies, enhancing fault tolerance in industrial scenarios. Therefore, this application's embodiments achieve collaborative optimization of accuracy, latency, energy consumption, and resource utilization for AI inference in heterogeneous NPU clusters, meeting the requirements of industrial scenarios for accuracy, real-time performance, and reliability. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the multi-agent inference collaborative orchestration method for heterogeneous NPUs provided in this application embodiment; Figure 2 A flowchart illustrating step S100 provided in an embodiment of this application; Figure 3 A flowchart illustrating step S130 provided in an embodiment of this application; Figure 4 A flowchart illustrating step S150 provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a multi-agent inference collaborative orchestration system for heterogeneous NPUs provided in an embodiment of this application; Figure 6This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of systems and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0021] Before providing a detailed description of the embodiments of this application, some related technologies involved in the embodiments of this application will be described first, as follows: Terminology Explanation: Orchestrator: The core control module deployed on the management node of the heterogeneous NPU cluster, with four main functions: ① Real-time perception of NPU hardware status (core load, memory usage, bandwidth) and AI inference task requirements; ② Dynamic allocation of subtasks to multiple agents; ③ Selection of quantization strategies and operator fusion schemes; ④ Management of multi-agent collaborative interaction, in the form of a software process (supporting C++ / Python development).

[0022] Operator Spectrum (OS): An offline, structured database that records the performance data of target AI operators (Conv / BN / Act / Linear / Attention, etc.) under multiple parameters: ① Heterogeneous NPU platform (high-performance cores such as Horizon Robotics Journey 6.0, low-power cores such as Qualcomm Snapdragon 8 Gen3 NPU); ② Input dimension (image resolution, batch size); ③ Quantization accuracy (INT4 / INT8 / FP16); ④ Key metrics (latency in μs, memory usage in MB, power consumption in mW). (h-level, quantization error MAE / RMSE), storage architecture is "MySQL+Redis" (historical data is stored in MySQL, and high-frequency queries are cached in Redis).

[0023] Dynamic Hybrid Quantization (DHQ): A runtime adaptive quantization strategy that does not require fixed full-model precision: ① Based on the quantization error data and real-time input data distribution of the operator spectrum, operators are divided into three levels: high, medium, and low sensitivity; ② INT4 / INT8 / FP16 precision is dynamically allocated to operators with different sensitivities; ③ Precision is automatically adjusted when the input data variance exceeds the limit (e.g., medium-sensitivity operators are upgraded from INT8 to FP16). The core is to balance precision and performance.

[0024] Task Sharding (TS): A mechanism that breaks down a complete inference task into independent subtasks (such as video encoding, feature extraction, and classification) based on inter-layer dependencies of AI models (such as forward propagation order) and NPU resource status. It supports parallel / pipeline execution and must satisfy the constraint that "subtasks have no circular dependencies".

[0025] Multi-Agent (MA): A functional unit (1 agent per core) corresponding to each NPU core in a heterogeneous NPU cluster, possessing three main capabilities: ① Executing assigned subtasks; ② Real-time feedback of status (execution progress, hardware load); ③ Achieving cross-agent data interaction through the gRPC protocol, under the unified scheduling of the orchestrator, and in the form of a lightweight software thread.

[0026] An NPU (Neural Processing Unit) is a dedicated processor designed to accelerate computation in artificial intelligence, particularly neural networks.

[0027] Heterogeneous NPU: A cluster of NPU cores with different performance characteristics, typically including two types of cores: ① High computing power cores (such as Ascend 310 and Horizon Robotics Journey 6.0, suitable for computationally intensive operators such as Attention); ② Low power cores (such as Qualcomm Snapdragon 8 Gen3 NPU and Rockchip RK3588 NPU, suitable for lightweight operators such as Conv1-Conv4), used to balance performance and power consumption.

[0028] Related Technology 1: ① Quantization Strategy: Fixed full-model quantization precision before deployment (e.g., full INT8 or full FP16), without operator-level precision difference adaptation; ② Scheduling Logic: Task allocation based on NPU core computing power (high computing power cores process large model layers, low computing power cores process small model layers); ③ Hardware Adaptation: Independent adaptation scripts are developed for Huawei Ascend and Horizon Robotics respectively, without a unified reuse mechanism.

[0029] Technical details: After full INT8 quantization of the ResNet-50 model, the classification head accuracy dropped from 99.2% to 98.0% (a loss of 1.2%); adapting to new NPUs (such as Qualcomm Snapdragon 8 Gen3) requires rewriting the quantization script, which takes about 20 working days.

[0030] Related Technology 2: ① Multi-agent design: Each NPU core corresponds to one agent, which is only responsible for receiving and executing subtasks; ② Scheduling strategy: Tasks are allocated based on the current load of the NPU core (if the load is <50%, a new task is allocated); ③ Optimization missing: There is no quantization strategy and operator fusion function, only task allocation is optimized, and no deep optimization of inference performance is involved.

[0031] Technical details: When deploying intelligent video surveillance tasks (MobileNetV3+CRNN), due to the lack of operator fusion, the number of memory copies reaches 12 times / frame, resulting in a latency of over 80ms, which cannot meet the industrial requirement of ≤50ms.

[0032] Related technology 3: ① Operator fusion logic: Identify combinations such as Conv+BN+Act through subgraph matching, and fuse 3 operators in a fixed manner; ② Hardware adaptation: Determine whether to fuse based solely on the NPU core memory capacity (fusion is performed if memory ≥ 2GB, otherwise not); ③ Defects: Lack of quantization optimization and multi-agent collaboration, and the fusion strategy is out of sync with task requirements.

[0033] Technical details: The industrial quality inspection ResNet-50 model experienced a 15% task failure rate on a low-power NPU with 1.5GB of memory due to memory overflow caused by the fixed fusion 3 operator.

[0034] Related technology 4: ① Energy consumption optimization method: Reduce energy consumption by reducing the operating frequency of NPU cores (e.g., from 2GHz to 1.2GHz); ② Cost: The execution efficiency of operators is not optimized simultaneously, resulting in an increase of 30%-40% in inference latency; ③ No heterogeneous collaboration: Only supports a single type of NPU, which cannot be adapted to cluster scenarios.

[0035] Technical details: After frequency reduction, the latency of the wind power equipment fault diagnosis task (ResNet-18) increased from 45ms to 63ms, exceeding the industrial latency requirement of ≤50ms.

[0036] Based on the specific shortcomings of the aforementioned technologies, four core problems of existing heterogeneous NPU inference technologies can be derived, and these problems are causally related: Problem 1: Static quantization lacks flexibility (root cause: ignoring operator sensitivity and data fluctuations).

[0037] The relevant technologies fix the full model quantization accuracy (such as full INT8), but the sensitivity of different operators to quantization varies significantly: the INT8 quantization accuracy loss of the classification head Linear layer (high sensitivity) is >1%, while the INT4 quantization loss of the Conv1 layer (low sensitivity) is only 0.2%; and the fluctuation of input data in industrial scenarios (such as changes in illumination causing the variance of image data to exceed the standard) is not considered, which further aggravates the accuracy loss and cannot meet the quality inspection requirement of "accuracy ≥99%".

[0038] Question 2: Heterogeneous scheduling and optimization are disconnected (root cause: lack of a collaborative framework).

[0039] Related technologies break down "multi-agent scheduling", "operator fusion", and "quantization" into independent modules: for example, scheduling tasks without optimizing operators, or fusing operators without scheduling, results in insufficient superposition of optimization effects. For example, "allocating high-computation-power cores to large-computation-volume operators but not fusing Conv+BN" still has a memory copy bottleneck, and resource utilization is <50% (high-computation-power cores are overloaded and low-power cores are idle).

[0040] Question 3: High hardware adaptation costs (root cause: lack of a unified performance database).

[0041] The relevant technologies require developing separate adaptation scripts for each type of NPU: adapting to Horizon Journey 6.0 requires writing Conv layer quantization logic, and adapting to Qualcomm Snapdragon 8 Gen3 requires rewriting, with a development cycle of more than 3 months; moreover, there is no reuse mechanism, and when adding Rockchip RK3588 NPU, repeated development is required, resulting in high maintenance costs.

[0042] Question 4: Poor fault tolerance in industrial scenarios (root cause: lack of dynamic monitoring closed loop).

[0043] The relevant technologies lack a real-time adjustment mechanism: after frequency reduction, the latency exceeds the standard and cannot be recovered, or there is no degradation solution after the fusion causes memory overflow; in industrial scenarios, when hardware load changes suddenly (such as a failure of a certain NPU core) or when input data fluctuates, the task success rate is <95%, which cannot meet the industrial-grade reliability requirements.

[0044] Therefore, the embodiments of this application aim to solve the following technical problems: the existing technology cannot achieve the collaborative optimization of "accuracy-latency-energy consumption-resource utilization" of heterogeneous NPU cluster AI inference, and the hardware adaptation cost is high and the fault tolerance of industrial scenarios is poor. There is an urgent need for a unified framework to integrate multiple technical dimensions.

[0045] This application provides a method and system for collaborative orchestration of multi-agent inference to heterogeneous NPUs, relating to the field of artificial intelligence technology. The method and system provided in this application can be applied to terminals, servers, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the multi-agent inference collaborative orchestration method for heterogeneous NPUs, but is not limited to the above forms.

[0046] This application can be applied to numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0047] Reference Figure 1 This application provides a multi-agent inference collaborative orchestration method for heterogeneous NPUs. This method may include, but is not limited to, steps S100 to S140, as follows: S100: Collect performance data of core operators of the target AI model deployed in the heterogeneous NPU cluster under multiple NPU platforms, input dimensions and quantization precision, and store the performance data in a hybrid storage structure to form an operator spectrum; S110: Receive an AI inference task containing task constraints and input data, and obtain the real-time status of the agent corresponding to each NPU core in the heterogeneous NPU cluster; S120: Based on the task constraints and the real-time states of each agent, the AI ​​inference task is divided into multiple subtasks containing operators, each subtask is assigned to a matching agent, and a subtask assignment table is generated. S130: Based on the quantization error in the operator spectrum and the distribution of real-time input data, perform sensitivity classification on the operators in each subtask, and assign corresponding quantization precision to the operators with different sensitivity levels; based on the quantization precision and the memory usage of each NPU core, fuse or split the operators to generate a quantization and operator optimization scheme. S140: The quantization and operator optimization scheme is distributed to the agent corresponding to the subtask. Each agent executes the corresponding subtask according to the subtask allocation table and the quantization and operator optimization scheme, and the subtask is executed in a pipelined collaborative manner through cross-agent data interaction.

[0048] Understandably, after deploying the target AI model in a heterogeneous NPU cluster, the data acquisition module collects performance data from multiple NPU platforms, different input dimensions, and different quantization accuracies for the core operators of the target AI model. This performance data includes latency, memory usage, energy consumption, and quantization error. The data acquisition module stores this performance data in a hybrid storage structure to form an operator spectrum. The orchestrator receives the AI ​​inference task containing task constraints and input data, obtains the real-time state of the agents corresponding to each NPU core in the heterogeneous NPU cluster, including load and memory usage. Based on the task constraints and the real-time state of each agent, the orchestrator breaks down the AI ​​inference task into multiple subtasks containing operators, matches suitable agents for execution to each subtask, and generates a subtask allocation table. Based on the quantization error in the operator spectrum and the real-time input data distribution of the inference task, the orchestrator performs sensitivity grading on the operators in each subtask, assigns corresponding quantization accuracies to operators of different sensitivity levels, and fuses or splits operators based on the quantization accuracies and the memory usage of each NPU core, generating quantization and operator optimization schemes. The orchestrator distributes quantization and operator optimization schemes to the agents that execute the corresponding subtasks. Each agent executes the corresponding subtask according to the subtask allocation table and the quantization and operator optimization scheme. During the execution process, pipeline collaborative execution is achieved through cross-agent data interaction.

[0049] Optionally, refer to Figure 2 Step S100 includes S101-S103, specifically including: The process of collecting performance data of core operators of target AI models deployed in heterogeneous NPU clusters under multiple NPU platforms, input dimensions, and quantization precision includes the following steps: The core operators in the target AI model are obtained by filtering; wherein, the core operators include convolution operators, normalization operators, activation operators and fully connected operators; Under the multiple NPU platforms, input dimensions, and quantization precision, the values ​​of each performance indicator are repeatedly collected for each core operator, and the average value of each performance indicator is taken as the performance data; wherein, the performance indicators include latency, memory usage, energy consumption, and quantization error; The step of storing the performance data in a hybrid storage structure to form an operator spectrum includes the following steps: The performance data is stored in a hybrid storage structure according to the NPU platform, input dimension, and quantization precision to form an operator spectrum; wherein, the hybrid storage structure includes a relational database and a cache database.

[0050] Specifically, in the process of constructing the operator spectrum, the data acquisition module performs operator screening on the target AI model deployed on the heterogeneous NPU cluster. The core operators selected include convolution operators, normalization operators, activation operators, and fully connected operators. The data acquisition module collects data for each core operator on multiple NPU platforms included in the heterogeneous NPU cluster. On each NPU platform, the same core operator is collected under different input dimensions and different quantization precision conditions. For each core operator under each specific condition, the data acquisition module repeatedly collects performance indicators such as latency, memory usage, energy consumption, and quantization error. The average value of each performance indicator obtained from multiple collections is taken as the performance data of the corresponding core operator. The data acquisition module organizes the performance data of all core operators according to three dimensions: NPU platform, input dimension, and quantization precision, and stores it in a hybrid storage structure composed of relational database and cache database to form the operator spectrum. This operator spectrum supports multi-dimensional queries by NPU platform, input dimension, and quantization precision.

[0051] Optionally, the step of dividing the AI ​​inference task into multiple subtasks containing operators based on the task constraints and the real-time states of each agent includes the following steps: Based on the inter-layer dependencies of the model corresponding to the AI ​​inference task, the AI ​​inference task is divided into multiple sub-tasks without cyclic dependencies, wherein each sub-task includes a feature extraction sub-task and a classification sub-task. Assigning each of the subtasks to a matching agent includes the following steps: Based on the performance data of operators in the operator spectrum on different NPU platforms, the task constraints, and the real-time status of each agent, subtasks with computational loads lower than a preset computational load threshold are assigned to the first agent corresponding to the first NPU core, and subtasks with computational loads higher than the preset computational load threshold are assigned to the second agent corresponding to the second NPU core; wherein, the computational power of the first agent is lower than that of the second agent.

[0052] Specifically, when the orchestrator breaks down an AI inference task into multiple subtasks, it divides the complete inference task into multiple non-cyclically dependent subtasks based on the inter-layer dependencies of the model corresponding to the AI ​​inference task. The resulting subtasks include feature extraction subtasks and classification subtasks. The orchestrator queries the performance data of operators on different NPU platforms in the operator spectrum, and combines the task constraints and the real-time state of each agent to allocate subtasks with computational costs below a preset computational cost threshold to the first agent corresponding to the first NPU core with lower computational cost, and allocate subtasks with computational costs above the preset computational cost threshold to the second agent corresponding to the second NPU core with higher computational cost. This generates a subtask allocation table, so that low-computational quantum tasks are executed by low-computational-cost agents and high-computational quantum tasks are executed by high-computational-cost agents.

[0053] Optionally, refer to Figure 3 Step S130 includes S131-S134, specifically including: The step of classifying the sensitivity of the operators in each subtask based on the quantization error in the operator spectrum and the distribution of real-time input data includes the following steps: Based on the quantization error in the operator spectrum and the distribution of the real-time input data, the operators in each of the subtasks are divided into high-sensitivity operators, medium-sensitivity operators, and low-sensitivity operators; Assigning corresponding quantization precision to the operators with different sensitivity levels includes the following steps: A first quantization precision is assigned to the high-sensitivity operator, a second quantization precision is assigned to the medium-sensitivity operator, and a third quantization precision is assigned to the low-sensitivity operator; wherein the first quantization precision, the second quantization precision, and the third quantization precision decrease sequentially. When the fluctuation of the real-time input data distribution exceeds a preset fluctuation threshold, the second quantization accuracy of the medium-sensitivity operator is increased; The step of fusing or splitting the operators based on the quantization precision and the memory usage of each NPU core to generate a quantization and operator optimization scheme includes the following steps: Based on the memory usage of each NPU core, operators whose quantization accuracy meets the fusion conditions are fused, and operators whose size is greater than a preset size threshold are split according to the number of computing units to generate the quantization and operator optimization scheme.

[0054] Specifically, when generating quantization and operator optimization schemes, the orchestrator divides the operators in each subtask into high-sensitivity, medium-sensitivity, and low-sensitivity operators based on the quantization errors of each operator recorded in the operator spectrum and the distribution of real-time input data. It assigns a first quantization precision to high-sensitivity operators, a second quantization precision to medium-sensitivity operators, and a third quantization precision to low-sensitivity operators. The first, second, and third quantization precisions decrease sequentially. When the fluctuation of the real-time input data distribution exceeds a preset fluctuation threshold, the orchestrator increases the second quantization precision of the medium-sensitivity operators. Based on the memory usage of each NPU core, the orchestrator fuses operators whose quantization precision meets the fusion conditions. Operators with sizes larger than a preset size threshold are split according to the number of computational units, ultimately generating quantization and operator optimization schemes.

[0055] Optionally, the pipelined collaborative execution of the subtask through cross-agent data interaction includes the following steps: The various intelligent agents interact across agents via the gRPC protocol to collaboratively execute the subtasks in a pipeline manner.

[0056] Specifically, in the process of utilizing various intelligent agents to collaboratively execute sub-tasks, each intelligent agent interacts with other intelligent agents through the gRPC protocol. After completing its assigned sub-task, the previous intelligent agent transmits the intermediate execution result to the next intelligent agent through the gRPC protocol. The next intelligent agent continues to execute the assigned sub-task based on the intermediate execution result. Each intelligent agent collaboratively executes all sub-tasks in a pipeline manner according to the order determined by the sub-task allocation table and the processing method determined by the quantization and operator optimization scheme.

[0057] Optionally, the method further includes the following steps: S150: During the execution of the subtask, the status and task execution data of each NPU core are collected. When an anomaly is detected, the quantization and operator optimization scheme is regenerated or the subtask is migrated until the task constraints are met.

[0058] Specifically, during the execution of subtasks, the orchestrator's monitoring submodule continuously collects the status and task execution data of each NPU core. When the monitoring submodule detects an anomaly, the orchestrator triggers the configuration generator to regenerate the quantization and operator optimization scheme, or migrates the subtask executed by the agent that has an anomaly to another agent that has not anomaly, and continues to execute the migrated subtask. The orchestrator repeats the above monitoring and correction process until the task constraints are met.

[0059] Optionally, refer to Figure 4 Step S150 includes S151-S153, specifically including: During the execution of the subtask, the status and task execution data of each NPU core are collected, including the following steps: During the execution of the subtasks, load, memory usage, power consumption, and task execution latency and accuracy data of each NPU core are collected at a set frequency. The step of regenerating the quantization and operator optimization scheme or migrating the subtask when an anomaly is detected until the task constraints are met includes the following steps: When the accuracy loss exceeds a preset loss threshold, the delay exceeds a preset delay constraint, or the agent malfunctions, the quantization and operator optimization scheme is regenerated or the subtask executed by the malfunctioning agent is transferred to the agent that has not malfunctioned. When the task constraints are met or the preset number of iterations is reached, the execution results and structured reports of each subtask are output; wherein, the structured reports include the execution data of each subtask, NPU resource utilization, and quantization error.

[0060] Specifically, during the execution of subtasks, the monitoring submodule collects load, memory usage, energy consumption, and task execution latency and accuracy data of each NPU core at a set frequency. When the monitoring submodule detects that the accuracy loss exceeds a preset loss threshold, or that the latency exceeds a preset latency constraint, or that a certain agent has failed, the orchestrator triggers the configuration generator to regenerate the quantization and operator optimization scheme, or migrates the subtasks executed by the failed agent to the failed agent. The orchestrator stops the monitoring and correction process when the task constraints are met or the preset number of iterations is reached, and outputs the execution results of each subtask and a structured report. The structured report includes the execution data of each subtask, NPU resource utilization, and quantization error.

[0061] The following sections will provide a detailed description and explanation of some optional embodiments of this application, using specific application examples.

[0062] This application relates to the field of artificial intelligence technology, specifically to four sub-directions: engineering deployment of artificial intelligence models, scheduling of heterogeneous NPU hardware resources, optimization of deep learning inference performance, and efficient utilization of edge computing power. Its core applications are in industrial scenarios, including intelligent manufacturing quality inspection, intelligent video surveillance, and fault diagnosis of industrial edge equipment, providing a collaborative optimization solution for AI inference tasks of heterogeneous NPU clusters in terms of "accuracy-latency-energy consumption-resources".

[0063] Specifically, the embodiments of this application include the following technical solutions: Phase division: The implementation process is divided into "offline phase" and "runtime phase". The core idea of ​​"build once, use many times" operator spectrum reduces the complexity of heterogeneous hardware adaptation.

[0064] Modularization and Data Flow: The orchestrator is deconstructed into core modules such as "configuration generation", "dynamic quantization", "scheduling", "operator fusion" and "runtime monitoring", and the data interaction (such as configuration information and monitoring feedback) and control flow (such as decision re-optimization) between modules are clearly shown with arrows.

[0065] The operator spectrum database serves as a fundamental support and is connected to multiple runtime modules, demonstrating its core position.

[0066] The concept of "multi-agent" is visualized as execution units on heterogeneous NPU cores, and forms a closed loop with "runtime monitoring" through "state feedback" arrows, vividly demonstrating the ability of dynamic scheduling.

[0067] End-to-end process: From the "AI inference task input" to the "final inference result" output, it demonstrates the complete end-to-end processing flow.

[0068] This application embodiment achieves collaborative optimization through a three-stage process: "offline preparation - runtime optimization - closed-loop monitoring," with the following steps: Offline operator spectrum construction (execution subject: data acquisition module).

[0069] Triggering conditions: heterogeneous NPU cluster hardware deployment completed, target AI model determined (e.g., ResNet-50); Processing steps: ① Filter the core operators of the model (Conv / BN / Act, etc.); ② Collect performance data (latency / memory / energy consumption / error) under multiple parameters (NPU model, input dimension, quantization accuracy), repeat 100 times and take the average value; ③ Store in a "MySQL+Redis" database, supporting multi-dimensional queries (such as "Conv+Qualcomm NPU+INT4+224 resolution"). Result: An operator spectrum database was generated, providing data support for runtime optimization.

[0070] Runtime multi-agent orchestration (Execution subject: orchestrator-scheduler submodule).

[0071] Triggering condition: Submission of AI inference task (such as intelligent manufacturing quality inspection task); Processing steps: ① Receive task requirements (latency ≤ 50ms, accuracy ≥ 99%) and NPU agent status (load / memory); ② Query the operator spectrum and break the task into subtasks (e.g., "feature extraction subtask → classification subtask"); ③ Assign subtasks to matching agents (low-sensitivity Conv → low-power NPU, high-sensitivity Linear → high-computing-power NPU); ④ Support pipelined execution (e.g., "video encoding → frame extraction → feature extraction" in parallel); Result: A subtask allocation table is generated, and multi-agent collaborative reasoning is initiated.

[0072] Dynamic hybrid quantization and operator optimization (Execution subject: orchestrator-configuration generator submodule).

[0073] Triggering condition: Subtask assignment completed; Processing actions: ① Operator sensitivity grading: Combining operator spectrum error data with real-time input data distribution (variance), categorize sensitivity into high (error > 1%) / medium (0.3% < error ≤ 1%) / low (error ≤ 0.3%); ② Dynamic precision allocation (high sensitivity → FP16, medium → INT8, low → INT4), upgrading the precision of medium-sensitivity operators when variance exceeds the limit; ③ Operator fusion / splitting: Based on NPU memory fusion of Conv+BN+Act (memory ≥ 2GB fuses 3 operators, < 2GB fuses 2 operators), large-size Conv is split and parallelized according to the number of computational units; Result: Quantization and operator optimization schemes were generated and distributed to each agent.

[0074] Runtime monitoring and closed-loop correction (Execution subject: orchestrator-monitoring submodule).

[0075] Triggering condition: Inference task in progress; Processing actions: ① Collect NPU status (load / memory / power consumption) and task data (latency / accuracy) 20 times per second; ② If the accuracy loss is greater than 0.5% or the latency exceeds the standard, trigger the configuration generator to re-optimize (such as improving accuracy and adjusting subtask allocation); ③ If an agent fails, migrate its tasks to an idle agent; Result: Ensure the task is executed within constraints until the inference result is output.

[0076] Result output (Execution subject: orchestrator - output submodule).

[0077] Triggering condition: The inference task is completed or the optimization is iterated 5 times; Processing steps: Organize the output (inference results, execution data of each subtask, NPU resource utilization, quantization error); Result: Output a structured report to the user.

[0078] The technical problems solved are: ① Solving the problem of "insufficient flexibility of static quantization" through dynamic hybrid quantization; ② Solving the problem of "disjointed scheduling and optimization" through multi-agent and optimization collaboration; ③ Solving the problem of "high hardware adaptation cost" through operator spectrum; ④ Solving the problem of "poor fault tolerance in industrial scenarios" through monitoring closed loop.

[0079] Core technical effects: Based on industrial scenario test sets (ResNet-50 quality inspection task, MobileNetV3 monitoring task): ① Accuracy loss ≤0.5% (meets ≥99% requirement); ② Inference latency reduced by 40%-45% (83ms→47ms); ③ Energy consumption reduced by 35%-40% (120mW·h→72mW·h); ④ Resource utilization increased to over 85% (48%→89%); ⑤ Hardware adaptation cycle shortened by 95% (3 months→1 week); ⑥ Task success rate ≥99.5%.

[0080] For example, the use cases and system architecture of the embodiments of this application are shown in Table 1: Table 1

[0081] The system architecture (offline + runtime) is shown in Table 2: Table 2

[0082] For example, embodiments of this application may provide the following specific implementation methods: Example 1: Intelligent manufacturing quality inspection, ResNet-50 model.

[0083] Scenario parameters: Input image (1×3×224×224, batchsize=8), heterogeneous NPU cluster (2 Horizon Journey 6.0, 4 Qualcomm Snapdragon 8 Gen3), requirements: latency ≤50ms, accuracy ≥99%, power consumption ≤80mW·h.

[0084] Offline operator spectrum construction (Execution subject: data acquisition module; Triggering condition: hardware deployment completed).

[0085] Processing steps: ① Filter ResNet-50 core operators (Conv1-Conv5, BN, ReLU, Linear); ② Collect data under “NPU model (Horizon Robotics / Qualcomm) × quantization precision (INT4 / INT8 / FP16) × input dimension (224×224 / 448×448)”, such as Conv1 under Qualcomm + INT4: latency 8μs, memory 2MB, power consumption 0.5mW·h, error 0.2%; Linear under Qualcomm + FP16: latency 12μs, memory 1MB, power consumption 0.8mW·h, error 0.1%; ③ Store to MySQL + Redis; Results: ResNet-50 operator spectrum was generated with a query latency of ≤10ms; Alternative solution: If the collected data fluctuates greatly (standard deviation > 5%), the number of collections can be increased to 200.

[0086] Runtime multi-agent orchestration (Execution subject: orchestrator-scheduler; Triggering condition: quality inspection task submission).

[0087] Processing steps: ① Receive task requirements and NPU status (Horizon Core load 30%, Qualcomm Core load 20%); ② Query operator spectrum and split the task into "feature extraction subtask (Conv1-Conv5+BN+ReLU)" and "classification subtask (Linear)"; ③ Assign subtasks: Conv1-Conv3 → Qualcomm agents 1-3 (low power + low sensitivity), Conv4-Conv5 → Horizon agents 4-5 (high computing power + medium sensitivity), Linear → Horizon agent 6 (high computing power + high sensitivity); ④ Execute using pipelined methods (feature extraction → classification in parallel); Result: Subtask allocation table generated, agent started; Alternative solution: If a Qualcomm core fails, migrate its tasks to an idle Qualcomm core (Agent 4).

[0088] Dynamic hybrid quantization and operator optimization (Execution subject: orchestrator-configuration generator; Triggering condition: subtask allocation completed).

[0089] Processing steps: ① Operator sensitivity grading: Conv1-Conv4 (low sensitivity, error ≤0.3%), Conv5 (medium sensitivity, error 0.6%), Linear (high sensitivity, error 1.2%); ② Precision allocation: Conv1-Conv4 → INT4, Conv5 → INT8, Linear → FP16; ③ Operator fusion: Qualcomm core with 1.8GB memory → fused Conv+BN (2 operators), Horizon core with 3GB memory → fused Conv+BN+ReLU (3 operators); Result: The optimized solution was distributed to the intelligent agent; Alternative solution: If the variance of the input image is greater than 5 (sudden change in illumination), increase the Conv5 precision to FP16.

[0090] Monitoring and closed-loop correction (Execution subject: orchestrator-monitoring submodule; Triggering condition: inference execution).

[0091] Processing actions: ① Data is collected 20 times per second: Qualcomm core load 65%, Horizon core load 75%, Conv5 latency 15μs (compliant), Linear accuracy 98.9% (error 0.1%); ② No anomalies, no correction required; Result: Continue execution until the task is completed.

[0092] Result output (Execution subject: orchestrator-output submodule; Triggering condition: inference completed).

[0093] Processing actions: Data organization: Inference latency 47ms, accuracy 98.8% (loss 0.4%), energy consumption 72mW·h, resource utilization 89%; Results: All indicators met the requirements, showing a significant improvement compared to before optimization (delay 83ms, energy consumption 120mW·h, utilization rate 48%).

[0094] Example 2: Extended technical solution (intelligent video surveillance, MobileNetV3+CRNN).

[0095] Scenario differences: The task is "video encoding (H.265) + action recognition (MobileNetV3) + OCR (CRNN)", with requirements of throughput ≥ 25 frames / second, bandwidth ≤ 100Mbps, and the NPU cluster consists of "3 Ascend 310 + 3 Rockchip RK3588".

[0096] Core process differences: Task segmentation: split into "video encoding subtask (low computational load) → action recognition subtask (medium computational load) → OCR subtask (high computational load)"; Subtask allocation: Encoding → Rockchip Agent 1-3 (low power), Action recognition → Ascend Agent 4-5 (medium computing power), OCR → Ascend Agent 6 (high computing power); Dynamic adjustment: When the monitoring module detects that the bandwidth reaches 110Mbps, it triggers the encoding subtask to reduce the bitrate (resolution 1080P → 720P), reducing the bandwidth to 85Mbps and reducing power consumption by 25%. Results: Throughput increased from 15 frames per second to 29 frames per second, bandwidth reached 85 Mbps, and resource utilization was 78%, meeting the requirements.

[0097] Beneficial effects: Accuracy-Performance-Energy Balance: Example 1 achieves an accuracy loss of only 0.4% (meeting ≥99%) through dynamic quantization (INT4 / INT8 / FP16 classification), a latency reduction of 43.4%, and a power consumption reduction of 40%, avoiding the shortcomings of existing technologies where "accuracy loss >1% or latency exceeds the standard". Improved resource utilization: The fusion and collaboration of multiple agents and operators improved the resource utilization rate of Example 1 from 48% to 89%, solving the problem of "overload of high computing power cores and idle low power cores" and reducing hardware procurement costs. Reduced hardware adaptation costs: Operator spectra can be "built once and reused multiple times". Adapting to Rockchip RK3588 only requires the collection of 10 types of operator data (completed in 1 week), which is 95% shorter than the existing technology cycle of 3 months; Enhanced industrial fault tolerance: The monitoring closed loop can cope with hardware failures (such as agent failure migration) and data fluctuations (such as variance exceeding the standard and improving accuracy). Example 1 has a task success rate of 99.8%, meeting industrial-grade reliability requirements.

[0098] In summary, the embodiments of this application include the following key technical solutions and technical effects: 1. An offline construction and runtime dynamic matching scheme based on operator spectrum.

[0099] Technical means: ① Offline stage: Collect operator performance data in multiple dimensions such as "NPU model × input dimension × quantization accuracy" to build an "MySQL + Redis" operator spectrum to support accurate query; ② Runtime stage: The orchestrator matches the optimal quantization strategy and subtask allocation scheme from the operator spectrum according to task requirements (latency / accuracy) and NPU status, without the need to redevelop adaptation logic.

[0100] Existing technical limitations: There is no unified operator performance database, and adaptation scripts need to be developed separately for each type of NPU (with a cycle of 3 months), and there is no reuse mechanism.

[0101] Advantages of this application's embodiments: ① Hardware adaptation cycle shortened by 95% (3 months → 1 week), maintenance cost reduced by 90%; ② Solution matching efficiency improved by 80% (Redis cache high-frequency query, latency reduced from 50ms → 10ms); ③ Covers mainstream industrial NPUs (Horizon Robotics / Qualcomm / Ascend / Rockchip), with strong versatility.

[0102] 2. A dynamic hybrid quantization scheme driven by both operator sensitivity and data distribution.

[0103] Technical measures: ① Based on operator spectrum quantization error data, operators are divided into three sensitivity levels: high (error > 1%), medium (0.3% < error ≤ 1%), and low (error ≤ 0.3%). ② Accuracy is dynamically allocated based on the real-time input data distribution (variance) (high → FP16, medium → INT8, low → INT4). ③ When variance exceeds the limit, the accuracy of medium-sensitive operators is automatically upgraded (e.g., INT8 → FP16) to avoid error accumulation.

[0104] Existing technology has the following drawbacks: Static quantization fixes the accuracy of the entire model (such as full INT8), resulting in an accuracy loss of >1%; single dynamic quantization ignores data fluctuations and has poor anti-interference capabilities.

[0105] Advantages of the embodiments of this application: ① Accuracy loss ≤0.5%, meeting the industrial requirement of ≥99% accuracy; ② Inference latency reduced by 40%-45%, energy consumption reduced by 35%-40%, which is better than static quantization (latency reduced by 20%-25%, energy consumption reduced by 15%-20%); ③ No need to pre-train the quantization model, and the model optimization cycle is reduced from 7 days to 1 day.

[0106] 3. A deep collaborative scheme for multi-agent and operator optimization.

[0107] Technical means: ① Subtask allocation and operator type matching: low-sensitivity / low-computation-consumption operators (Conv1-Conv3) → low-power NPU agents, high-sensitivity / high-computation-consumption operators (Linear / Attention) → high-computation-power NPU agents; ② Operator fusion and NPU memory matching: ≥2GB memory fuses 3 operators (Conv+BN+Act), <2GB memory fuses 2 operators (Conv+BN); ③ Large-size operators are split according to the number of NPU computing units (e.g., 16 units are split into 16 sub-operators), supporting parallel execution.

[0108] Existing technology has the following drawbacks: multi-agent scheduling and operator optimization are separated, the optimization effects are not sufficiently superimposed, and resource utilization is less than 50%.

[0109] Advantages of this application's embodiments: ① Resource utilization is increased to over 85%, avoiding core idleness; ② Memory copy count is reduced by 40%-60%, solving the memory bottleneck; ③ Latency of large-size operators is reduced by 50%-60% (e.g., 1024×1024Conv from 20μs→8μs), and throughput is increased by 80%-120%.

[0110] 4. An industrial scenario-oriented closed-loop solution for monitoring, feedback, and re-optimization.

[0111] Technical measures: ① High-frequency sampling: NPU status (load / memory / power consumption) and task data (latency / accuracy) are collected 20 times per second; ② Abnormal triggering: When accuracy loss > 0.5%, latency exceeds the standard, or hardware failure occurs, the configuration generator is triggered to re-optimize (increase accuracy, adjust allocation, and migrate tasks); ③ Iteration limit: Optimization iterations ≤ 5 times to avoid infinite loops.

[0112] Existing technology has the following drawbacks: lack of dynamic adjustment mechanism, poor fault tolerance in industrial scenarios, and a task success rate of less than 95%.

[0113] The advantages of this application's embodiments are: ① a task success rate of ≥99.5%, meeting industrial-grade reliability; ② the ability to cope with fluctuations in input data (such as changes in lighting) and sudden hardware changes (such as NPU failures); ③ the requirement for no manual intervention, making it suitable for unattended industrial scenarios.

[0114] Reference Figure 5This application also provides a multi-agent inference collaborative orchestration system for heterogeneous NPUs, which can implement the above-mentioned multi-agent inference collaborative orchestration method for heterogeneous NPUs. The system includes: The operator spectrum generation unit is used to collect performance data of core operators of the target AI model deployed in the heterogeneous NPU cluster under multiple NPU platforms, input dimensions and quantization precision, and store the performance data in a hybrid storage structure to form an operator spectrum. The task receiving and state awareness unit is used to receive AI inference tasks containing task constraints and input data, and to obtain the real-time state of the agent corresponding to each NPU core in the heterogeneous NPU cluster. The subtask allocation unit is used to split the AI ​​inference task into multiple subtasks containing operators according to the task constraints and the real-time state of each agent, allocate each subtask to a matching agent, and generate a subtask allocation table. The subtask quantization unit is used to classify the sensitivity of the operators in each subtask according to the quantization error in the operator spectrum and the distribution of real-time input data, and to assign corresponding quantization precision to the operators with different sensitivity levels; and to fuse or split the operators according to the memory usage of each NPU core to generate quantization and operator optimization schemes. The subtask collaborative execution unit is used to distribute the quantization and operator optimization scheme to the agent corresponding to the subtask, and use each agent to execute the corresponding subtask according to the subtask allocation table and the quantization and operator optimization scheme, and to perform pipeline collaborative execution of the subtask through cross-agent data interaction.

[0115] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0116] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method of this application. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0117] It is understood that the content of the above method embodiments is applicable to the device embodiments. The specific functions implemented by the device embodiments are the same as those of the methods of this application, and the beneficial effects achieved are the same as those achieved by the methods of this application.

[0118] Figure 6 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 101 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 102 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 102 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 102 and is called and executed by the processor 101. Input / output interface 103 is used to implement information input and output; The communication interface 104 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 105 transmits information between various components of the device (e.g., processor 101, memory 102, input / output interface 103, and communication interface 104); The processor 101, memory 102, input / output interface 103 and communication interface 104 are connected to each other within the device via bus 105.

[0119] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of this application.

[0120] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0121] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0122] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0123] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0124] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0125] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0126] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0127] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application 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 the embodiments of this application 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.

[0128] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0129] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0130] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0131] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0132] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0133] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A multi-agent reasoning collaborative orchestration method for heterogeneous NPUs, characterized in that, The method includes the following steps: The performance data of the core operators of the target AI model deployed in the heterogeneous NPU cluster are collected under multiple NPU platforms, input dimensions and quantization precision, and the performance data is stored in a hybrid storage structure to form an operator spectrum. Receive an AI inference task containing task constraints and input data, and obtain the real-time status of the agent corresponding to each NPU core in the heterogeneous NPU cluster; Based on the task constraints and the real-time states of each agent, the AI ​​inference task is divided into multiple subtasks containing operators, each subtask is assigned to a matching agent, and a subtask assignment table is generated. Based on the quantization error in the operator spectrum and the distribution of real-time input data, the operators in each subtask are classified by sensitivity, and corresponding quantization precision is assigned to the operators with different sensitivity levels; based on the quantization precision and the memory usage of each NPU core, the operators are fused or split to generate quantization and operator optimization schemes. The quantization and operator optimization scheme is distributed to the agent corresponding to the subtask. Each agent executes the corresponding subtask according to the subtask allocation table and the quantization and operator optimization scheme, and the subtask is executed in a pipelined collaborative manner through cross-agent data interaction.

2. The multi-agent inference collaborative orchestration method for heterogeneous NPUs according to claim 1, characterized in that, The process of collecting performance data of core operators of target AI models deployed in heterogeneous NPU clusters under multiple NPU platforms, input dimensions, and quantization precision includes the following steps: The core operators in the target AI model are obtained by filtering; wherein, the core operators include convolution operators, normalization operators, activation operators and fully connected operators; Under the multiple NPU platforms, input dimensions, and quantization precision, the values ​​of each performance indicator are repeatedly collected for each core operator, and the average value of each performance indicator is taken as the performance data; wherein, the performance indicators include latency, memory usage, energy consumption, and quantization error; The step of storing the performance data in a hybrid storage structure to form an operator spectrum includes the following steps: The performance data is stored in a hybrid storage structure according to the NPU platform, input dimension, and quantization precision to form an operator spectrum; wherein, the hybrid storage structure includes a relational database and a cache database.

3. The multi-agent inference collaborative orchestration method for heterogeneous NPUs according to claim 1, characterized in that, The step of dividing the AI ​​inference task into multiple subtasks containing operators based on the task constraints and the real-time states of each agent includes the following steps: Based on the inter-layer dependencies of the model corresponding to the AI ​​inference task, the AI ​​inference task is divided into multiple sub-tasks without cyclic dependencies, wherein each sub-task includes a feature extraction sub-task and a classification sub-task. Assigning each of the subtasks to a matching agent includes the following steps: Based on the performance data of operators in the operator spectrum on different NPU platforms, the task constraints, and the real-time status of each agent, subtasks with computational loads lower than a preset computational load threshold are assigned to the first agent corresponding to the first NPU core, and subtasks with computational loads higher than the preset computational load threshold are assigned to the second agent corresponding to the second NPU core; wherein, the computational power of the first agent is lower than that of the second agent.

4. The multi-agent inference collaborative orchestration method for heterogeneous NPUs according to claim 1, characterized in that, The step of classifying the sensitivity of the operators in each subtask based on the quantization error in the operator spectrum and the distribution of real-time input data includes the following steps: Based on the quantization error in the operator spectrum and the distribution of the real-time input data, the operators in each of the subtasks are divided into high-sensitivity operators, medium-sensitivity operators, and low-sensitivity operators; Assigning corresponding quantization precision to the operators with different sensitivity levels includes the following steps: A first quantization precision is assigned to the high-sensitivity operator, a second quantization precision is assigned to the medium-sensitivity operator, and a third quantization precision is assigned to the low-sensitivity operator; wherein the first quantization precision, the second quantization precision, and the third quantization precision decrease sequentially. When the fluctuation of the real-time input data distribution exceeds a preset fluctuation threshold, the second quantization accuracy of the medium-sensitivity operator is increased; The step of fusing or splitting the operators based on the quantization precision and the memory usage of each NPU core to generate a quantization and operator optimization scheme includes the following steps: Based on the memory usage of each NPU core, operators whose quantization accuracy meets the fusion conditions are fused, and operators whose size is greater than a preset size threshold are split according to the number of computing units to generate the quantization and operator optimization scheme.

5. The multi-agent inference collaborative orchestration method for heterogeneous NPUs according to claim 1, characterized in that, The pipelined collaborative execution of the subtask through cross-agent data interaction includes the following steps: The various intelligent agents utilize the gRPC protocol to perform cross-agent data interaction, and collaboratively execute the sub-tasks in a pipeline manner.

6. The multi-agent reasoning collaborative orchestration method for heterogeneous NPUs according to any one of claims 1 to 5, characterized in that, The method further includes the following steps: During the execution of the subtask, the status and task execution data of each NPU core are collected. When an anomaly is detected, the quantization and operator optimization scheme is regenerated or the subtask is migrated until the task constraints are met.

7. The multi-agent inference collaborative orchestration method for heterogeneous NPUs according to claim 6, characterized in that, During the execution of the subtask, the status and task execution data of each NPU core are collected, including the following steps: During the execution of the subtasks, load, memory usage, power consumption, and task execution latency and accuracy data of each NPU core are collected at a set frequency. The step of regenerating the quantization and operator optimization scheme or migrating the subtask when an anomaly is detected until the task constraints are met includes the following steps: When the accuracy loss exceeds a preset loss threshold, the delay exceeds a preset delay constraint, or the agent malfunctions, the quantization and operator optimization scheme is regenerated or the subtask executed by the malfunctioning agent is transferred to the agent that has not malfunctioned. When the task constraints are met or the preset number of iterations is reached, the execution results and structured reports of each subtask are output; wherein, the structured reports include the execution data of each subtask, NPU resource utilization, and quantization error.

8. A multi-agent inference collaborative orchestration system for heterogeneous NPUs, characterized in that, The system includes: The operator spectrum generation unit is used to collect performance data of core operators of the target AI model deployed in the heterogeneous NPU cluster under multiple NPU platforms, input dimensions and quantization precision, and store the performance data in a hybrid storage structure to form an operator spectrum. The task receiving and state awareness unit is used to receive AI inference tasks containing task constraints and input data, and to obtain the real-time state of the agent corresponding to each NPU core in the heterogeneous NPU cluster. The subtask allocation unit is used to split the AI ​​inference task into multiple subtasks containing operators according to the task constraints and the real-time state of each agent, allocate each subtask to a matching agent, and generate a subtask allocation table. The subtask quantization unit is used to classify the sensitivity of the operators in each subtask according to the quantization error in the operator spectrum and the distribution of real-time input data, and to assign corresponding quantization precision to the operators with different sensitivity levels; and to fuse or split the operators according to the memory usage of each NPU core to generate quantization and operator optimization schemes. The subtask collaborative execution unit is used to distribute the quantization and operator optimization scheme to the agent corresponding to the subtask, and use each agent to execute the corresponding subtask according to the subtask allocation table and the quantization and operator optimization scheme, and to perform pipeline collaborative execution of the subtask through cross-agent data interaction.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.