A method for NPU multi-version stack regression and retention rollback release access control
By using five-dimensional modeling and comprehensive access control scoring of NPU multi-version stacks, compatibility conflicts are automatically identified and releases are blocked. Combined with a retain/rollback decision model, the version compatibility risk and fault recovery efficiency issues in NPU multi-version stack scenarios are resolved, improving the controllability and maintainability of the release process.
Patent Information
- Application Number
- CN202611262292.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-17
AI Technical Summary
In NPU multi-version stack scenarios, the lack of full-stack version regression verification, stable version retention management, one-click rollback for faults, and release access interception methods leads to high version compatibility risks, limited coverage of manual testing, low efficiency in fault handling, and affects the stable operation of terminal AI services.
The firmware layer, driver layer, runtime library layer, compiler layer, and operator library layer in the NPU multi-version stack are explicitly modeled as a five-dimensional version combination matrix. Three types of driving subtracks are constructed for maintainability, architecture adaptability, and behavioral correctness. Through layered regression testing and comprehensive access control scoring, compatibility conflicts are automatically identified and releases are blocked. A retain/rollback/partial retain decision model and a Defer wake-up mechanism are adopted to achieve rapid fault recovery.
It significantly reduces the risk of online failures caused by improper version combinations, improves the controllability and maintainability of the NPU full-stack release process, ensures release quality, and retains the performance benefits of version upgrades to the greatest extent.
Smart Images

Figure CN123114529A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of NPU computing power release control technology, specifically to an NPU multi-version stack regression and retention rollback release access control method. Background Technology
[0002] Currently, various smart terminals and computing devices are equipped with NPU units to handle artificial intelligence inference calculations. During product iteration, multiple versions of NPU driver firmware and supporting operator libraries are continuously released. Different versions form a stacked version stack. When devices are released online, new NPU program packages are frequently pushed. The coexistence of old and new programs in the version stack has become the norm. The continuous accumulation of versions puts considerable pressure on version control.
[0003] The online release process lacks a standardized verification and interception process, and mostly relies on developers to manually check the running status of the new version. Each time a new version is pushed, only the basic functions of the current version to be released are simply verified. It does not link all the previous historical versions in the version stack for complete regression verification. The coverage of manual verification is limited, and it is easy to miss hidden problems such as compatibility conflicts between new and old versions, operator precision offset, and abnormal computing power scheduling. Fault feedback is delayed after online release.
[0004] The existing release process only supports one-way upgrades and updates, without a corresponding version retention and rapid rollback control mechanism. When a new version fails to run, a new fix package can only be temporarily pushed to cover the current version. It is not possible to directly call up the stable old version in the version stack to quickly restore business. Fault handling is time-consuming and is prone to secondary compatibility anomalies caused by multiple updates, affecting the stable operation of terminal AI business.
[0005] Currently, in NPU multi-version stack scenarios, there is a lack of integrated management methods that can simultaneously complete full-stack version regression verification, stable version retention management, one-click rollback of faults, and release access interception. Simple manual testing and one-way upgrade modes cannot avoid the risk of multi-version compatibility in advance, nor can they efficiently restore the normal AI computing power service of the device after problems occur during release. Summary of the Invention
[0006] The purpose of this invention is to provide an NPU multi-version stack regression and retention rollback release access control method to solve the above-mentioned problems, thereby resolving the issues mentioned in the background art.
[0007] To address the aforementioned issues, this invention provides a technical solution: a method for NPU multi-version stack regression and retention rollback release access control, comprising: explicitly modeling the version combinations of the five dimensions of firmware layer, driver layer, runtime library layer, compiler layer and operator library layer in the NPU multi-version stack as a five-dimensional version combination matrix;
[0008] Based on the aforementioned five-dimensional version combination matrix, three types of driving sub-tracks are constructed for each version combination: maintainability driving sub-track, architecture adaptability driving sub-track, and behavior correctness driving sub-track. The maintainability driving sub-track is used to protect the consistency of the version compatibility matrix, the architecture adaptability driving sub-track is used to protect the operator performance baseline from degradation, and the behavior correctness driving sub-track is used to protect the accuracy and stability of the release access control.
[0009] Obtain the difference code between the current NPU stack version to be released and the historical baseline version; perform hierarchical regression testing on the difference code to obtain the regression pass rate of each test layer;
[0010] Obtain the measured performance-to-power ratio of the current version, and the version compatibility matrix used to characterize the compatibility between the current version and each downstream module; calculate the comprehensive access control score based on the regression pass rate, the measured performance-to-power ratio, and the compatibility identifier in the version compatibility matrix. The comprehensive access control score adopts a four-dimensional non-compensated access control judgment based on accuracy, performance, stability, and compatibility. If any dimension fails to meet the preset access control conditions, the release will be blocked.
[0011] A cross-layer artifact lineage is generated and recorded. The cross-layer artifact lineage contains 7 nodes / 6 hops of lineage: model, operator, compilerIR, binary, runtime, driver, and firmware. Each hop records the tool version, command hash, and upstream artifact summary. Among them, the driver-firmware compatibility matrix version is recorded as a required field for the driver node, and the quantization configuration is recorded as a required field for the model node, so as to achieve a unique correspondence between accuracy and lineage nodes.
[0012] First, perform four independent hardware access control judgments: accuracy, performance, stability, and compatibility. If any dimension fails the judgment, the release will be stopped and an access control failure report will be output. The system will not enter the subsequent scoring and release candidate pool update process.
[0013] The comprehensive access control score is calculated only when all four dimensions of hard access control are deemed to have passed. The comprehensive access control score is only used to sort the versions that have passed the hard access control and serves as a reference for version priority and rollback target version selection in the release candidate pool. It shall not be used to decide whether to release the current version.
[0014] Once all four-dimensional hard access controls pass, the current version is added to the release candidate pool. If any dimension of the four-dimensional hard access controls is blocked, it is determined whether the release candidate pool is empty. If it is empty, the release is blocked and an access control failure report is output. If it is not empty, the retention / rollback / partial retention decision model is executed: the benefits of the new version are retained for the operator paths that have passed verification in the current version, and the specific operator granularity with problems is rolled back to the historical version with the highest comprehensive access control score in the release candidate pool. A rollback patch is generated based on the difference between the current version and the historical version. At the same time, the conditions for the repair version to be awakened are registered for the blocked version. After the repaired version is released, the regression access control is automatically retried, and the version compatibility matrix is updated.
[0015] Preferably, the hierarchical regression test includes a unit test layer, an operator test layer, and a model test layer, with the regression pass rates of each layer being respectively... , , The corresponding weight is , , ,satisfy ;
[0016] The formula for calculating the comprehensive access control score S is as follows:
[0017] ;
[0018] in, λ is the normalized value of the performance-to-power ratio, and λ is the preset performance adjustment coefficient.
[0019] Preferably, the measured performance-to-power ratio is the ratio of the inference throughput T to the average power consumption W of the current version on the standard test set, and the normalized value is... The calculation formula is:
[0020] ;
[0021] in, , These are the inference throughput and average power consumption of the historical baseline version, respectively.
[0022] Preferably, the comprehensive access control score S is calculated using a formula that includes a compatibility penalty term:
[0023] ;
[0024] in, , , These are the weights for the unit test layer, operator test layer, and model test layer, respectively. , , These are the corresponding regression pass rates. η is the normalized value of the performance-to-power ratio, λ is the performance adjustment coefficient, and η is the penalty intensity coefficient.
[0025] The compatibility penalty item:
[0026] ;
[0027] in, Let j be the weight of the j-th downstream module. This is a compatibility flag for the j-th downstream module in the current version. A value of 1 indicates compatibility and 0 indicates incompatibility. N is the total number of downstream modules.
[0028] Preferably, the weights of each test layer are dynamically adjusted based on historical access control records: Let the failure rate of the l-th layer test in the most recent K releases be... ,in The adjusted weights for:
[0029] ;
[0030] The adjusted , , Substitute these values into the comprehensive access control scoring calculation to replace the original weights.
[0031] Preferably, the release candidate pool maintains a maximum of H historical versions that have passed, where H is a preset positive integer, and a value of 5-10 is recommended. When the candidate pool is not full, the current version is added directly. When the candidate pool is full, the version with the lowest comprehensive access control score is removed and then added to the current version. When rolling back, the historical version selected is the version with the highest comprehensive access control score in the candidate pool.
[0032] Preferably, the release threshold is a preset fixed value or a dynamic threshold, wherein the dynamic threshold is based on the comprehensive access control score sequence of the most recent M approved access control versions. Determination of the δ quantile:
[0033] ;
[0034] in, δ is the quantile function, δ∈(0,1) is the preset quantile, and the recommended value is 0.80-0.95. θ is the dynamically released threshold.
[0035] Preferably, the method also includes an access control log recording step: recording the comprehensive access control score for each access control judgment, the regression pass rate of each layer, the measured value of the performance-power ratio, the rollback trigger event and the rollback target version. The access control log is used for setting and adjusting the release threshold and for tracing the version of the rollback patch.
[0036] Preferably, the rollback patch is generated by: performing reverse difference extraction on the difference code between the current version and the selected historical version, generating an incremental patch file, and storing the patch file in association with the historical version.
[0037] Preferably, the NPU multi-version stack includes a firmware layer, a driver layer, a runtime library layer, a compiler layer, and an operator library layer; the difference code is generated based on the difference analysis of the version control system.
[0038] The hierarchical regression test can optionally be executed in parallel in a simulation environment and a real chip environment, with the test results in the simulation environment serving as the initial screening basis and the test results in the real chip environment serving as the final access control judgment basis.
[0039] The beneficial effects of this invention are reflected in:
[0040] 1. This invention explicitly models the version combinations of five dimensions—driver, firmware, runtime, compiler, and operator library—as a version matrix, and independently performs regression testing and gate adjudication for each combination. This solves the problem that existing ML platform CI only supports single-version stack assumptions and cannot systematically evaluate the multi-version combination space. It enables compatibility conflicts between components during version upgrades to be automatically identified and blocked before release, thereby significantly reducing the risk of online failures caused by improper version combinations.
[0041] 2. This invention constructs three independent control subtracks for maintainability, architecture adaptability, and behavioral correctness, respectively safeguarding the consistency of the version compatibility matrix, the non-degradation of operator performance baseline, and the accuracy and stability release gates. This allows three types of engineering goals with different time scales and different responsible parties to be expressed, traced, and protected separately within the same Harness framework. This avoids the shortcomings of existing solutions where compatibility checks, performance regressions, and accuracy verifications are mixed together and cannot be audited independently, thereby significantly improving the controllability and maintainability of the NPU full-stack release process.
[0042] 3. This invention, through a retain / rollback / partial retain decision model combined with a Defer wake-up mechanism, enables automatic analysis of the regression range after the release access control is blocked. It retains the benefits of the new version for verified operator paths, rolls back to a stable version only for specific operators with problems at the granularity of the problem, and registers wake-up conditions to automatically re-trigger regression after the fixed version is released. This solves the problems of full rollback due to local problems and low efficiency of manual tracking and fixing versions under the existing vendor SDK full package release method. Thus, it not only ensures the release quality, but also retains the performance benefits brought by the version upgrade to the greatest extent. Attached Figure Description
[0043] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0044] Figure 1 This is a schematic diagram of the overall process of multi-version stack regression and release access control in this invention;
[0045] Figure 2 This is a schematic diagram illustrating the independent organization and interaction process of the three types of driving subrails in this invention;
[0046] Figure 3 This is a schematic diagram of the retention / rollback / partial retention decision + Defer wake-up process of the present invention;
[0047] Figure 4 This is a schematic diagram of the precision-level dual-condition release and spectrum node binding process of the present invention;
[0048] Figure 5 This is a flowchart of the access control scoring and rollback patch generation process of the present invention;
[0049] Figure 6 Flowchart of the access control method for NPU multi-version stack regression and retention rollback release. Detailed Implementation
[0050] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely illustrative of the technical solution of the present invention and are therefore intended to limit the scope of protection of the present invention.
[0051] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application should have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.
[0052] Example 1
[0053] See Figures 1-6 As shown, an NPU multi-version stack regression and retention rollback release access control method includes: explicitly modeling the version combinations of the five dimensions of firmware layer, driver layer, runtime library layer, compiler layer and operator library layer in the NPU multi-version stack into a five-dimensional version combination matrix;
[0054] Based on the five-dimensional version combination matrix, three types of driving sub-tracks are constructed for each version combination: maintainability driving sub-track, architecture adaptability driving sub-track, and behavior correctness driving sub-track. The maintainability driving sub-track is used to protect the consistency of the version compatibility matrix, the architecture adaptability driving sub-track is used to protect the operator performance baseline from degradation, and the behavior correctness driving sub-track is used to protect the accuracy and stability of the release access control.
[0055] Obtain the difference code between the current NPU stack version to be released and the historical baseline version; perform hierarchical regression testing on the difference code and obtain the regression pass rate of each test layer;
[0056] Obtain the measured performance-to-power ratio of the current version, as well as the version compatibility matrix used to characterize the compatibility between the current version and each downstream module; calculate the comprehensive access control score based on the regression pass rate, the measured performance-to-power ratio, and the compatibility identifier in the version compatibility matrix. The comprehensive access control score adopts a four-dimensional non-compensated access control judgment based on accuracy, performance, stability, and compatibility. If any dimension fails to meet the preset access control conditions, the release will be blocked.
[0057] A cross-layer artifact lineage is generated and recorded. The cross-layer artifact lineage contains 7 nodes / 6 hops of lineage: model, operator, compiler IR, binary, runtime, driver, and firmware. Each hop records the tool version, command hash, and upstream artifact summary. Among them, the driver-firmware compatibility matrix version is recorded as a required field for the driver node, and the quantization configuration is recorded as a required field for the model node to achieve a unique correspondence between accuracy and lineage nodes.
[0058] First, perform four independent hardware access control judgments: accuracy, performance, stability, and compatibility. If any dimension fails the judgment, the release will be stopped and an access control failure report will be output. The system will not enter the subsequent scoring and release candidate pool update process.
[0059] The comprehensive access control score is calculated only when all four dimensions of hard access control are deemed to have passed. The comprehensive access control score is only used to sort the versions that have passed the hard access control and serves as a reference for version priority and rollback target version selection in the release candidate pool. It shall not be used to decide whether to release the current version.
[0060] Once all four-dimensional hard gates pass, the current version is added to the release candidate pool. If any dimension in the four-dimensional hard gates is blocked, it is determined whether the release candidate pool is empty. If it is empty, the release is blocked and a gate failure report is output. If it is not empty, the retain / rollback / partial retain decision model is executed: the benefits of the new version are retained for the operator paths that have passed the verification in the current version, and the specific operator granularity with problems is rolled back to the historical version with the highest comprehensive gate score in the release candidate pool. A rollback patch is generated based on the difference between the current version and the historical version. At the same time, the conditions for the version to be repaired are registered for the blocked version. After the repaired version is released, the regression gate is automatically retried and the version compatibility matrix is updated.
[0061] Furthermore, the hierarchical regression test includes a unit test layer, an operator test layer, and a model test layer, with the regression pass rates for each layer being as follows: , , The corresponding weight is , , ,satisfy ;
[0062] The formula for calculating the comprehensive access control score S is:
[0063] ;
[0064] in, λ is the normalized value of the performance-to-power ratio, and λ is the preset performance adjustment coefficient.
[0065] Furthermore, the measured performance-to-power ratio is the ratio of the inference throughput T to the average power consumption W of the current version on the standard test set, normalized value. The calculation formula is:
[0066] ;
[0067] in, , These represent the inference throughput and average power consumption of the historical baseline version, respectively.
[0068] Furthermore, the comprehensive access control score S is calculated using a formula that includes a compatibility penalty:
[0069] ;
[0070] in, , , These are the weights for the unit test layer, operator test layer, and model test layer, respectively. , , These are the corresponding regression pass rates. η is the normalized value of the performance-to-power ratio, λ is the performance adjustment coefficient, and η is the penalty intensity coefficient.
[0071] Compatibility penalties:
[0072] ;
[0073] in, Let j be the weight of the j-th downstream module. This is a compatibility flag for the j-th downstream module in the current version. A value of 1 indicates compatibility and 0 indicates incompatibility. N is the total number of downstream modules.
[0074] Furthermore, the weights of each test layer are dynamically adjusted based on historical access control records: Let the failure rate of the l-th layer test in the most recent K releases be... ,in The adjusted weights for:
[0075] ;
[0076] The adjusted , , Substitute these values into the comprehensive access control scoring calculation to replace the original weights.
[0077] Furthermore, the candidate pool maintains a maximum of H historical versions that have passed the test, where H is a preset positive integer, and a value of 5-10 is recommended. When the candidate pool is not full, the current version is added directly. When the candidate pool is full, the version with the lowest comprehensive access control score is removed and then added to the current version. When rolling back, the historical version selected is the version with the highest comprehensive access control score in the candidate pool.
[0078] Furthermore, the release threshold can be a preset fixed value or a dynamic threshold. The dynamic threshold is based on the comprehensive access control score sequence of the most recent M approved access control versions. Determination of the δ quantile:
[0079] ;
[0080] in, δ is the quantile function, δ∈(0,1) is the preset quantile, and the recommended value is 0.80-0.95. θ is the dynamically released threshold.
[0081] Furthermore, it also includes access control log recording steps: recording the comprehensive access control score for each access control judgment, the regression pass rate of each layer, the measured value of performance-power ratio, the rollback trigger event and the rollback target version. The access control log is used for setting and adjusting the release threshold and for version tracking of rollback patches.
[0082] Furthermore, the rollback patch is generated by: extracting the differences between the current version and the selected historical version in reverse, generating an incremental patch file, and storing the patch file in association with the historical version.
[0083] Furthermore, the NPU multi-version stack includes a firmware layer, a driver layer, a runtime library layer, a compiler layer, and an operator library layer; the difference code is generated based on the difference analysis of the version control system.
[0084] Hierarchical regression testing can optionally be performed in parallel in a simulation environment and a real chip environment, using the test results in the simulation environment as the initial screening basis and the test results in the real chip environment as the final access control judgment basis.
[0085] Related Interface Reference Table:
[0086] Interface Interface name / input / output How to use this invention P1 Evidence Bundle: Input snapshot / Environment snapshot / Event stream / Workpiece genealogy / Indicator results / Decision log / Workpiece output Each version stack regression writes NPU-specific evidence (model hash, compiler version, runtime version, driver / firmware version combination, board stepping) through the P1 evidence package interface; the cross-layer artifact hierarchy is model→operator→compilerIR→binary→runtime→driver→firmware, totaling 7 nodes / 6 hops; recorded through the P1 artifact hierarchy field, P1 provides a general hierarchy field structure, and this invention adds NPU domain-specific extension rules on top of it (hierarchy hop count definition, required field set for each node, driver node including compatibility matrix version, model node content-specific configuration); four-dimensional indicators of accuracy / performance / stability / compatibility are written to the metrics field; keep / revert / partial keep decisions are written to the decisions field. P2 Five-Outcome Gating (Pass / Block / Retry / Escalate / Defer) The NPU multi-version stack regression access control outputs judgment results (accuracy regression Pass / Block, stability Block, performance degradation Block) through the P2 five-state interface; the Defer state is used for the "automatic re-trigger after the release of the version to be fixed" scenario (firmware vK+1 release wake-up, driver fix version wake-up), and P2 provides a general interface for Defer wake-up and a five-state result model; P5 specializes the NPU domain Defer trigger conditions (Defer triggering of the driver-firmware-runtime-compiler-operator library five-dimensional version stack) and fix version wake-up condition registration; the five-state judgment logic is protected by P2, and P5 provides NPU domain access control input conditions (three levels of accuracy tolerance, performance baseline, stability requirements, and compatibility matrix). P3 Control Action (execution_spec / gate_spec / guide_set / sensor_spec / authority) The control actions for each of the nine NPU layers (application / framework / model / operator / compiler / runtime / driver / firmware / board) are created through the P3 control action interface; the execution_spec is populated with the NPU board path, version constraint file, and model type fields; the gate_spec is populated with the access conditions for each of the three types of driving subrails; the control window isolation mechanism (P3) is used for NPU multi-board concurrent regression scenarios (each board is bound to an independent control_window_id); the task semantic label routing (P3) is used to route NPU regression tasks to independent evaluators according to the following labels: [performance] / [accuracy] / [compatibility] / [hil-run]. P4 IC Flow Harness execution logs and domain mapping templates P4 and P5 share the common HarnessKernel (P1 / P2 / P3 / P6 / P7 / P8), and the company's unified control infrastructure supports both IC design and NPU hardware and software full-stack R&D lines. P4 protects the IC Flow domain lineage extension rules (RTL→netlist→DEF→GDSII), and P5 protects the NPU domain lineage extension rules (model→firmware, a total of 7 nodes / 6 hops). The two do not overlap. P6 Cross-domain bridging, experience accumulation library Historical failure frequencies are injected into the Corner / version combination sampling strategy through the P6 experience repository; historical calibration experience of the accuracy tolerance table provides inferential constraint suggestions through P6; when evidence is inconsistent between the IC and NPU sides in cross-domain scenarios, evidence is coordinated and supplemented through P6; historical pattern matching in driver / firmware upgrade decisions is retrieved from the P6 experience repository. P7 Guide kernel and constraint injection package (guide_set.computational / inferential) The Guide sets for the three types of driver engineering mapping (NPU dimension) are injected with control actions through the P7 three-source constraint compilation interface; maintainability constraints (driver-firmware compatibility matrix verification, runtime-compiler adaptation matrix, operator library version locking) are compiled into deterministic constraints; architecture adaptability constraints (performance baseline, PE / DMA / memorybandwidth utilization thresholds) and behavioral correctness constraints (three levels of accuracy tolerance, stability requirements) are compiled into inferential constraints; the specific compilation form of the constraints is handled by P7. P8 Steering loop, ablation audit, external loop events The `stage_transition_event` (NPU regression stage transition: regression execution → access control decision → release decision) triggers P8 steering audit; P8 ablation audit can evaluate the contribution and make retirement decisions for NPU release access control rules (such as accuracy tolerance thresholds, performance baselines, and compatibility matrix entries); when the outer loop detects continuous stagnation in multi-version stack regression, it triggers a replanning request. P9 Controlled AI operators and compilation optimization access control, verification dimension sensors P9 reuses P5's NPU domain sensors and accuracy tolerance tables at the operator / compile layer, implementing independent multi-dimensional gating for each optimization proposal in generative AI. P5's multi-version stack regression and release gating provides P9 with an upstream control environment at the version stack level. The two approaches form a two-layer closed loop in the NPU domain: "version stack-level regression control + proposal-level optimization control". Boundary delineation is detailed in P5 terminology under "Retention / Rollback / Partial Retention Decision Model". P10 IC front-end DSE and front-end / back-end collaboration, verification of evidence output P5 and P10 indirectly collaborate via a cross-domain bridge with P6; the accuracy / performance evidence released by the entire NPU stack can serve as a reference input for the P10 front-end DSE; P5 does not directly advocate for a front-end and back-end collaborative feedback loop, which is protected by P10.
[0087] Example 2
[0088] This embodiment uses the release access control decision of the ResNet-50 model under different precision levels (FP32, FP16, INT8) as an example to explain in detail the specific implementation process of the NPU multi-version stack regression and retention rollback release access control method of the present invention;
[0089] 1. System initialization and specification record layer configuration
[0090] First, deploy the NPU full-stack Harness control suite. The NPU inference engine (runtime v1.3), driver (driver v1.3), and firmware (firmware vK) are deployed on the NPU board nodes and uniformly scheduled by the execution kernel. The specification record layer is stored in a versioned Git repository and contains the following configuration:
[0091] 1) Driver-firmware compatibility matrix: Stored in JSON format, the combination of driver ≤ v1.5 and firmware vK, vK-1 is a valid combination in the current approved version record;
[0092] 2) Precision Tolerance Table: Sets the upper limit of tolerance for FP32 settings. =0.02%, FP16 tolerance limit =0.05%, INT8 tolerance limit =0.10%, which satisfies:
[0093] ;
[0094] 3) Performance baseline table: Records the latency and throughput baselines of ResNet-50 at each accuracy level. The latency baseline for FP32 is 3.0ms and the throughput baseline is 333req / s; the latency baseline for FP16 is 4.0ms and the throughput baseline is 250req / s; the latency baseline for INT8 is 5.5ms and the throughput baseline is 180req / s.
[0095] 4) Stability requirements: A passing standard is set as no crash, SIGSEGV, or memory corruption for N=100 consecutive rounds of inference;
[0096] 5) Performance tolerance and hard blocking threshold: setting latency tolerance =5%, latency hard blocking threshold =10%, throughput tolerance =3%;
[0097] 2. Create version stack control actions
[0098] The control plane is the current version combination to be evaluated: runtime v1.3 × driver v1.3 × firmware vK × compiler v2.1 × operator library vM. Regression control actions are created, and the following steps are performed:
[0099] Obtain the difference code between the current NPU stack version to be released and the historical baseline version. Specifically, take driverv1.3×firmware vK×runtime v1.3 as the historical baseline, take the upgrade of compiler v2.1 and operator library vM as the source of difference, and generate a set of difference code through the difference analysis of the version control system.
[0100] The control action is populated with execution_spec, which includes the NPU board path and version constraint file, and gate_spec, which includes the access control conditions for each of the three types of driving subrails.
[0101] 3. Maintainable driving subrail execution
[0102] Before regression execution, three types of deterministic constraints are injected through the constraint injection interface:
[0103] 1) The current driver v1.3 x firmware vK combination is within the approved compatibility matrix. A query of the specification record layer shows that it is approved.
[0104] 2) The adaptation matrix between runtime v1.3 and compiler v2.1 passed, and the result was "passed".
[0105] 3) The operator library vM version is locked to be consistent with the environment, and the result is "pass".
[0106] After all three types of constraints are passed, the kernel starts the NPU inference process. After execution, a version snapshot is collected and written to the environment field of the evidence package, which contains the hash values of driver v1.3, firmware vK, runtime v1.3, compiler v2.1, and operator library vM.
[0107] 4. Architecture adaptability and sub-track execution
[0108] The architecture adaptability of the sensor drives the output performance metrics of each key operator of ResNet-50, and compares them with the performance baseline. In this embodiment, the comparison between the measured performance values of each operator at each accuracy level and the baseline values is as follows:
[0109] For the FP32 mode, the PE utilization of the conv1 operator is 67% (baseline 70%, degradation 4.3%, less than tolerance 5%), the DMA utilization of the conv2_1 operator is 82% (baseline 85%, degradation 3.5%, less than tolerance 5%), the memory bandwidth of the fc1000 operator is 91GB / s (baseline 92GB / s, degradation 1.1%, less than tolerance 5%), and the sensor output for all operator architecture adaptations is passed.
[0110] The architecture compatibility of FP16 and INT8 was performed in the same way, and all passed. The overall judgment result of the architecture compatibility control sub-track was passed.
[0111] 5. Behavioral Correctness Control Sub-track Execution and Access Control Multi-dimensional Judgment
[0112] Behavioral correctness driving the sensor to run ResNet-50 accuracy regression at FP32, FP16 and INT8 levels respectively:
[0113] 1) FP32 accuracy regression: top-1 accuracy was 76.42%, baseline was 76.40%, and the difference was... ,satisfy It was determined to be passed;
[0114] 2) FP16 accuracy regression: top-1 accuracy was 76.13%, baseline was 76.15%, and the difference was... ,
[0115] satisfy It was determined to be passed;
[0116] 3) INT8 precision regression: top-1 accuracy was 75.87%, baseline was 75.85%, and the difference was... ,satisfy It was determined to be passed;
[0117] Then, a precision-level dual-condition release check is performed:
[0118] Condition 1 (Target file meets): INT8 precision meets tolerance requirements, pass;
[0119] Condition 2 (No regression in all high-end settings): No regression in FP32 and FP16 settings, passed;
[0120] If both conditions are met, the overall accuracy dimension is judged as passing.
[0121] Performance regression: The measured latency for FP16 was 4.2ms (baseline 4.0ms, degradation 5.0%), meeting the tolerance requirement of ≤5% latency degradation; the measured latency for INT8 was 5.8ms (baseline 5.5ms, degradation 5.4%), slightly exceeding the 5% tolerance but not exceeding the hard blocking threshold of 10%, thus it was judged as passed with a performance alarm. Throughput degradation was less than 3% in both cases, meeting the tolerance requirement. Overall, the performance dimension was judged as passed (with alarm).
[0122] Stability test: No crash or SIGSEGV occurred during N=100 consecutive rounds of ResNet-50 inference, and the stability dimension was deemed passed;
[0123] Compatibility check: The current version combination of driver v1.3 and firmware vK is within the approved driver-firmware compatibility matrix, and the compatibility dimension is determined to be passed;
[0124] Comprehensive access control scoring calculation: Let the regression pass rates of the unit test layer, operator test layer, and model test layer be respectively... , , The corresponding weight is , , ,satisfy The normalized performance-to-power ratio is The performance adjustment coefficient is λ. In this embodiment, the throughput of each layer is 1.0. =0.98, then the comprehensive access control score S is:
[0125] ;
[0126] Substitute specific values:
[0127] ;
[0128] The weights of each layer are preset by the standard recording layer, λ is the performance adjustment coefficient. Since all four-dimensional judgments pass, the performance dimension alarm does not affect the blocking judgment. S is greater than or equal to the release threshold θ, and the current version is allowed to be added to the release candidate pool.
[0129] If a comprehensive access control scoring formula including compatibility penalties is used, then the score S is:
[0130] ;
[0131] Where η is the penalty intensity coefficient, and the compatibility penalty term C is:
[0132] ;
[0133] In the formula, Let j be the weight of the j-th downstream module. This is the compatibility flag for the j-th downstream module in the current version. A value of 1 indicates compatibility and 0 indicates incompatibility. N is the total number of downstream modules. In this embodiment, all compatibility flags are 1, so C=0 and the penalty term has no effect.
[0134] The release threshold θ is a preset fixed value, or it is based on the comprehensive access control score sequence of the most recent M approved access control versions. Dynamic determination of the δ quantile:
[0135] ;
[0136] in, It is a quantile function;
[0137] 6. Generation of cross-layer workpiece spectrum
[0138] This regression generates a cross-layer workpiece lineage, recorded according to the following 7 nodes / 6 jump lineage records:
[0139] firmware vK (hash) )←driver v1.3 (hash) )←Runtime v1.3 (Hash) ←binary (compiler v2.1 compiled, hash) ) ← Operator graph (ONNX extraction, hashing) ) ←model ResNet-50 (ONNX, hash ) ← Quantization configuration (INT8 calibration set SHA-256: );
[0140] The model node in the spectral lineage records the quantization configuration (INT8 calibration set hash). (PTQ calibration method), the driver node records the current compatibility matrix version number matrix-v20240301, the decision record is passed, an INT8 latency alarm is attached, and it is written to the decisions field of the evidence package as a traceable basis for the release of the announcement;
[0141] The required fields for each lineage node are as follows:
[0142] Model nodes: model_sha256, model_format (e.g., ONNX / PyTorch), quantization_config (including calib_set_sha256 and calib_method);
[0143] operator nodes: op_lib_version, op_lib_sha256, op_signature (input / output dtype / shape);
[0144] compiler IR node: compiler_version, compiler_sha256, pass_list_hash;
[0145] runtime binary node: runtime_version, runtime_sha256, compile_target_arch;
[0146] driver node: driver_version, driver_sha256, abi_version, matrix_version;
[0147] firmware node: firmware_version, firmware_sha256, board_stepping.
[0148] Example 3
[0149] This embodiment takes the upgrade of the driver from v1.3 to v1.4 as an example to illustrate the specific implementation process of the retention / rollback / partial retention decision model and Defer wake-up mechanism of the method described in this invention when some operators experience stability regression;
[0150] 1. Scene setting
[0151] The current stable stack of the NPU board is driver v1.3 × firmware vK × runtime v1.3 × compiler v2.1 × operator library vM. We are now evaluating upgrading the driver from v1.3 to v1.4. The specification record layer has recorded that driver v1.4 × firmware vK is within the compatibility matrix, and the pre-constraint verification of the maintainability driving subrail has passed.
[0152] 2. Maintainable driving subrail execution
[0153] The driver v1.4 x firmware vK is within the approved compatibility matrix. Runtime v1.3 and compiler v2.1 are compatible. Operator library versions are locked consistently. All maintainability control subtracks are approved, allowing regression execution. The version snapshot records the driver v1.4 hash. The versions of the remaining layers remain unchanged;
[0154] 3. Architecture adaptability and control over sub-track execution
[0155] The architecture adaptability of the driving sensors was assessed by performing full operator performance regression on driver v1.4. The measured results of each operator were compared with the baseline of driver v1.3 as follows:
[0156] conv2d_1x1: measured latency 1.80ms (baseline 1.84ms), change −2.2% (improvement), pass;
[0157] conv2d_3x3: measured latency 2.10ms (baseline 2.15ms), change −2.3% (improvement), pass;
[0158] conv2d_3x3_stride2: measured latency 3.40ms (baseline 3.45ms), change −1.4% (improvement), pass;
[0159] depthwise_conv: PE utilization 74% (baseline 75%), change −1.3%, pass;
[0160] All sub-tracks passed the architecture adaptation test, and driver v1.4 showed an overall performance improvement of approximately 2%.
[0161] 4. Behavioral Correctness Control of Sub-track Execution and Four-Dimensional Access Control Judgment
[0162] Behavioral correctness control of sensor operation: Full accuracy regression and stability test.
[0163] Accuracy regression: ResNet-50's top-1 difference is less than 0.01% in FP16 and less than 0.02% in INT8. Both accuracy grading conditions are met. For INT8, the test is approved. The two-condition validation is as follows:
[0164] ;
[0165] In this embodiment, all the above conditions are met, and the accuracy dimension is determined to be passed.
[0166] Stability test: driver v1.4 intermittently SIGSEGV occurred in the INT8 execution path of the conv2d_3x3_stride2 operator, and crashed once in 10,000 inferences. It does not meet the stability requirement of no crash for N=100 consecutive rounds. The stability dimension is determined to be blocked.
[0167] Based on the results of the four-dimensional access control system assessment:
[0168] Dimension Judgment result Precision (FP16 / INT8 dual condition) pass Performance (overall operator latency) pass Stability (100 runs without crash) Block Compatibility (within the compatibility matrix) pass overall Block
[0169] If the overall access control score S is lower than the release threshold θ, the rollback mechanism is triggered.
[0170] 5. Analysis of the decision-making model for retaining / rollbacking down / partially retaining
[0171] The overall access control result is blocked, but the retain / rollback / partial retain decision model further analyzes the scope of the block:
[0172] Blocking range analysis: Blocking is limited to the INT8 execution path of the conv2d_3x3_stride2 operator; other operators have better performance and no stability issues under driver v1.4, including conv2d_1x1, conv2d_3x3, depthwise_conv, etc.
[0173] Decision output: Partial retention. Driver v1.4 is retained on non-conv2d_3x3_stride2 operator paths, retaining approximately 2% performance gain. The conv2d_3x3_stride2 operator INT8 path reverts to driver v1.3 behavior, implemented through compile-time operator binding routes. Compiler v2.1 generates a driver-version-pinned binary for this operator, specifying the use of the driver v1.3 ABI path.
[0174] Operator-level routing tables are generated in JSON format, with the following format:
[0175] {op_id, precision_tier, driver_abi_version};
[0176] Write the decisions field into the evidence package. Compiler v2.1 generates a driver-version-pinned binary for the target operator based on this routing table during compilation.
[0177] 6. Defer wake-up condition registration and wake-up
[0178] Defer wake-up condition registration: The condition is "firmware vK+1 released, fixing SIGSEGV of conv2d_3x3_stride2INT8 algorithm path". The system monitors the firmware version event stream, marks the current version as partially reserved, and records the wake-up condition of the fixed version in the access control log.
[0179] Defer Wake-up and Full Retention Upgrade: Firmware vK+1 Released in 72 Hours (Hash) The release notes record "fixing the conv2d_3x3_stride2 INT8 memory access out-of-bounds error". The Defer wake-up condition is triggered, and the system automatically creates a new regression control action. Stability tests on the conv2d_3x3_stride2 INT8 path are rerun under the driver v1.4 x firmware vK+1 combination.
[0180] No SIGSEGV was detected in 10,000 consecutive inferences, thus passing the stability dimension.
[0181] The four-dimensional access control system was re-evaluated, and all dimensions passed.
[0182] The overall access control score S is greater than or equal to the release threshold θ;
[0183] The decision is upgraded to full retention, driver v1.4 is applied to all operators with no routing restrictions, the decisions field of the evidence packet is updated, the Defer record is disabled, the operator granularity routing table is updated, and the unified driver v1.4 path is restored.
[0184] Other implementation methods
[0185] Variant 1: Cross-layer spectral support operator library black-box mode
[0186] When the vendor operator library is not reproducible, i.e. the operator library is binary and closed-source, and the compilation process cannot be replayed, the genealogy node is marked as reproducibility=hash_only, only recording the operator library version number and file hash, without storing intermediate compilation artifacts, and without requiring replay. The decisions field of the evidence package records "the operator library black-box dependency has been manually approved and confirmed", ensuring the integrity of the audit chain and not affecting the normal execution of accuracy and performance regression.
[0187] Variant 2: Retain / Rollback / Partial Retainment Decision Support for Scenario-Based Routing
[0188] For inference services, the model distinguishes between latency-sensitive (online inference with strict latency constraints) and throughput-sensitive (offline batch processing with throughput priority). The decision models for retention / rollback / partial retention can output routing strategies according to the scenario. The two scenarios are executed independently to publish access control multi-dimensional judgments and produce their own evidence packages and decision records.
[0189] Variant 3: Precision tolerance table supports custom model type grading
[0190] For CV models, NLP models, and recommendation models, the meanings of accuracy tolerance metrics are different, such as top-1 accuracy, BLEU, and AUC. The accuracy tolerance table in the specification record layer supports storing different accuracy metrics and tolerance upper limits according to model type. The behavior correctness driving sensor selects the corresponding tolerance table for comparison based on the model type field in execution_spec, without needing to modify the Harness control logic.
[0191] Variant 4: Multi-version stack manifest hash immutable baseline anchor
[0192] In NPU full-stack variance attribution, a three-tiered priority system is used: the highest priority is the multi-version stack manifestthash, calculated using the following formula:
[0193] ;
[0194] in, For model file hashing, , , , These are the version numbers of each component. The minimum identifier is the board's stepping identifier, followed by the individual hashes for each component, and finally, the version number field for each component. Once calculated, it becomes an immutable combinatorial identifier; any component upgrade generates a new one. This allows for the separate tracking of differences between multi-version combinations and single-version differences during attribution.
[0195] Variant 5: Control window isolation for multi-board concurrent regression
[0196] In multi-board concurrent regression scenarios, each board's regression task is bound to an independent control_window_id. Regression tasks under the same control_window_id share semantic isolation boundaries. When an unidentified caller attempts to access the evidence package, it receives a read-only block. If a long-running regression reaches a preset threshold but is still not completed, a Defer is automatically output, and wake-up conditions are registered to wait for regression completion or timeout upgrade. This isolation mechanism is different from the process-level or container-level isolation of general CI / CD platforms and belongs to semantic isolation bound to the evidence system.
[0197] Variant 6: Semantic Label Routing for NPU Regression Tasks
[0198] NPU full-stack regression tasks are routed to different executors / evaluators based on semantic tags. Tags include [performance] which routes to the performance executor and independent performance evaluator, [accuracy] which routes to the accuracy regression executor and independent accuracy evaluation component, [compatibility] which routes to the compatibility matrix validator and independent release gatekeeper, and [hil-run] which routes to the HIL board executor and independent HIL evaluator. Routing actions across evaluation independence boundaries are all structured and written into the evidence package to ensure that the evaluation independence of NPU regression is protected at the routing layer.
[0199] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A method for NPU multi-version stack regression and reservation fallback release access control, characterized in that, include: The version combinations of the five dimensions of firmware layer, driver layer, runtime library layer, compiler layer and operator library layer in the NPU multi-version stack are explicitly modeled as a five-dimensional version combination matrix; Based on the aforementioned five-dimensional version combination matrix, three types of driving sub-tracks are constructed for each version combination: maintainability driving sub-track, architecture adaptability driving sub-track, and behavior correctness driving sub-track. The maintainability driving sub-track is used to protect the consistency of the version compatibility matrix, the architecture adaptability driving sub-track is used to protect the operator performance baseline from degradation, and the behavior correctness driving sub-track is used to protect the accuracy and stability of the release access control. Retrieve the code differences between the current NPU stack version to be released and the historical baseline version; Perform hierarchical regression testing on the discrepancy codes to obtain the regression pass rate of each test layer; Obtain the measured performance-to-power ratio of the current version, and the version compatibility matrix used to characterize the compatibility between the current version and each downstream module; calculate the comprehensive access control score based on the regression pass rate, the measured performance-to-power ratio, and the compatibility identifier in the version compatibility matrix. The comprehensive access control score adopts a four-dimensional non-compensated access control judgment based on accuracy, performance, stability, and compatibility. If any dimension fails to meet the preset access control conditions, the release will be blocked. A cross-layer artifact lineage is generated and recorded. The cross-layer artifact lineage contains 7 nodes / 6 hops of lineage: model, operator, compiler IR, binary, runtime, driver, and firmware. Each hop records the tool version, command hash, and upstream artifact summary. Among them, the driver-firmware compatibility matrix version is recorded as a required field for the driver node, and the quantization configuration is recorded as a required field for the model node, so as to achieve a unique correspondence between accuracy and lineage nodes. First, perform four independent hardware access control judgments: accuracy, performance, stability, and compatibility. If any dimension fails the judgment, the release will be stopped and an access control failure report will be output. The system will not enter the subsequent scoring and release candidate pool update process. The comprehensive access control score is calculated only when all four dimensions of hard access control are deemed to have passed. The comprehensive access control score is only used to sort the versions that have passed the hard access control and serves as a reference for version priority and rollback target version selection in the release candidate pool. It shall not be used to decide whether to release the current version. Once all four-dimensional hard access controls pass, the current version is added to the release candidate pool. If any dimension of the four-dimensional hard access controls is blocked, it is determined whether the release candidate pool is empty. If it is empty, the release is blocked and an access control failure report is output. If it is not empty, the retention / rollback / partial retention decision model is executed: the benefits of the new version are retained for the operator paths that have passed verification in the current version, and the specific operator granularity with problems is rolled back to the historical version with the highest comprehensive access control score in the release candidate pool. A rollback patch is generated based on the difference between the current version and the historical version. At the same time, the conditions for the repair version to be awakened are registered for the blocked version. After the repaired version is released, the regression access control is automatically retried, and the version compatibility matrix is updated.
2. The NPU multi-version stack regression and retention rollback release access control method according to claim 1, characterized in that: The hierarchical regression test includes a unit test layer, an operator test layer and a model test layer, and regression pass rates of the layers are respectively , , , corresponding weights are , , , and satisfy ; The formula for calculating the comprehensive access control score S is as follows: ; wherein, is a normalized value of performance power ratio, and λ is a preset performance adjustment coefficient.
3. The NPU multi-version stack regression and retention rollback release access control method according to claim 2, characterized in that: The performance-to-power ratio measured value is the ratio of the inference throughput T and the average power W of the current version on the standard test set, and the normalized value The calculation formula is: ; wherein, , are the inferred throughput and average power consumption of the historical baseline version, respectively.
4. The NPU multi-version stack regression and reservation fallback release access control method of claim 1, wherein: The comprehensive access control score S is calculated using a formula that includes a compatibility penalty: ; wherein, , , are the weights of the unit test layer, the operator test layer and the model test layer, respectively, , , are the corresponding regression pass rates, respectively, is the normalized value of the performance power ratio, λ is the performance adjustment coefficient, and η is the penalty intensity coefficient. The compatibility penalty item: ; in, Let j be the weight of the j-th downstream module. This is a compatibility flag for the j-th downstream module in the current version. A value of 1 indicates compatibility and 0 indicates incompatibility. N is the total number of downstream modules.
5. The NPU multi-version stack regression and retention rollback release access control method according to claim 1, characterized in that: The weights of each test layer are dynamically adjusted based on historical access control records: Let the failure rate of the l-th test in the most recent K releases be... ,in The adjusted weights for: ; The adjusted , , Substitute these values into the comprehensive access control scoring calculation to replace the original weights.
6. The NPU multi-version stack regression and retention rollback release access control method according to claim 1, characterized in that: The release candidate pool maintains a maximum of H historical versions that have passed, where H is a preset positive integer, and a value of 5-10 is recommended. When the candidate pool is not full, the current version is added directly. When the candidate pool is full, the version with the lowest comprehensive access control score is removed and then added to the current version. When rolling back, the historical version selected is the version with the highest comprehensive access control score in the candidate pool.
7. The NPU multi-version stack regression and retention rollback release access control method according to claim 1, characterized in that: The release threshold is either a preset fixed value or a dynamic threshold. The dynamic threshold is based on the comprehensive access control score sequence of the most recent M approved access control versions. Determination of the δ quantile: ; in, δ is the quantile function, δ∈(0,1) is the preset quantile, and the recommended value is 0.80-0.
95. θ is the dynamically released threshold.
8. The NPU multi-version stack regression and retention rollback release access control method according to claim 1, characterized in that, It also includes access control log recording steps: recording the comprehensive access control score for each access control judgment, the regression pass rate of each layer, the measured value of the performance-power ratio, the rollback trigger event and the rollback target version. The access control log is used for setting and adjusting the release threshold and for tracing the version of the rollback patch.
9. The NPU multi-version stack regression and retention rollback release access control method according to claim 1, characterized in that, The rollback patch is generated by: extracting the differences between the current version and the selected historical version in reverse, generating an incremental patch file, and storing the patch file in association with the historical version.
10. The NPU multi-version stack regression and retention rollback release access control method according to claim 1, characterized in that: The NPU multi-version stack includes a firmware layer, a driver layer, a runtime library layer, a compiler layer, and an operator library layer; the difference code is generated based on the difference analysis of the version control system. The hierarchical regression test can optionally be executed in parallel in a simulation environment and a real chip environment, with the test results in the simulation environment serving as the initial screening basis and the test results in the real chip environment serving as the final access control judgment basis.
