A MLOps task execution method based on a pipeline state machine and a hardware abstraction layer

By combining pipeline state machines with hardware abstraction layers, the problems of low data transfer efficiency and complex tool integration in MLOps pipelines are solved, achieving efficient and reliable MLOps task execution and resource utilization, and improving the data transfer efficiency and tool replacement flexibility in AI training scenarios.

CN123157293APending Publication Date: 2026-11-24SHENZHEN H&T INTELLIGENT CONTROL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611205151.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing general-purpose orchestration frameworks have low data transfer efficiency in MLOps pipelines, making it difficult to meet the low latency requirements of AI training scenarios. They also lack specific semantic support for the machine learning training process and have high tool integration complexity, requiring the rewriting of orchestration logic when replacing tools, resulting in a lack of flexibility.

Method used

The MLOps task execution method, based on pipelined state machine and hardware abstraction layer, is adopted. By creating pipelined state machine execution context, using program counter to drive stage execution, combining data parsing and resource management with the data interface of hardware abstraction layer, and passing data between adjacent stages through zero-copy result objects, it achieves efficient data transfer and resource utilization between stages.

Benefits of technology

It improves the execution efficiency and reliability of MLOps pipelines, reduces the complexity of tool integration, achieves flexible integration capabilities, and meets the low-latency data feed requirements of AI training scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157293A_ABST
    Figure CN123157293A_ABST
Patent Text Reader

Abstract

This application discloses an MLOps task execution method based on a pipelined state machine and a hardware abstraction layer, relating to the field of machine learning operations and maintenance technology. The method includes: in response to a training task, creating a pipelined state machine execution context including a program counter, call stack, and resource handle table; the orchestration engine sequentially executing the data loading phase, training-experimentation loop phase, and model export phase via program counter transitions; in the data loading phase, pulling the dataset through the data interface of the hardware abstraction layer; in the training-experimentation loop phase, allocating and reclaiming resources by querying the resource handle table, and executing an iterative experimentation loop; transferring data through zero-copy result objects during phase switching; and in the model export phase, serializing the training output into a deployable model file. This method solidifies the phase execution order, dynamically allocates and reclaims training resources, and eliminates the overhead of data copying between phases, achieving efficient task execution and resource utilization for MLOps tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning operations and maintenance technology, and in particular to an MLOps task execution method based on pipelined state machine and hardware abstraction layer. Background Technology

[0002] Machine Learning Operations (MLOps) is a methodology and toolkit in the field of machine learning engineering. With the widespread application of machine learning technology, MLOps, as a crucial link connecting model development and production deployment, directly impacts the delivery quality of AI applications through the efficiency and reliability of its pipeline execution. Currently, the construction of MLOps pipelines typically relies on general workflow orchestration frameworks, such as Apache Airflow and Kubeflow Pipelines. However, existing general orchestration frameworks were not designed specifically for machine learning training scenarios, and their application in MLOps has the following shortcomings: On the one hand, existing frameworks have low data transfer efficiency between pipeline stages, making it difficult to meet the low-latency data feed requirements of AI training scenarios. On the other hand, existing frameworks lack native support for the semantics specific to the machine learning training process, and users often need to manually implement various operations during the training process. In addition, existing frameworks are highly coupled with various MLOps tools, and the orchestration logic needs to be rewritten when replacing tools, lacking flexible integration capabilities.

[0003] Therefore, improving the execution efficiency of MLOps pipelines and reducing the complexity of tool integration have become urgent technical problems to be solved in this field. Summary of the Invention

[0004] This application provides an MLOps task execution method based on pipelined state machine and hardware abstraction layer, which can improve the execution efficiency, reliability and scalability of MLOps pipeline.

[0005] Firstly, a method for executing MLOps tasks based on a pipelined state machine and a hardware abstraction layer is provided, including: In response to a received training task, a pipeline state machine execution context corresponding to the training task is created. The pipeline state machine execution context includes a program counter, a call stack, and a resource handle table. The program counter is used to indicate the pipeline stage in which the training task is located, and the value of the program counter remains constant during the execution of any pipeline stage. When the current stage is completed, the program counter increments unidirectionally to jump to the next stage, and jumps step by step according to a preset stage sequence without skipping intermediate stages or reverting to a completed stage in reverse order. The orchestration engine executes multiple pipeline stages sequentially through the transitions of the program counter based on the pipeline state machine execution context. The multiple pipeline stages include at least a data loading stage, a training and experimentation loop stage, and a model export stage. During the data loading phase, the dataset parsing and retrieval operations are performed through the data interface of the hardware abstraction layer; During the training and testing cycle phase, the orchestration engine allocates computing resources for the current training iteration by querying the resource handle table, and reclaims the corresponding resources through the resource handle table; the orchestration engine executes the iterative testing cycle. When switching from the data loading stage to the training and testing cycle stage, and when switching from the training and testing cycle stage to the model export stage, data is transferred between adjacent pipeline stages using zero-copy result objects. Specifically, the result objects are transferred between adjacent stages using a zero-copy method, meaning that references to the result objects are transferred between adjacent stages without serializing or deeply copying the data content carried by the result objects; and each pipeline stage fills different field slots of the zero-copy result objects. During the model export stage, the training output is serialized into a model file.

[0006] Secondly, an MLOps task execution system based on a pipelined state machine and a hardware abstraction layer is provided, including: The context creation module is used to create a pipeline state machine execution context corresponding to the received training task in response to the training task. The pipeline state machine execution context includes a program counter, a call stack, and a resource handle table. The program counter is used to indicate the pipeline stage in which the training task is located, and the value of the program counter remains constant during the execution of any pipeline stage. When the current stage is completed, the program counter increments in one direction to transition to the next stage. The stage execution module is executed by the orchestration engine based on the pipeline state machine execution context, through the transition of the program counter to execute multiple pipeline stages sequentially. The multiple pipeline stages include at least a data loading stage, a training and experimentation loop stage, and a model export stage. The stage execution module is specifically used to perform dataset parsing and retrieval operations through the data interface of the hardware abstraction layer; The stage execution module is further configured to have the orchestration engine allocate computing resources for the current training iteration by querying the resource handle table, and reclaim the corresponding resources through the resource handle table; and to have the orchestration engine execute an iterative test loop. The zero-copy data transfer module is used to transfer data between adjacent pipeline stages through a zero-copy result object. The transfer is to transfer a reference to the result object between adjacent stages without serializing or deep copying the data content carried by the result object, and each pipeline stage fills different field slots of the zero-copy result object respectively. The model export module is used to serialize the training output into a model file during the model export stage. The callback execution module is used to execute the callback chain in a linearized order after the model export stage is completed; The protocol conversion module is used to perform a first protocol conversion operation to convert version control metadata into experimental tracking tags after the data loading phase is completed, to perform a second protocol conversion operation to convert hyperparameter products into model registration requests after the training and experimentation phase is completed, and to perform a third protocol conversion operation to convert data container extension segments into model file header extension attributes within the model export phase; the first protocol conversion operation, the second protocol conversion operation, and the third protocol conversion operation belong to the same transaction boundary.

[0007] Thirdly, an electronic device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform steps as described in the first aspect and any possible implementation thereof.

[0008] Fourthly, a computer storage medium is provided, the computer storage medium storing one or more instructions, the one or more instructions being adapted to be loaded by a processor and executed as described in the first aspect above and any possible implementation thereof.

[0009] This application creates a pipelined state machine execution context, including a program counter, call stack, and resource handle table, in response to training tasks. The orchestration engine sequentially executes the data loading phase, training-testing loop phase, and model export phase via program counter transitions. During the data loading phase, the dataset is retrieved through the hardware abstraction layer's data interface. During the training-testing loop phase, resources are allocated and reclaimed by querying the resource handle table, and an iterative testing loop is executed. Data is transferred via zero-copy result objects during phase switching. In the model export phase, the training output is serialized into a deployable model file. This method solidifies the phase execution order, dynamically allocates and reclaims training resources, and eliminates the overhead of data copying between phases, achieving efficient task execution and resource utilization for MLOps tasks. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.

[0011] Figure 1 A schematic diagram of a system architecture provided for an embodiment of this application; Figure 2 A flowchart illustrating an MLOps task execution method based on a pipelined state machine and a hardware abstraction layer, provided for an embodiment of this application; Figure 3 A schematic diagram of a four-stage state machine (PC) transition provided in an embodiment of this application; Figure 4 A schematic diagram of a hardware abstraction layer hot-plug mechanism provided in an embodiment of this application; Figure 5 This application provides a schematic diagram of the filling mapping relationship of a zero-copy result object at each stage. Figure 6 A schematic diagram of the execution flow of a reverting mediation chain is provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an MLOps task execution system based on a pipelined state machine and a hardware abstraction layer, provided in an embodiment of this application. Detailed Implementation

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

[0013] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. 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 includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0014] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. Embodiments of this application are described below with reference to the accompanying drawings.

[0015] To more clearly illustrate the implementation of the methods in the embodiments of this application, the system architecture in the embodiments of this application will be initially described below.

[0016] Figure 1 This is a schematic diagram of a system architecture provided for an embodiment of this application, specifically illustrating a user-mode-kernel-mode interaction and zero-copy data interconnection architecture in a training execution framework.

[0017] See Figure 1 The method provided in this application embodiment is executed by an orchestration engine. The orchestration engine maintains a pipeline state machine execution context, indirectly calls the underlying tools through the Hardware Abstraction Layer (HAL), passes data between stages through zero-copy result objects, indirectly calls the hook function pointers registered by the user through the virtual function table (vtable), and performs the cleanup operation through a linearized ordered callback chain after the pipeline stage is completed.

[0018] like Figure 1 As shown, the five-layer architecture of this application includes, from bottom to top: Hardware Abstraction Layer (HAL): Defines the abstract method contract for the version control interface and experiment tracking interface. The orchestration engine calls the interface method pointers through indirect calls, without relying on any specific tool implementation. Through-layer: Zero-copy result objects serve as a unified carrier for data transfer between stages. They are passed between adjacent stages through reference identifiers, with each stage incrementally filling different field slots. Kernel mode: Pipeline state machine execution context, including program counter (PC), call stack and resource handle table, orchestration engine executes through PC transition-driven phases; User-mode: Three hook function pointers registered by the user (data loading hook, training hook, and export hook), which are indirectly called through the vtable; Callback chain: A linearized ordered callback chain, which includes pre-training callbacks, experiment reporting callbacks, and post-model registration callbacks, executed in a fixed order.

[0019] Figure 2 This application provides a flowchart illustrating an MLOps task execution method based on a pipelined state machine and a hardware abstraction layer, as shown in the embodiments of this application. Figure 2 As shown, the method includes: 201. In response to the received training task, a pipeline state machine execution context corresponding to the training task is created. The pipeline state machine execution context includes a program counter, a call stack, and a resource handle table. The program counter is used to indicate the pipeline stage in which the training task is located. The value of the program counter remains constant during the execution of any pipeline stage. When the current stage is completed, the program counter increments unidirectionally to transition to the next stage. The program counter transitions step by step according to a preset stage sequence, without skipping intermediate stages or reverting to the completed stage in reverse order. 202. The orchestration engine executes multiple pipeline stages sequentially through the transitions of the program counter based on the above pipeline state machine execution context. The above multiple pipeline stages include at least the data loading stage, the training and experimentation loop stage, and the model export stage. 203. During the data loading phase described above, the dataset parsing and retrieval operations are performed through the data interface of the hardware abstraction layer; 204. During the training and testing cycle phase described above, the orchestration engine allocates computing resources for the current training iteration by querying the resource handle table and reclaims the corresponding resources through the resource handle table; the orchestration engine executes the iterative testing cycle. 205. When switching from the above data loading stage to the above training and experiment cycle stage, and when switching from the above training and experiment cycle stage to the above model export stage, data is transferred between adjacent pipeline stages using zero-copy result objects. The result objects are transferred between adjacent stages in a zero-copy manner, specifically by transferring references to the result objects between adjacent stages without serializing or deep copying the data content carried by the result objects; and each pipeline stage fills the different field slots of the zero-copy result objects respectively. 206. In the above model export stage, the training output is serialized into a model file.

[0020] The orchestration engine mentioned in this embodiment is the core execution entity of this application, essentially an execution context of a pipeline state machine. The orchestration engine maintains an orchestration context for each training lifecycle, analogous to the design of an operating system kernel maintaining a process control block (PCB) for each process. The orchestration engine is responsible for driver counter transitions, managing the call stack and resource handle table, executing iterative trial loops, indirectly calling tool interfaces through the HAL, and indirectly calling user hooks through the vtable.

[0021] The pipelined state machine execution context in this embodiment can be understood as the set of states maintained by the orchestration engine for each training task, including the following key data structures: In this embodiment, the program counter (PC) points to the current stage number. The orchestration engine determines the next stage entry function to be executed based on the current value of the PC. The value of the PC remains constant during the execution of any pipeline stage, and increments unidirectionally to transition to the next stage upon completion of the current stage. The call stack in this embodiment stores callback function pointers registered at each stage, and may include data loading hook function pointers, training hook function pointers, export hook function pointers, pre-training callback function pointers, and post-model registration callback function pointers. When entering each stage, the orchestration engine retrieves the corresponding function pointer from the call stack and indirectly calls and executes it through the virtual function table. The resource handle table in this embodiment stores references to system resources held by the orchestration engine, including GPU memory context handles, CPU thread pool references, network connection pool references, and file descriptors. At the end of its lifecycle, the orchestration engine is responsible for traversing the resource handle table to perform resource release. For the Hardware Abstraction Layer (HAL) in this embodiment, the orchestration engine does not directly depend on the application programming interface of any specific tool, but can rely on two abstract interface contracts: the Data VersionControl Interface and the Experiment Tracking Interface. The orchestration engine calls the method pointers of the interfaces through indirect calls, without caring whether the underlying implementation is the GitHub API, GitLab API, MinIO object storage, MLflow tracking server, or Weights & Biases cloud service; The zero-copy result object in this embodiment can be understood as a unified carrier for data transfer between stages, including fields such as a label dictionary, parameter fields, indicator dictionary, feature name list, target name list, data partitioning dictionary, model path, product file path list, and trainer reference. Only one instance of this object exists in the heap memory, and each stage accesses the same instance through a reference identifier (a pointer or a smart pointer with a reference count incremented by 1). During inter-stage transfer, only the reference identifier is transferred; no deep copy is performed.

[0022] The aforementioned iterative trial loop refers to the loop structure automatically executed by the orchestration engine within the training trial loop phase. This loop may include sampling hyperparameters, injecting training functions, collecting return values, and determining whether to stop early or retry. The orchestration engine natively supports the early stopping primitive (break) and the retry primitive (continue).

[0023] The process in this embodiment mainly involves three stages: data loading stage, training and experimentation cycle stage, and model export stage. Optionally, a data version retrieval stage can be set before the data loading stage. This stage is optional and can be enabled or skipped according to the actual deployment scenario.

[0024] For ease of description, this application designates the data version retrieval phase as Phase 0, the data loading phase as Phase 1, the training and experimentation loop phase as Phase 2, and the model export phase as Phase 3.

[0025] As an example, in a cloud GPU cluster deployment scenario, the orchestration engine executes phases 1, 2, and 3 sequentially, skipping phase 0. In an ARM edge device deployment scenario, phases 1, 2, and 3 are also executed sequentially, skipping phase 0 and the post-phase callback chains, but the engine's PC transition control logic and the early stop / retry primitives of the trial loop remain completely unchanged.

[0026] Specifically, according to Figure 2 In the illustrated embodiment, when a training task arrives, the orchestration engine first creates a pipelined state machine execution context for that task. This context may include a program counter initialized to 0, a call stack pre-registered with pointers to callback functions for each stage, and a resource handle table initially empty.

[0027] The orchestration engine then reads the current value of the program counter and determines the next pipeline stage to be executed. The program counter starts at 0 and increments sequentially through the data loading stage, training / experimentation cycle stage, and model export stage. During each stage, the program counter remains constant; upon completion of the stage, the orchestration engine increments the program counter by 1, pointing to the next stage.

[0028] During the data loading phase, the orchestration engine can indirectly call the underlying tools to parse and fetch the dataset through the data interface of the hardware abstraction layer. The orchestration engine does not care whether the underlying tool is the GitHub API, MinIO object storage, or the local file system; it only completes the operation through a unified data interface method pointer. At the same time, the orchestration engine calls the user-registered data loading hooks through the data loading hook function pointers in the call stack to execute user-defined data preprocessing logic.

[0029] After data loading is complete, the orchestration engine increments the program counter by 1, entering the training trial loop phase. In this phase, the orchestration engine automatically executes an iterative trial loop: sampling a set of hyperparameters, passing the hyperparameters and training data to the training function for one training iteration, obtaining the execution result from the return value, and determining the next operation based on the execution result and preset termination conditions. When the pruner determines that the current trial has no prospects, the orchestration engine triggers an early stopping primitive, terminating the current trial and reclaiming resources; when the trial fails due to a recoverable exception, the orchestration engine triggers a retry primitive, re-executing the current trial with adjusted parameters. At the beginning of each training iteration, the orchestration engine allocates computational resources for the current iteration by querying the resource handle table; at the end of each iteration or when an early stopping primitive is triggered, the corresponding resources are reclaimed through the resource handle table.

[0030] When switching from the data loading phase to the training / experimentation phase, and vice versa, the orchestration engine can transfer data between adjacent phases using zero-copy result objects. The zero-copy result object is a unique instance in the heap memory, accessed by each phase via a reference identifier. Only the reference identifier is transferred between phases; no deep copy is performed. Each phase incrementally populates the zero-copy result object: the data loading phase populates the feature name and data partition fields; the training / experimentation phase populates the parameter and metric fields; and the model export phase populates the model path field. Each phase only writes to the fields and slots it is responsible for, without overwriting data already written by other phases.

[0031] After all trials are completed, the orchestration engine increments the program counter to the model export stage. In this stage, the orchestration engine calls the user-registered export hooks by calling the export hook function pointers in the call stack, serializing the training output into a deployable model file in the specified format.

[0032] Specifically, for Figure 2 The various steps or stages involved in the illustrated embodiments will be described in detail below.

[0033] 1. Context initialization This application designs an internal orchestration engine. The essence of this orchestration engine is not a regular user-mode class instance, but rather an execution context of a pipeline state machine. Analogous to the design concept of an operating system kernel maintaining a Process Control Block (PCB) for each process, this application maintains an orchestration context for each training lifecycle. This application is implemented in user-mode runtime; the kernel primitives mentioned are for analogy purposes and not actual kernel-mode code. This context contains the following key data structures in heap memory: Program Counter (PC): Points to the current stage number (e.g., stage 0 / 1 / 2 / 3). The orchestration engine determines the next stage entry function to be executed based on the current PC value. The stage jump rules are fixed at compile time: Stage 0 (if enabled) → Stage 1 → Stage 2 → Stage 3, which cannot be skipped or reversed.

[0034] Call stack: Stores callback function pointers registered at each stage. This includes, but is not limited to: data loading hook function pointers, training hook function pointers, export hook function pointers, pre-training callback function pointers, and post-model registration callback function pointers. When entering each stage, the orchestration engine retrieves the corresponding function pointer from the call stack and executes it via indirect calls.

[0035] Resource handle table: This table stores system resource references held by the orchestration engine—GPU memory context handles, CPU thread pool references, network connection pool references, and file descriptor tables. At the end of its lifecycle, the orchestration engine is responsible for traversing the resource handle table to perform resource release (similar to resource reclamation when an operating system process terminates).

[0036] As in step 201, the orchestration engine maintains an independent pipelined state machine execution context for each training task, which is allocated in heap memory. Specifically, the program counter (PC) is initialized to 0, pointing to the first pipeline stage. The PC value remains unchanged during stage execution, ensuring that operations within a stage do not result in race conditions due to PC changes. After the orchestration engine completes all operations in the current stage, the PC value is incremented by 1, pointing to the next stage. The PC transition rules are fixed at compile time in the orchestration engine, and the determinism of stage jumps is guaranteed by the engine rather than user coding discipline.

[0037] The call stack described above pre-registers callback function pointers for each stage. When the orchestration engine enters each stage, it retrieves the corresponding function pointer from the call stack and indirectly calls and executes it through the virtual function table.

[0038] The resource handle table is initially empty and is dynamically filled and recycled during subsequent execution stages.

[0039] As an example, when a hyperparameter optimization training task is received, the orchestration engine can create a pipelined state machine execution context with a PC initial value of 0. The call stack has function pointers for data loading hooks, training hooks, and export hooks pre-registered, and the resource handle table is initially empty.

[0040] 2. Stage-driven As in step 202, the orchestration engine executes multiple pipeline stages sequentially based on the pipeline state machine execution context created in step 201, using program counter transitions. The orchestration engine reads the current value of the program counter and determines the current pipeline stage to be executed. Each stage corresponds to a stage entry function, which the orchestration engine executes indirectly. When the stage entry function returns, the orchestration engine increments the program counter by 1 and proceeds to the next stage.

[0041] Figure 3 This is a schematic diagram of a four-stage state machine (PC) transition provided in an embodiment of this application.

[0042] The orchestration engine standardizes the entire training lifecycle into a four-stage state machine transition: Stage 0 (optional) data version retrieval → Stage 1 data loading → Stage 2 hyperparameter optimization (including an experimental loop) → Stage 3 model export. The PC transitions are automatically driven by the orchestration engine; users only need to provide hook function pointers for each stage.

[0043] like Figure 3 As shown, after receiving a training task, the orchestration engine can specifically perform the following steps: After the user calls the entry method, the pipeline state machine performs context instantiation, sets the PC to 0, and sets the hook function pointers and resource handle table in the call stack to null; Then, the system enters phase 0, where PC = 0. The system checks whether the HAL interface has been injected and implemented: if so, it indirectly calls the version control interface and executes resolve, pull, and metadata mounting in sequence; if not, it increments PC by 1 and skips phase 0. Next, we enter Phase 1, where PC = 1. The orchestration engine indirectly calls the data loading hook function pointer, returning a reference to the generic data container; Then, in Phase 2, PC=2. The orchestration engine creates an optimization research experiment loop, sequentially performing sampling, injection, early stopping or retrying, and finally making the optimal selection. Then, proceeding to stage 3, PC=3. The orchestration engine indirectly calls the exported hook function pointer, returning the model file path; After all stages are completed, post-stage processing begins: the linearized callback mediation chain is executed in a fixed order, namely the pre-training callback, the experiment reporting callback, and the post-registration callback. This fixed order is used to prevent foreign key constraint failure.

[0044] 3. Data loading stage As described in step 203 above, during the data loading phase, the orchestration engine indirectly calls the implementation of the underlying tools through the data interface of the hardware abstraction layer. In this embodiment, the hardware abstraction layer defines an abstract interface contract, and the orchestration engine only relies on the method pointers of the interface, without caring about the specific underlying implementation. The data interface defines the parsing and retrieval operations of the dataset, and the orchestration engine performs these operations by indirectly calling the method pointers of this interface.

[0045] As an example, the aforementioned data interface could be a version control interface, which defines methods for parsing version tags and fetching data. For instance, when the underlying implementation is the GitHub API, the orchestration engine indirectly calls the GitHub API to parse the latest release tag and fetch data from the remote repository; when the underlying implementation is MinIO object storage, the orchestration engine parses the version tag in the object storage and fetches data through the same interface method pointers. The core control flow code of the orchestration engine does not need to be recompiled due to changes in the underlying tools.

[0046] During the data loading phase, the orchestration engine can also invoke user-registered data loading hooks via function pointers in the call stack. These hooks receive the data root directory and return a generic data container. Users can implement custom data preprocessing logic through these hooks, such as data cleaning, feature engineering, and data augmentation.

[0047] Figure 4 This is a schematic diagram of a hardware abstraction layer (HAL) hot-plug mechanism provided in an embodiment of this application.

[0048] like Figure 4 As shown, the HAL hot-plug mechanism is demonstrated: the orchestration engine only depends on the method pointers of the abstract interface (indirect calls), the underlying tool implementation is replaceable, and the engine control flow bytecode does not need to be recompiled.

[0049] Specifically, during the startup or configuration loading phase, the orchestration engine first reads the metadata namespace or configuration object to determine whether the backend implementations of each interface of the hardware abstraction layer have been injected; then it proceeds to the first judgment node: whether the implementation of the first interface of the hardware abstraction layer, namely the version control interface, has been injected. If the implementation of the version control interface has been injected, the left branch is executed: the orchestration engine indirectly calls the method pointer of this interface to sequentially perform version resolution, data pull, and metadata mounting operations. The underlying implementation of this interface can be the GitHub API, GitLab API, or MinIO object storage; the orchestration engine is unaware of the specific backend identity.

[0050] If the implementation of the version control interface is not injected, or if a null implementation is injected, the right branch is executed: the orchestration engine does not perform data version retrieval and metadata mounting operations, the program counter is incremented directly, and the corresponding optional stage is skipped.

[0051] After the two branches are completed, they merge and enter the main pipeline flow: the orchestration engine executes Phase 1 data loading, Phase 2 training and experimentation loop, and Phase 3 model export in sequence. The control flow bytecode of this main flow is decoupled from the underlying tool implementation. Regardless of whether the backend of the version control interface is GitHub, GitLab, MinIO, or an empty implementation, the execution logic of Phases 1 to 3 remains unchanged.

[0052] After the main pipeline process is completed, the second judgment node is entered: whether the implementation of the second interface of the hardware abstraction layer, namely the experimental tracking interface, has been injected. If the implementation of the experiment tracking interface has been injected, the left branch is executed: the orchestration engine indirectly calls the method pointer of this interface to report experiment information in batches, including six types of information such as parameters, metrics, and model paths. The underlying implementation of this interface can be an MLflow tracking server, Weights & Biases cloud service, or a self-built tracking service; the orchestration engine is unaware of the specific backend identity.

[0053] If the implementation of the experiment tracking interface is not injected, or if an empty implementation is injected, the right branch is executed: the orchestration engine skips the experiment reporting operation, and the pipeline ends directly.

[0054] Through the above mechanism, the backend implementation of the hardware abstraction layer can be injected or replaced through configuration without modifying the core code of the orchestration engine. The data version retrieval operation in phase 0 and the experimental reporting operation after the phase can be enabled or skipped according to the actual deployment scenario, while the main flow control logic of phases 1 to 3 remains unchanged.

[0055] The key feature of this HA design in this application embodiment is "hot swapping": replacing the experiment tracking frontend from one implementation to another (e.g., from MLflow to Weights & Biases) only requires replacing the interface implementation instance in the configuration field with another instance that implements the same interface contract, while the core control flow code of the orchestration engine does not need to be recompiled or reloaded. The PC transition logic, experiment loop control logic, and resource reclamation logic of the orchestration engine are completely unaffected by changes in the underlying tool implementation. This is fundamentally different from the practice of commercial platforms coupling tool implementations with orchestration control flow at the source code level: replacing tools in commercial platforms requires modifying the platform source code, while replacing tools in this invention only requires injecting different interface implementation instances. It needs to be clarified that hot swapping in this invention refers to changing the underlying tool implementation between two independent pipeline runs; the orchestration engine loads the interface implementation instance after a single run starts and does not dynamically switch during the run.

[0056] Furthermore, in this application, the orchestration engine injects user-defined business logic through three domain hooks: a data loading hook, a training hook, and an export hook. These three hooks correspond to the three core stages of the pipeline. By implementing the hook interfaces and registering function pointers to the call stack, users can customize the behavior of each stage without modifying the core code of the orchestration engine.

[0057] The data loading hook is registered on the call stack and indirectly invoked by the orchestration engine in Phase 1. This hook receives the data root directory as input and returns a reference to a generic data container. Users can implement custom logic for data reading, format parsing, data cleaning, feature engineering, or data augmentation within the data loading hook. The function pointer of the data loading hook is pre-registered on the call stack when the pipeline state machine execution context is instantiated. The orchestration engine indirectly invokes this pointer through the virtual function table during Phase 1 execution, unaware of the specific data reading implementation.

[0058] The training hook is registered in the call stack and indirectly invoked by the orchestration engine in Phase 2. This hook receives hyperparameters and training data as input, performs one training iteration, and returns the results (including metrics and training output references). Users can implement custom logic such as model building, training loops, loss functions, and evaluation metric calculations within the training hook. The function pointer of the training hook is also pre-registered in the call stack during context instantiation, and the orchestration engine executes the hook indirectly in each trial iteration.

[0059] The export hook is registered on the call stack and indirectly invoked by the orchestration engine in phase 3. This hook receives the training output and the export directory as input, serializes the training output into a model file of the specified format, and returns the model file path. Users can implement custom logic such as model serialization, format conversion, model quantization, or compression within the export hook. The function pointer of the export hook is pre-registered on the call stack during context instantiation, and the orchestration engine executes the hook indirectly during phase 3 execution.

[0060] The registration of all three hooks is completed when the pipeline state machine execution context is instantiated, rather than dynamically during stage execution. When entering each stage, the orchestration engine retrieves the hook function pointer for that stage from the call stack and indirectly calls it through the virtual function table. The specific implementation of the hooks is decoupled from the core control flow of the orchestration engine, so users do not need to modify the orchestration engine code when changing the hook implementation.

[0061] Further, this application also provides the following optional hooks for users to implement as needed: A simulated data generation hook is used to run validation scenarios. When this hook is enabled, the orchestration engine uses simulated data instead of the real dataset to execute the pipeline during the data loading phase, validating the correctness of the pipeline configuration without consuming actual data resources.

[0062] The optimal trial selection hook is used in multi-objective Pareto front selection scenarios. When multiple candidate trial results are generated during the training trial cycle, the orchestration engine uses this hook to select one or more optimal trial products from multiple trials for subsequent model derivation.

[0063] The pre-training callback hook is invoked before the experiment is reported. Users can perform modification operations on the zero-copy result object in this hook, such as appending evaluation charts and adjusting indicator values.

[0064] The callback hook after model registration is invoked after the model is registered to the model library. Users can trigger downstream deployment actions in this hook, such as pushing the model to the inference service or updating the model version tag.

[0065] All of the optional hooks mentioned above have default implementations. For example, the default implementation of the optimal trial selection hook is to select the trial corresponding to the maximum value of the first objective; the default implementations of the pre-training callback hook and the post-model registration callback hook are no operation. When the user does not override the optional hooks, the orchestration engine uses the default implementation to work normally; when the user overrides the optional hooks, the orchestration engine indirectly calls the user's custom implementation through the function pointer in the call stack.

[0066] The function pointers for the aforementioned hooks are pre-registered to the call stack during the instantiation of the pipeline state machine execution context. When entering each stage, the orchestration engine can retrieve the corresponding hook function pointer from the call stack and indirectly call it through the virtual function table. The specific implementation of the hooks is decoupled from the core control flow of the orchestration engine, so users do not need to modify the orchestration engine code when changing the hook implementation.

[0067] 4. Training and Experiment Cycle Phase As in step 204, during the training trial loop phase, the orchestration engine allocates computing resources for the current training iteration by querying the resource handle table, and reclaims the corresponding resources by querying the resource handle table when each training iteration ends or when an early stopping primitive is triggered; the orchestration engine executes an iterative trial loop, which is driven by the early stopping primitive and retry primitive natively supported by the orchestration engine.

[0068] The training / experimentation loop phase is the key difference between this application and general pipeline orchestration frameworks. The orchestration engine natively understands the domain semantics of the "experimentation loop" and automatically executes the loop structure within this phase. See also... Figure 3 The experimental loop within Phase 2, an iterative experimental loop, includes: sampling a set of hyperparameters, passing the hyperparameters and training data into the training function to perform one training iteration, obtaining the execution result from the return value of the training function, and, based on the execution result and a preset termination condition, the orchestration engine decides to end the current experiment and enter the next experiment, re-execute the current experiment, or drive the program counter to jump to the model export stage after all experiments are completed.

[0069] The orchestration engine natively supports the following loop control primitives: Early stopping primitive (break): When the pruner determines that the current trial has no future, the orchestration engine terminates the current trial, reclaims GPU resources, and proceeds to the next trial. When the early stopping primitive is triggered, the program counter value remains unchanged.

[0070] The retry primitive (continue): When an experiment fails due to a recoverable exception (such as a network timeout, insufficient GPU memory, or a need to downgrade the batch size), the orchestration engine re-executes the current experiment with adjusted parameters. When the retry primitive is triggered, the program counter remains unchanged.

[0071] Specifically, at the start of each training iteration, the orchestration engine allocates the necessary computing resources for the current iteration by querying the resource handle table, including GPU memory and thread pool resources. At the end of each training iteration or when an early stopping primitive is triggered, the orchestration engine reclaims the corresponding resources through the resource handle table to ensure that resources are not leaked.

[0072] 5. Zero-copy data transfer As in step 205, when switching from the data loading stage to the training and testing cycle stage, and when switching from the training and testing cycle stage to the model export stage, data is transferred between adjacent pipeline stages through zero-copy result objects.

[0073] This application's embodiments design a standardized training result object as a unified carrier for data transfer between stages. This result object may contain the following fields: label dictionary, parameter field, indicator dictionary, feature name list, target name list, data partition dictionary, model path, product file path list, and trainer reference.

[0074] Specifically, the core design principle for transferring the aforementioned result objects between stages is "zero-copy transfer—deep copying is strictly prohibited." Its underlying mechanism is as follows: Move semantics, or reference counting, means that when a result object is passed between stages, a pointer (or a smart pointer with a reference count incremented by 1) to the same result object instance in heap memory is passed, rather than a deep copy of the object. When stage 2 writes test parameters to the object's parameter dictionary, stage 3 reads the same dictionary object from the same heap memory address, eliminating the need to serialize and deserialize the parameter dictionary to disk. It should be noted that the "same heap memory instance" assumption applies by default to inter-stage passing within a single process. When cross-process (e.g., data preprocessing process and training process are separated) or cross-GPU nodes (distributed training scenario), this invention can achieve zero-copy based on the underlying hardware architecture's support for extended implementation: In a single-node multi-GPU scenario, CUDA IPC is used to achieve zero-copy across devices through memory sharing; in a single-node multi-CPU process scenario, inter-process shared memory segments (System V SHM or POSIX mmap) are used for passing, and pointers are serialized with memory offsets to avoid address space incompatibility; in a cross-node GPU cluster scenario, RDMA is used to achieve cross-node zero-copy, avoiding the memory copy overhead of the traditional TCP / IP protocol stack.

[0075] Incremental population instead of full replacement: Each stage incrementally populates data into the corresponding fields of the same result object. Stage 0 populates the tag dictionary (including version tags and other metadata), Stage 1 populates feature names and data partitions, Stage 2 populates parameters and metrics, and Stage 3 populates model paths and output file paths. Each stage populates different field slots of the same set of memory instances, and there is no copy chain of "previous stage produces temporary object → serialization → subsequent stage deserialization → populate new object".

[0076] In one specific implementation, incremental padding is performed on the zero-copy result object at each stage: During the data loading phase, populate the feature name field and the data partitioning field; During the training and experimentation cycle, populate the parameter and indicator fields; During the model export phase, populate the model path field.

[0077] Each stage only writes to the field slots it is responsible for, and will not overwrite data already written by other stages.

[0078] Figure 5 This is a schematic diagram illustrating the filling mapping relationship of a zero-copy result object at each stage, as provided in an embodiment of this application.

[0079] like Figure 5 As shown, this illustrates how data is transferred between different pipeline stages using zero-copy result objects. Figure 5 The left side lists the write content of the same result / zero-copy result object in different stages in sequence, and the right side shows the normalized result object instance corresponding to the zero-copy result object in the heap memory. Each stage does not directly copy the data body, but shares the same result object through "naked pointer" or reference counting.

[0080] In phase 0, the result is written to the tag dictionary. This corresponds to the data version retrieval or initialization phases that populate the tag / version metadata in the result object. Figure 5 The "tag dictionary" on the right is referenced by stage 0 on the left through a raw pointer, indicating that after stage 0 is executed, the tag-related information is attached to the unified result object; In Phase 2, the result is written to the parameter dictionary and the metric dictionary. This corresponds to the training experiment loop phase. During training, the hyperparameters sampled and the metrics returned by the training function are written to the parameter and metric fields of the same zero-copy result object. Both the "parameter dictionary" and "metric dictionary" on the right point to the same result object instance in heap memory via raw pointers. In Phase 1, the result contains a list of feature names / target names and data partitioning information. This corresponds to the data loading phase. After the data loading hook returns to the general data container, the orchestration engine extracts or records the feature names, target names, data partitioning, etc., and populates the result object. The "Feature Name / Target Name List" and "Data Partition Dictionary" on the right also reference the same result object using raw pointers. In Phase 3, the result is written to the model path / product path. This corresponds to the model export phase. After the export hook serializes the training products into model files, it returns the model file path or a list of product paths, which is written to the result object. The "Model Path" and "List of Product File Paths" on the right indicate the location of the final model file that can be deployed or registered for use in this phase.

[0081] Figure 5The trainer reference mentioned in the text indicates that, in addition to being accessed by each stage through raw pointers, the standardized result object instance is also held by the trainer or related execution entities for subsequent callbacks, reporting, registration, or deployment.

[0082] Figure 5 The reference passing at each stage (pointer / reference count + 1) mentioned in the text means that what is passed between stages is a pointer or reference to the same result object, rather than a complete copy of the result object. The reference count is incremented by 1 each time a stage is entered or a subject holds the object; the corresponding reference count is decremented when a stage ends or the subject releases the object. This avoids repeatedly copying large amounts of data, dictionaries, path lists, etc., between stages.

[0083] Figure 5 The "heap memory: standardized result object instance (one unique copy)" mentioned means that only one result object with a uniform structure is maintained throughout the entire pipeline process, and each stage fills in different fields according to its own responsibilities.

[0084] In general, in the embodiments of this application, each stage of the pipeline accesses and populates fields by using pointers / references to the same zero-copy result object, thereby enabling the transfer of data information between stages, avoiding data duplication, and ensuring that only one standardized result object instance is ultimately formed.

[0085] The zero-copy design described above is the essence that distinguishes this application from general pipeline orchestration frameworks (such as Apache Airflow). Airflow's XCom mechanism requires upstream tasks to serialize the return value into a byte stream and store it in a metadata database (PostgreSQL / MySQL), and downstream tasks then read the byte stream from the metadata database and deserialize it. This "disk-to-disk read" mode involves disk I / O writes (approximately 100-200 MB / s) and disk I / O reads (approximately 100-200 MB / s) when transferring 1GB of intermediate training results between stages, with a round trip time of about 5-10 seconds, during which the GPU is completely idle. The zero-copy reference passing in this application is completed in the same process heap memory, taking only milliseconds (only pointer assignment or reference counting atomic operations), and the GPU idle window is shortened by about three orders of magnitude. This difference is a key architectural advantage in AI training scenarios that support high-speed data loading (such as GPU data feed pipelines that require each batch of data to be ready within 10ms).

[0086] 6. Model Export Stage As in step 206, during the model export phase, the orchestration engine calls the user-registered export hooks via export hook function pointers in the call stack. The export hooks receive the training output and export directory as input, serialize the training output into model files of a specified format, and return the model file path. The serialized model files can be directly used for subsequent model deployment.

[0087] As an example, in an ARM edge device deployment scenario, the export hook serializes the weights of a lightweight anomaly detection model into '.tflite' format and writes them to the local Flash file system. In a cloud GPU cluster deployment scenario, the export hook serializes the weights of a large language model into '.safetensors' format and writes them to a distributed file system.

[0088] In one alternative implementation, during the execution of multiple pipeline stages, the orchestration engine also performs protocol conversion operations during stage transitions. These protocol conversion operations convert the data format produced by the previous stage into the input data format required by the next stage or an external system, eliminating the need for users to manually write format conversion code in the training scripts.

[0089] Specifically, in this application, the orchestration engine can perform three protocol conversion operations at three stage switching points: The first protocol conversion operation occurs after the data loading phase is completed and before switching to the training / experimentation cycle phase. The orchestration engine converts the version control metadata obtained through the version control interface of the hardware abstraction layer during the data loading phase into experiment tracking tags. As an example, when the version control backend returns a data version tag of "v1.2.3-pre" with a corresponding SHA value of "a1b2c3d", the protocol conversion layer automatically maps the version tag "v1.2.3-pre" to the "data_version" tag of the experiment tracking frontend, and maps the complete SHA value "a1b2c3d…" to the "data_sha" tag. The converted experiment tracking tags are written to the corresponding field slot of the zero-copy result object for use in subsequent experiment reporting callbacks.

[0090] The second protocol conversion operation occurs after the training and experimentation cycle is completed and before switching to the model export phase. The orchestration engine converts the hyperparameter output from the training and experimentation cycle into a model registration request. The hyperparameter output includes the hyperparameter combinations sampled in the experiment and their corresponding training metrics. The model registration request includes fields such as model name, model version, hyperparameter configuration, and performance metrics. The converted model registration request is written to the corresponding field slots of the zero-copy result object for subsequent callbacks after model registration.

[0091] The third protocol conversion operation occurs within the model export stage. The orchestration engine converts the data container extension segment into model file header extension attributes. The data container extension segment contains additional metadata from the training process, such as data version information, training environment information, and custom labels. The converted model file header extension attributes are appended to the model file exported through the model export stage, enabling the model file to carry complete training traceability information.

[0092] The first, second, and third protocol conversion operations belong to the same transaction boundary. In this embodiment, the same transaction boundary means that all three protocol conversion operations either execute successfully or none occur. If an exception occurs during the execution of the second or third protocol conversion operation, the orchestration engine rolls back the executed first protocol conversion operation, restoring it to the state at the completion of the data loading phase. This transaction boundary ensures the atomicity of cross-tool operation logic, avoiding an intermediate state where version control metadata has been converted but the model registration request has not been generated.

[0093] In one alternative implementation, the method further includes: After the model export stage is completed, the linearized ordered callback chain is executed in a preset order. The linearized ordered callback chain includes pre-training callback, experiment reporting callback, and post-model registration callback. The pre-training callback is used to modify the zero-copy result object before the experiment is reported; the experiment reporting callback performs log recording through the experiment tracking interface of the hardware abstraction layer, obtains the experiment identifier and writes the experiment identifier into the zero-copy result object; the post-model registration callback performs post-processing operations based on the experiment identifier in the zero-copy result object.

[0094] The linearized ordered callback chain mentioned in this application refers to callbacks executed sequentially in a fixed and unchangeable order after the model export phase is completed. These callbacks mainly include pre-training callbacks, experiment reporting callbacks, and post-model registration callbacks. This fixed order is designed to eliminate foreign key constraint failures caused by the failure to generate an experiment ID during concurrent execution.

[0095] After the model export phase is complete, the orchestration engine can execute a linearized ordered callback chain in a pre-defined, fixed order. This callback chain contains three callbacks, executed in a fixed order: pre-training callback, experiment reporting callback, and post-model registration callback. Specifically: The pre-training callback is executed as the first callback in the linearized ordered callback chain. This callback is invoked before experiment reporting and is used to perform modification operations on the zero-copy result object, including appending evaluation charts, adjusting metric values, and supplementing custom metadata. After this callback completes, the orchestration engine continues to execute the next callback.

[0096] The experiment reporting callback is executed as the second callback in a linearized ordered callback chain. This callback performs logging through the experiment tracing interface of the hardware abstraction layer, reporting information such as parameters, metrics, and model paths during training to the experiment tracing backend. After execution, this callback returns an experiment identifier, which the orchestration engine writes to a zero-copy result object.

[0097] The model registration callback is executed as the last callback in a linearized, ordered callback chain. This callback performs post-processing operations based on the experiment identifier in the zero-copy result object, including registering the model file to the model library and storing it in association with the experiment identifier, or triggering downstream deployment actions.

[0098] In traditional MLOps frameworks, experiment reporting and model registration are typically called manually by the user in the training script or executed concurrently by the framework. During concurrent execution, the execution order of experiment reporting and model registration is uncertain, potentially leading to situations where the experiment identifier has not yet been generated when the model is registered, resulting in foreign key constraint failures or data inconsistencies. This application eliminates these problems through a fixed-order design of a linearized ordered callback chain. The experiment reporting callback is executed in the second step, and its returned experiment identifier exists in a zero-copy result object in heap memory after the second step returns. The model registration callback in the third step reads the experiment identifier from the same zero-copy result object, eliminating the time window where the third step completes before the second. The three callbacks are executed serially in a fixed order, with the output of the previous callback directly passed to the next callback through the zero-copy result object, requiring no additional synchronization mechanisms or lock protection.

[0099] In one alternative implementation, the execution of the linearized ordered callback chain follows a preset failure handling strategy: When the pre-training callback fails, the orchestration engine terminates the current experiment and does not proceed to the subsequent experiment reporting and model registration process.

[0100] When the pre-training callback executes successfully but the experiment reports a failure, the orchestration engine skips the post-model registration callback and propagates the error to the top-level exception handling.

[0101] When the callback execution fails after model registration, the orchestration engine rolls back the executed model registration operation and restores the state when the model export stage is completed.

[0102] In this embodiment, the execution of the linearized ordered callback chain depends on whether the experimental tracing interface of the hardware abstraction layer has been injected with a concrete implementation. When the experimental tracing interface has been injected and is not empty, the orchestration engine executes the complete callback chain. When the experimental tracing interface has not been injected and is empty, the orchestration engine skips the entire callback chain, and the pipeline terminates directly after the model export stage.

[0103] Figure 6 This is a schematic diagram of a reverting mediation chain execution flow provided in an embodiment of this application. Figure 6As shown, the execution order of the callback chain is illustrated in a sequence diagram: pre-training callback hook → experiment reporting → post-model registration callback hook. These three are executed in a fixed order, with the output of the former serving as the input of the latter. This ordered chain makes the post-training processing logic scalable and conflict-free.

[0104] To further illustrate the versatility of the technical solution presented in this application, the following verification is conducted through two extreme deployment scenarios. These two scenarios differ in hardware architecture, operating system, data source, model format, and integration depth. However, the orchestration engine of this application can be adapted simply through hardware abstraction layer interface injection and hook function pointer injection. The program counter transition logic, experimental loop control logic, zero-copy result object reference passing logic, and resource handle table reclamation logic within the engine remain consistent under both deployments.

[0105] Scenario A: ARM edge device deployment The deployment environment is an ARM Cortex-A series microprocessor with 512MB RAM, no GPU, no distributed file system, and no external experimental tracking service, which is used in a smart refrigerator.

[0106] The configuration and execution status of each stage are as follows: Phase 0 (Data Version Fetch): Skipped. The version control interface injected by the hardware abstraction layer is an empty implementation. After the orchestration engine determines that the interface has not been injected in Phase 0, the program counter is directly incremented, and this phase is skipped.

[0107] Phase 1 (Data Loading): The data loading hook reads sensor timing data from the local Flash file system and returns a reference to a generic data container.

[0108] Phase 2 (Training Trial Loop): The number of trials is set to 10, and the search space contains only 2 integer hyperparameters. The orchestration engine automatically executes 10 trial loops, sampling a set of hyperparameters for each trial and passing them to the training hook, collecting the return values. Since there is no GPU, the resource handle table only involves the allocation and reclamation of CPU thread pool resources.

[0109] Phase 3 (Model Export): The export hook serializes the training output into .tflite format, writes it to the local Flash file system, and returns the model file path.

[0110] Post-stage callback chain: Skipped. The experimental tracing interface injected by the hardware abstraction layer has an empty implementation. After the orchestration engine determines that the interface has not been injected after the stage, it skips the entire callback chain, and the pipeline ends directly.

[0111] The program counter transition path for the entire pipeline is: Phase 0 (skipped) → Phase 1 → Phase 2 → Phase 3. Phase 0 is skipped, and the callback chain after the phase is skipped, but the program counter transition control logic of the orchestration engine, the early stop primitives and retry primitives of the trial loop, the reference passing mechanism of the zero-copy result object, and the allocation and reclamation logic of the resource handle table are completely consistent with the cloud deployment scenario.

[0112] Scenario B: Cloud GPU Cluster Deployment The deployment environment is a 4-node x86_64 cluster with 8 GPUs, equipped with a distributed file system and external experiment tracing service.

[0113] The configuration and execution status of each stage are as follows: Phase 0 (Data Version Pull): Enabled. The version control interface of the hardware abstraction layer injects the GitHub TagResolver implementation. The orchestration engine resolves the data version tags and pulls the dataset from the remote repository by indirectly calling the method pointer of this interface, and mounts the version metadata to the zero-copy result object.

[0114] Phase 1 (Data Loading): The data loading hook loads a massive text corpus from the distributed file system and returns a reference to a general data container.

[0115] Phase 2 (Training Trial Loop): The number of trials is set to 200, the parallelism is set to 8, and the median pruning is enabled. The orchestration engine automatically executes 200 trial loops. In each trial, a set of hyperparameters is sampled and passed to the training hook, and the return values ​​are collected. When the median pruning determines that the median metric of a trial is lower than the historical median, the early stopping primitive is triggered. The orchestration engine immediately terminates the trial, reclaims the GPU memory it occupies, and allocates the GPU to the next trial to be executed.

[0116] Phase 3 (Model Export): The export hook serializes the weights of the large language model into .safetensors format, writes them to the distributed file system, and returns the model file path.

[0117] Post-stage callback chain: Full execution. The experiment tracking interface of the hardware abstraction layer injects the MLflow tracking server implementation. The orchestration engine executes the pre-training callback, experiment reporting callback, and model registration callback in a fixed order. The experiment reporting callback indirectly calls the method pointer of the experiment tracking interface to report information such as parameters, metrics, and model paths to the MLflow server, returns an experiment identifier, and writes it to a zero-copy result object. The model registration callback registers the model file to the model library based on this experiment identifier.

[0118] The program counter transition path for the entire pipeline is: Phase 0 → Phase 1 → Phase 2 → Phase 3. Phase 0 is enabled, and the callback chain after the phase is fully executed. The program counter transition control logic of the orchestration engine, the early stop primitives and retry primitives of the trial loop, the reference passing mechanism of the zero-copy result object, and the allocation and reclamation logic of the resource handle table are completely consistent with the edge device deployment scenario.

[0119] In summary, Scenario A and Scenario B represent two extremes in terms of hardware architecture (ARM vs x86_64), computing power (no GPU vs 32 GPUs), data scale (KB-level sensor data vs TB-level text corpus), model format (.tflite vs. .safetensors), and integration depth (no external services vs. MLflow + distributed file system). However, the orchestration engine in this application adapts to both scenarios simply through hardware abstraction layer interface injection and hook function pointer injection, without requiring modification to the core orchestration engine code. Specifically: The program counter's transition logic remains consistent in two scenarios: it increments unidirectionally after a stage is completed, without skipping intermediate stages or reversing the order. The early stop primitive and retry primitive of the test loop remain consistent in two scenarios: when triggered, the program counter remains unchanged, and resources are reclaimed through the resource handle table; The reference passing mechanism for zero-copy result objects remains consistent in two scenarios: only the reference identifier is passed between stages, and the heap memory instance is not copied; The allocation and reclamation logic of the resource handle table remains consistent in two scenarios: allocation at the beginning of each iteration and reclamation at the end of the iteration or when an early stop is triggered.

[0120] The above verification shows that the technical solution of this application has cross-scenario versatility and reusability, and can be adapted to extreme deployment environments ranging from resource-constrained edge devices to high-performance cloud clusters.

[0121] The technical solution provided in this application has at least the following advantages compared to existing MLOps frameworks: Existing MLOps frameworks typically use serialization to disk and then deserialization to read data between pipeline stages. When transferring large-scale intermediate training results, the serialization and deserialization operations consume a significant amount of time, causing the GPU to be idle for extended periods during stage transitions. This application addresses this by transferring data between adjacent stages using zero-copy result objects. Each stage only transfers references to instances of the same heap memory, without copying heap memory instances or performing serialization and deserialization operations. During stage transitions, only references are transferred, with the time taken in milliseconds, significantly reducing the GPU idle window.

[0122] Existing MLOps frameworks are typically deeply tied to specific tool platforms. When users need to change the underlying tools, they must modify the API call code in the training scripts, and may even need to refactor the pipeline definition. This application defines abstract method contracts for version control interfaces and experiment tracking interfaces through a hardware abstraction layer. The orchestration engine only performs operations by indirectly calling the method pointers of the interfaces, without depending on the implementation of any specific tool. The underlying tools can be injected or replaced through configuration without modifying the core code of the orchestration engine.

[0123] In existing MLOps frameworks, stage transitions are typically guaranteed by user coding discipline. Users need to manually control stage entry and exit in the training script, which can easily lead to problems such as stage skipping, stage repetition, or stage reversal. This application drives stage transitions through a program counter. The value of the program counter remains constant during the execution of any pipeline stage. Upon completion of the current stage, it increments unidirectionally to jump to the next stage, and jumps step by step according to a preset stage sequence, without skipping intermediate stages or reversing back to completed stages. The stage transition rules are fixed during orchestration engine compilation, and the determinism of stage transitions is guaranteed by the engine rather than user coding discipline.

[0124] Existing MLOps frameworks typically require users to implement the training-test loop themselves within the training script. Users need to write loop control code, including sampling hyperparameters, injecting training functions, collecting return values, and determining whether to stop early or retry, which is prone to loop logic errors or resource leaks. In this application, the orchestration engine natively supports iterative test loops, automatically executing the loop structure within the training-test loop phase. The orchestration engine natively supports early stopping and retry primitives, and the program counter remains unchanged when triggered. Users only need to implement training hooks and do not need to write loop control code.

[0125] In existing MLOps frameworks, experiment reporting and model registration are typically called manually by the user in the training script or executed concurrently by the framework. Concurrent execution can lead to situations where the experiment identifier has not yet been generated when the model is registered, resulting in foreign key constraint failures or data inconsistencies. This application addresses this by designing a fixed order of linearized ordered callback chains. The experiment reporting callback executes before the model registration callback. The returned experiment identifier is written to a zero-copy result object, and the subsequent model registration callback reads this identifier from the same object. This eliminates the time window issue and requires no additional synchronization mechanisms or lock protection.

[0126] In existing MLOps frameworks, users need to write a lot of glue code to interface inputs and outputs at different stages, handle protocol conversions between different tools, and manage resource allocation and recycling. This application decouples user business logic from the orchestration engine's core control flow through three core domain hooks. Users only need to implement the data loading hook, training hook, and export hook to obtain complete MLOps capabilities. There is no need to write scheduling code, handle protocol conversions, or worry about resource management. All optional hooks have default implementations, which will work normally without overriding them, while overriding them will provide customization capabilities.

[0127] The technical solution of this application can be adapted to extreme deployment environments ranging from resource-constrained edge devices to high-performance cloud clusters. In both extreme scenarios, the program counter transition logic, trial loop control logic, zero-copy result object reference passing logic, and resource handle table recycling logic of the orchestration engine remain consistent. Adaptation can be completed only through hardware abstraction layer interface injection and hook function pointer injection, without modifying the core code of the orchestration engine.

[0128] Based on the aforementioned method embodiments, this application also provides an MLOps task execution system based on a pipelined state machine and a hardware abstraction layer.

[0129] like Figure 7 As shown, an MLOps task execution system 700 based on a pipelined state machine and a hardware abstraction layer includes: The context creation module 710 is used to create a pipeline state machine execution context corresponding to the received training task in response to the training task. The pipeline state machine execution context includes a program counter, a call stack, and a resource handle table. The program counter is used to indicate the pipeline stage in which the training task is located, and the value of the program counter remains constant during the execution of any pipeline stage. When the current stage is completed, it increments unidirectionally to jump to the next stage, and jumps step by step according to a preset stage sequence, without skipping intermediate stages or reversing back to the completed stage. The stage execution module 720 is used by the orchestration engine to execute multiple pipeline stages sequentially through the transitions of the program counter based on the above pipeline state machine execution context. The above multiple pipeline stages include at least a data loading stage, a training and experimentation loop stage, and a model export stage. The aforementioned stage execution module 720 is further configured to perform dataset parsing and retrieval operations through the data interface of the hardware abstraction layer during the aforementioned data loading stage, and to allocate computing resources for the current training iteration by querying the aforementioned resource handle table and reclaiming the corresponding resources through the aforementioned resource handle table during the aforementioned training and experimentation cycle stage; and to execute the iterative experimentation cycle by the aforementioned orchestration engine. The zero-copy data transfer module 730 is used to transfer data between adjacent pipeline stages via zero-copy result objects when switching from the data loading stage to the training and experimentation cycle stage and when switching from the training and experimentation cycle stage to the model export stage. The result objects are transferred between adjacent stages in a zero-copy manner, specifically by transferring a reference to the result objects between adjacent stages without serializing or deep copying the data content carried by the result objects; and each pipeline stage fills the different field slots of the zero-copy result objects respectively. The model export module 740 is used to serialize the training output into a model file during the model export stage described above.

[0130] Optional, also includes: The callback execution module 750 is used to execute the linearized ordered callback chain in a preset order after the above model export stage is completed. The linearized ordered callback chain includes pre-training callback, experiment reporting callback, and model registration callback. The pre-training callback is used to modify the zero-copy result object before the experiment is reported; the experiment reporting callback performs log recording through the experiment tracking interface of the hardware abstraction layer, obtains the experiment identifier and writes the experiment identifier into the zero-copy result object; the post-model registration callback performs post-processing operations based on the experiment identifier in the zero-copy result object. The protocol conversion module 760 is used to perform the first protocol conversion operation by the orchestration engine after the data loading phase is completed and before switching to the training and experiment cycle phase, converting version control metadata into experiment tracking tags. After the above training and experimentation cycle is completed and before switching to the above model export stage, the orchestration engine performs the second protocol conversion operation to convert the hyperparameter product into a model registration request. Within the aforementioned model export stage, the orchestration engine performs a third protocol conversion operation to convert the data container extension segment into the model file header extension attribute. The first protocol conversion operation, the second protocol conversion operation, and the third protocol conversion operation mentioned above belong to the same transaction boundary.

[0131] One example of the MLOps task execution method based on pipelined state machine and hardware abstraction layer in this application is, for instance... Figure 2 The method steps in the illustrated embodiment can be executed by various modules of the system, and will not be described in detail here.

[0132] Based on the foregoing method embodiments, this application also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of any of the MLOps task execution methods based on pipelined state machines and hardware abstraction layers in this application, which will not be repeated here.

[0133] Based on the foregoing method embodiments, this application also provides a computer-readable storage medium storing a computer program thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of any of the MLOps task execution methods based on pipelined state machines and hardware abstraction layers of this application, which will not be repeated here.

[0134] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0135] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.

Claims

1. A method for MLOps task execution based on a pipeline state machine and a hardware abstraction layer, characterized in that, include: In response to a received training task, a pipeline state machine execution context corresponding to the training task is created. The pipeline state machine execution context includes a program counter, a call stack, and a resource handle table. The program counter is used to indicate the pipeline stage in which the training task is located, and the value of the program counter remains constant during the execution of any pipeline stage. When the current stage is completed, the program counter increments unidirectionally to jump to the next stage, and jumps step by step according to a preset stage sequence without skipping intermediate stages or reverting to a completed stage in reverse order. The orchestration engine executes multiple pipeline stages sequentially through the transitions of the program counter based on the pipeline state machine execution context. The multiple pipeline stages include at least a data loading stage, a training and experimentation loop stage, and a model export stage. During the data loading phase, the dataset parsing and retrieval operations are performed through the data interface of the hardware abstraction layer; During the training and testing cycle phase, the orchestration engine allocates computing resources for the current training iteration by querying the resource handle table, and reclaims the corresponding resources through the resource handle table; the orchestration engine executes the iterative testing cycle. When switching from the data loading stage to the training and testing cycle stage, and when switching from the training and testing cycle stage to the model export stage, data is transferred between adjacent pipeline stages using zero-copy result objects. Specifically, the result objects are transferred between adjacent stages using a zero-copy method, meaning that references to the result objects are transferred between adjacent stages without serializing or deeply copying the data content carried by the result objects; and each pipeline stage fills different field slots of the zero-copy result objects. During the model export stage, the training output is serialized into a model file.

2. The pipeline state machine and hardware abstraction layer based MLOps task execution method according to claim 1, wherein, The method further includes: After the model export stage is completed, the linearized ordered callback chain is executed sequentially in a preset order. The linearized ordered callback chain includes pre-training callback, experiment reporting callback, and post-model registration callback. The pre-training callback is used to perform modification operations on the zero-copy result object before experiment reporting; the experiment reporting callback performs log recording through the experiment tracking interface of the hardware abstraction layer, obtains the experiment identifier, and writes the experiment identifier into the zero-copy result object; the post-model registration callback performs post-processing operations based on the experiment identifier in the zero-copy result object.

3. The pipeline state machine and hardware abstraction layer based MLOps task execution method according to claim 1, wherein, The transfer of data between adjacent pipeline stages via zero-copy result objects includes: During the data loading phase, training data is retrieved through the data interface of the hardware abstraction layer and written to the training data field slot of the zero-copy result object; when switching to the training experiment cycle phase, the training data is read from the training data field slot.

4. The pipeline state machine and hardware abstraction layer based MLOps task execution method according to claim 3, wherein, The iterative test cycle includes: A set of hyperparameters is sampled, and the hyperparameters and the training data are passed into the training function to perform one training iteration. The execution result is obtained from the return value of the training function. Based on the execution result and the preset termination condition, the orchestration engine decides to end the current experiment and enter the next experiment, re-execute the current experiment, or drive the program counter to jump to the model export stage after all experiments are completed.

5. The pipeline state machine and hardware abstraction layer based MLOps task execution method according to claim 4, wherein, The process of the orchestration engine deciding to end the current trial and proceed to the next trial, re-execute the current trial, or drive the program counter to jump to the model derivation stage after all trials are completed, based on the execution result and preset termination conditions, includes: When the execution result meets the early stopping condition, the early stopping primitive is triggered, and the orchestration engine ends the current test and enters the next test. When the execution result meets the retry condition, the retry primitive is triggered, and the orchestration engine re-executes the current test; When all experiments have been completed, the program counter is driven by the orchestration engine to jump to the model derivation stage; When the early stop primitive or the retry primitive is triggered, the value of the program counter remains unchanged.

6. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 5, characterized in that, The early stop condition is determined by a pluggable pruner, which outputs an early stop signal to trigger the early stop primitive based on a comparison between the execution result and historical test results.

7. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 1, characterized in that, The zero-copy result object is filled with feature name field and data partition field during the data loading phase, parameter field and index field during the training and experimentation cycle phase, and model path field and product file path field during the model export phase. When the zero-copy result object is transferred between pipeline stages, the reference identifier is transferred.

8. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 7, characterized in that, The zero-copy result object is passed between adjacent pipeline stages through move semantics or reference counting mechanisms to ensure that the data content carried by the result object is not copied during the transmission process; The field slots of the zero-copy result object are pre-allocated during creation.

9. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 7, characterized in that, The zero-copy method of passing references is specifically manifested as follows: in a single-process scenario, the reference is a reference identifier pointing to the same set of memory instances; in a cross-process scenario, the reference is implemented by sharing memory between processes and using memory offsets to represent pointers; in a cross-node scenario, the reference is implemented by remote direct memory access; and in a multi-computing device scenario, the reference is implemented by sharing memory handles between computing devices.

10. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 2, characterized in that, The orchestration engine also maintains a set of optional hook function pointers, which includes callback function pointers before training, callback function pointers after model registration, and exported hook function pointers. The orchestration engine indirectly calls each hook function pointer in the optional hook function pointer set through the virtual function table; The pre-training callback function pointer is the first one called in the linearized ordered callback chain, and modifies the zero-copy result object before the experimental reporting operation. The callback function pointer after model registration is called in each iteration of the training test loop and after the training step is completed; The export hook function pointer is called after the model export phase is completed.

11. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 1, characterized in that, The method further includes: After the data loading phase is completed and before switching to the training and experiment cycle phase, the orchestration engine performs a first protocol conversion operation to convert version control metadata into experiment tracking tags. After the training and experimentation cycle is completed and before switching to the model export phase, the orchestration engine performs a second protocol conversion operation to convert the hyperparameter product into a model registration request. Within the model export stage, the orchestration engine performs a third protocol conversion operation to convert the data container extension segment into the model file header extension attribute; The first protocol conversion operation, the second protocol conversion operation, and the third protocol conversion operation belong to the same transaction boundary.

12. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 1, characterized in that, Each interface of the hardware abstraction layer corresponds to multiple replaceable implementation instances. The orchestration engine loads the selected implementation instance when the pipeline starts for a single run. When changing the implementation instance between two independent runs, there is no need to modify, recompile, or reload the control logic of the orchestration engine regarding stage transitions, trial loops, and resource reclamation.

13. The MLOps task execution method based on pipelined state machine and hardware abstraction layer according to claim 2, characterized in that, The execution of the linearized ordered callback chain follows a preset failure handling strategy, including: If the pre-training callback fails to execute, the current experiment will be terminated. When the pre-training callback executes successfully but the experiment reporting callback fails, the post-model registration callback is skipped, and the error is propagated to the top-level exception handling. If the callback execution fails after the model registration, the executed model registration operation is rolled back and the system is restored to the state when the model export stage is completed.

14. An MLOps task execution system based on a pipelined state machine and a hardware abstraction layer, characterized in that, include: The context creation module is used to create a pipeline state machine execution context corresponding to the received training task in response to the training task. The pipeline state machine execution context includes a program counter, a call stack, and a resource handle table. The program counter is used to indicate the pipeline stage in which the training task is located, and the value of the program counter remains constant during the execution of any pipeline stage. When the current stage is completed, it increments unidirectionally to jump to the next stage, and jumps step by step according to a preset stage sequence, without skipping intermediate stages or reverting to the completed stage in reverse order. The stage execution module is used by the orchestration engine to sequentially execute multiple pipeline stages through the transitions of the program counter based on the pipeline state machine execution context. The multiple pipeline stages include at least a data loading stage, a training and experimentation loop stage, and a model export stage. The stage execution module is further configured to perform dataset parsing and retrieval operations through the data interface of the hardware abstraction layer during the data loading stage, and to allocate computing resources for the current training iteration by querying the resource handle table and reclaiming the corresponding resources through the resource handle table during the training experiment cycle stage; and to execute an iterative experiment cycle by the orchestration engine. The zero-copy data transfer module is used to transfer data between adjacent pipeline stages via zero-copy result objects when switching from the data loading stage to the training and testing cycle stage and when switching from the training and testing cycle stage to the model export stage. The result objects are transferred between adjacent stages in a zero-copy manner, specifically by transferring a reference to the result object between adjacent stages without serializing or deep copying the data content carried by the result object; and each pipeline stage fills different field slots of the zero-copy result object respectively. The model export module is used to serialize the training output into a model file during the model export stage.

15. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the MLOps task execution method based on a pipelined state machine and hardware abstraction layer as described in any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, The system stores a computer program that, when executed by a processor, causes the processor to perform the steps of the MLOps task execution method based on a pipelined state machine and hardware abstraction layer as described in any one of claims 1 to 13.