WO2025181595A1 - 数据处理方法、文本处理方法、图像处理方法、计算设备、计算机存储介质以及计算机程序产品 - Google Patents

数据处理方法、文本处理方法、图像处理方法、计算设备、计算机存储介质以及计算机程序产品

Info

Publication number
WO2025181595A1
WO2025181595A1 PCT/IB2025/051210 IB2025051210W WO2025181595A1 WO 2025181595 A1 WO2025181595 A1 WO 2025181595A1 IB 2025051210 W IB2025051210 W IB 2025051210W WO 2025181595 A1 WO2025181595 A1 WO 2025181595A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
processing
data
data processing
computation graph
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/IB2025/051210
Other languages
English (en)
French (fr)
Inventor
吕倪祺
李克森
方民权
李鹏
赵大川
郑晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cloud Intelligence Singapore Holding Pvt Ltd
Original Assignee
Cloud Intelligence Singapore Holding Pvt Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Cloud Intelligence Singapore Holding Pvt Ltd filed Critical Cloud Intelligence Singapore Holding Pvt Ltd
Publication of WO2025181595A1 publication Critical patent/WO2025181595A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/10Pre-processing; Data cleansing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models

Definitions

  • embodiments of this specification provide a data processing method, a text processing method, an image processing method, a computing device, a computer storage medium, and a computer program product to address the technical deficiencies existing in the prior art.
  • a data processing method comprising: determining a target computation graph of a target model and inputting target data into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from a plurality of nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; determining a current node for processing the target data from the target computation graph, wherein the current node is any one of the plurality of nodes; determining a data processing computation graph corresponding to the current node, and processing the target data according to the current node and/or the data processing computation graph to obtain a data processing result.
  • a data processing device comprising: a data determination module configured to determine a target computation graph of a target model and inputting target data into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from a plurality of nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running.
  • a computation graph a node determination module configured to determine a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module configured to determine a data processing computation graph corresponding to the current node, and process the target data according to the current node and/or the data processing computation graph to obtain a data processing result.
  • a text processing method comprising: determining a target computation graph for a target model and inputting a target text into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; determining a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes; determining a text processing computation graph corresponding to the current node, and processing the target text according to the current node and/or the text processing computation graph to obtain a text processing result.
  • a text processing device comprising: a text determination module, configured to determine a target computation graph of a target model and a target text input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; a node determination module, configured to determine a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module, configured to determine a text processing computation graph corresponding to the current node, process the target text according to the current node and/or the text processing computation graph, and obtain a text processing result.
  • an image processing method comprising: determining a target computation graph of a target model and inputting a target image into the target model, wherein the target model is a machine learning model, the target computation graph is constructed by multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated when the target model is running; determining a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes; determining an image processing computation graph corresponding to the current node, processing the target image according to the current node and/or the image processing computation graph, and obtaining an image processing result.
  • an image processing apparatus comprising: an image determination module configured to determine a target computation graph of a target model and a target image input to the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; a node determination module configured to determine a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module configured to determine an image processing computation graph corresponding to the current node, and process the target image based on the current node and/or the image processing computation graph to obtain an image processing result.
  • a computing device comprising: a memory and a processor; the memory is configured to store a computer program/instructions, and the processor is configured to execute the computer program/instructions. When executed by the processor, the computer program/instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method.
  • a computer-readable storage medium is provided, storing a computer program/instruction. When executed by a processor, the computer program/instruction implements the steps of the aforementioned data processing method, text processing method, or image processing method.
  • a computer program product including a computer program/instruction.
  • the computer program/instruction When executed by a processor, the computer program/instruction implements the steps of the aforementioned data processing method, text processing method, or image processing method.
  • One embodiment of this specification provides a data processing method, comprising: determining a target computation graph of a target model and inputting target data into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; determining a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; determining a data processing computation graph corresponding to the current node, and processing the target data according to the current node and/or the data processing computation graph to obtain a data processing result.
  • the data processing method provided in the embodiments of this specification determines a target computation graph for a target model.
  • the target computation graph cannot be updated while the target model is running. That is, the target computation graph is fully defined and compiled before the target model is running. This facilitates optimizing the compilation of the target computation graph before model inference, reducing the computational burden on the processor and improving the execution efficiency of the processor. Furthermore, by flexibly calling the data processing computation graph, the target model can be ensured to perform efficient and accurate pre-processing or post-processing operations on the target data, enabling dynamic insertion of computation flows into the target computation graph without the need for secondary compilation. This reduces computation graph compilation overhead, reduces the demand and consumption of computer hardware resources, and improves model inference efficiency.
  • FIG1 is a schematic diagram of a data processing method according to an embodiment of this specification
  • FIG2 is a flow chart of a data processing method according to an embodiment of this specification
  • FIG3 is a schematic diagram of a pre-processing table according to an embodiment of this specification
  • FIG4 is a schematic diagram of a UNET model structure according to an embodiment of this specification
  • FIG5 is a schematic diagram of a target mapping table according to an embodiment of this specification
  • FIG6 is a flow chart of a single-node processing process of a data processing method according to an embodiment of this specification
  • FIG7 is a flow chart of a text processing method according to an embodiment of this specification
  • FIG8 is a flow chart of an image processing method according to an embodiment of this specification
  • FIG9 is a schematic diagram of the structure of a data processing device according to an embodiment of this specification
  • FIG10 is a schematic diagram of the structure of a text processing device according to an embodiment of this specification
  • FIG11 is a schematic diagram of the structure of an image
  • the term "if,” as used herein, could be interpreted as meaning “at the time,””when," or “in response to determining.”
  • the user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, storage, and display
  • the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or deny.
  • a large model refers to a deep learning model with large-scale model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than ten trillion model parameters.
  • Large models also known as foundation models, are pre-trained on large-scale unlabeled corpora to produce pre-trained models with more than 100 million parameters. Such models are adaptable to a wide range of downstream tasks and have good generalization capabilities. Examples include large language models (LLMs) and multi-modal pre-training models. In practical applications, large models only require a small number of samples to fine-tune the pre-trained model and can be applied to various tasks.
  • NLP natural language processing
  • VQA visual question answering
  • IC image captioning
  • IC image captioning
  • natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation.
  • Key application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
  • Stable-Diffusion A text-to-image generative model that is primarily used to generate detailed images based on text descriptions. It can also be applied to other tasks such as infilling, outfilling, and image-to-image transformation under the guidance of prompt words.
  • Controlnet An important supporting plug-in in the Stable Diffusion model. Its function is to guide the image generation process by controlling the feature representation to ensure that the generated image is more consistent with the input text description.
  • TensorRT A high-performance deep learning inference SDK (Software Development Kit) that includes a deep learning inference optimizer and runtime environment, providing low latency and high throughput for deep learning inference applications.
  • SDK Software Development Kit
  • LLM Large Language Model
  • Stable-Diffusion visual generative model a series of lightweight control techniques are employed during inference to precisely adjust output results.
  • Controlnet a key supporting plugin for the Stable-Diffusion model
  • Another approach involves inserting specialized upsampling and downsampling modules within the model to enable style transfer and dynamic style control of the generated images without changing the overall model architecture.
  • One existing method leverages the dynamic adjustability of dynamic graphs. By replacing specific operators in the computation graph, it can adaptively optimize the inference process for different inputs or stages, accelerating model inference. However, this method is limited. This method, which can be optimized, cannot achieve operator fusion on a larger scale.
  • Another existing acceleration method relies entirely on static graph calculations, which cannot dynamically modify the computation graph and cannot dynamically support solutions such as ControlNet. Therefore, an embodiment of this specification provides a data processing method based on static graph optimization while retaining dynamic computation graph modification. This method enables dynamic modification of the computation graph while saving computer hardware resources.
  • This specification provides a data processing method.
  • One or more embodiments of this specification also relate to a data processing device, a text processing method, a text processing device, an image processing method, an image processing device, a computing device, a computer-readable storage medium, and a computer program product, each of which is described in detail in the following embodiments.
  • Figure 1 shows a scenario diagram of a data processing method provided according to one embodiment of this specification.
  • the data processing method is implemented using a client 102 and a server 104.
  • the client 102 is used to send target data to the server 104.
  • the server 104 deploys a target model.
  • the target model is converted into a static computation graph, where nodes in the static computation graph represent mathematical operations (i.e., processing operations performed by the target model when performing data processing), and edges represent data flows (i.e., the relationships between processing operations).
  • the static computation graph of the target model can be compiled and optimized, for example, by merging repeated operations and reducing redundant computations to improve processing efficiency.
  • hardware such as GPUs (Graphics Processing Units) can be utilized to accelerate computation, so that the compiled static computation graph can be efficiently executed.
  • the current node processing the target data is determined from the target model's static computation graph, and the data processing computation graph corresponding to the current node is determined.
  • the data processing computation graph is used to perform pre- and/or post-processing on the target data.
  • the target data is processed according to the current node and/or the data processing computation graph to obtain a data processing result, which is then returned to the client 102.
  • the data processing computation graph includes a pre- and post-processing data processing computation graph, thereby enabling the addition, deletion, and modification of data processing computation graphs before and after the current node.
  • the client 102 may include a browser, an APP (Application), or a web application such as an H5 (Hyper Text Markup Languages, version 5) application, a light application (also known as a mini-program, a lightweight application), or a cloud application.
  • the client may be developed based on a software development kit (SDK) for the corresponding service provided by the server, such as a real-time communication (RTC) SDK.
  • SDK software development kit
  • RTC real-time communication
  • the client may be deployed in an electronic device and rely on the device or certain APPs in the device to run.
  • the electronic device may have a display and support information browsing, such as a personal mobile terminal such as a mobile phone, tablet computer, or personal computer.
  • Server 104 can be understood as a server that provides various services, including physical servers and cloud servers. For example, a server that provides communication services to multiple clients, a server that provides backend training support for models used on clients, or a server that processes data sent by clients. It should be noted that server 104 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. Server 104 can also be a server for a distributed system or a server integrated with blockchain.
  • Server 104 can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), big data and artificial intelligence platforms, or a cloud server with artificial intelligence technology.
  • Intelligent cloud computing server or intelligent cloud host can be executed by server 104.
  • the target model can be deployed on client 102, so that client 102 can have similar functions to server 104 and thus execute the data processing methods provided in the embodiments of this specification.
  • the data processing methods provided in the embodiments of this specification can also be executed jointly by client 102 and server 104.
  • the data processing method provided in the embodiments of this specification determines a target computation graph for a target model.
  • the target computation graph cannot be updated while the target model is running. That is, the target computation graph is fully defined and compiled before the target model is running. This facilitates optimizing the compilation of the target computation graph before model inference, reducing the processor's computational burden and improving processor execution efficiency.
  • the target model can perform efficient and accurate pre-processing or post-processing operations on the target data, dynamically inserting computation flows into the target computation graph without the need for secondary compilation, saving computation graph compilation overhead, reducing the demand and consumption of computer hardware resources, and improving model inference efficiency.
  • FIG2 shows a flow chart of a data processing method provided in one embodiment of this specification, which specifically includes the following steps.
  • the data processing method is applied to computer hardware that supports machine learning model computations.
  • Step 202 Determine a target computation graph for a target model and target data to be input into the target model.
  • the target model is a machine learning model, and the target computation graph is constructed from multiple nodes and edges connecting the nodes.
  • the target computation graph cannot be updated while the target model is running.
  • the target model can be understood as any data processing model, such as a text processing model or an image processing model, without limitation.
  • the target computation graph can be understood as a static computation graph, constructed based on the target model's structure and computational flow.
  • static computation graphs allow for higher levels of optimization than dynamic computation graphs, such as memory pre-allocation, computation graph optimization, and hardware-specific optimization, target models compiled using static computation graphs can achieve higher performance and faster execution efficiency compared to dynamic computation graphs during deployment and large-scale production environments.
  • Determining the target computation graph for the target model and inputting target data for the target model includes: determining the target computation graph for the target model and inputting target data for the target model based on the hardware resources of the computer hardware supporting machine learning model calculations.
  • Hardware resources include, but are not limited to, CPUs (Central Processing Units), memory, storage, and networks.
  • the computational graph corresponding to the target model needs to be compiled, i.e., the source code is converted into target code that can be executed by the computer.
  • both static and dynamic computation graphs require significant computer hardware resources. For example, the compilation process requires the CPU to perform numerous computations, such as lexical analysis and syntax analysis.
  • Memory is required to store data, including source code, intermediate code, and target code. Storage resources are needed to read and write numerous files, such as source code and header files. Furthermore, network resources are required to download dependencies or libraries from the network. Due to the fact that dynamic computation graphs are constructed as they are computed, modifications to a constructed dynamic computation graph require a re-compilation, which consumes significant computer hardware resources.
  • the data processing methods provided in the embodiments of this specification are applied to computer hardware supporting machine learning model calculations. Based on the hardware resources of the computer hardware supporting machine learning model calculations, the target computation graph of the target model is determined. Specifically, when the computer hardware resources are limited or insufficiently configured, the target model can be converted into a static computation graph.
  • the static computation graph needs to be modified, this can be achieved by dynamically calling the data processing computation graph. Therefore, there is no need for secondary compilation, i.e., there is no need to recompile the static computation graph, which can significantly save computation graph compilation overhead and reduce the demand and consumption of computer hardware resources.
  • the specific implementation method is as follows: Determining the target computation graph of the target model includes: obtaining the target model, using the processing operations of the target model for data processing as the nodes, and using the relationships between the processing operations as edges; and constructing the target computation graph based on the nodes and edges.
  • a node can be understood as a specific mathematical operation or data processing operation; an edge represents the direction of data flow and the dependencies between data processing operations.
  • the target model structure is first designed and implemented according to the requirements of the machine learning task to obtain the target model.
  • a pre-designed target model can be obtained and the processing operations of the target model during data processing are used as nodes to construct the target computation graph.
  • nodes can represent matrix multiplication, addition, activation function application, loss function calculation, optimizer update steps, etc.
  • the relationships between the various processing operations are used as edges to construct the target computation graph. For example, during target model inference, the output of the first convolutional layer serves as the input for the next convolutional layer or pooling layer.
  • the target computation graph is constructed based on the nodes and edges.
  • the data processing method provided in this embodiment by constructing a target computation graph, can clearly indicate the computational steps that can be executed in parallel in the target computation graph, which facilitates efficient model inference on large-scale datasets.
  • data processing tasks can also be decomposed onto different computing resources according to the structure of the target computing graph, thereby improving the performance and stability of the computer system.
  • an initial computing graph is first constructed based on nodes and edges.
  • the graph optimization is implemented by compiling each node in the initial computing graph to obtain a target computing graph.
  • the target computing graph is constructed based on the nodes and edges, including: constructing an initial computing graph based on the nodes and edges; performing redundancy elimination operations on the target nodes and target edges in the initial computing graph to obtain the target computing graph of the target model, so that the target model runs under a low utilization state of the target processor.
  • the target node can be understood as a node that needs to be optimized or adjusted, such as a repeated computing node, a node that can be fused, etc.
  • the target edge can be understood as an edge associated with the target node, such as when performing redundancy elimination operations on the target node.
  • the associated target edge must also be deleted.
  • Step 204 Determine the current node processing the target data from the target computation graph, where the current node is any one of the multiple nodes.
  • the current node can be understood as the specific node at which the target model executes operations according to the structural sequence of the target computation graph. Specifically, when the target model executes inference, the engine performs calculations node by node according to the target computation graph.
  • the engine can be understood as the core component that processes the target computation graph, capable of parsing the target computation graph structure, scheduling node execution order, and utilizing the underlying computer hardware for parallel computing and memory management.
  • the engine can be understood as the core component that processes the target computation graph, capable of parsing the target computation graph structure, scheduling node execution order, and utilizing the underlying computer hardware for parallel computing and memory management.
  • target data is input into the target model, it is first passed to the first node in the target computation graph for processing.
  • This node may correspond to the input layer of the target model and is responsible for performing preliminary transformations on the target data.
  • each node receives the output of the previous node as input and generates new outputs based on its defined processing operations and associated edges.
  • Step 206 Determine the data processing computation graph corresponding to the current node, and process the target data according to the current node and/or the data processing computation graph to obtain a data processing result.
  • a data processing computation graph can be understood as a static computation graph outside the target computation graph that performs data processing.
  • the data processing computation graph corresponding to the current node can be determined, and based on whether pre- and/or post-processing of the target data is required, the target data can be processed using the current node and/or the data processing computation graph to obtain a data processing result.
  • a computation graph framework implemented by combining the target computation graph with the data processing computation graph can implement diverse dynamic computation logic.
  • the data processing computation graph can also be adaptively called at any time based on actual needs, providing great flexibility.
  • the preceding data processing computation graph corresponding to the target structure unit is determined by determining whether the target structure unit of the target model corresponding to the current node is in a preceding processing table.
  • Determining the data processing computation graph corresponding to the current node includes: determining the target structure unit of the target model corresponding to the current node based on a target mapping table; and if the target structure unit is in the preceding processing table, determining the preceding data processing computation graph corresponding to the target structure unit from the preceding processing table.
  • the preceding data processing computation graph includes a mapping relationship between the target structure unit and the preceding data processing computation graph, and the preceding data processing computation graph is used to process the target structure unit.
  • the target data is pre-processed.
  • the target mapping table can be understood as a data structure that describes the correspondence between nodes in the target computation graph and the structural units of the target model.
  • the structural units of the target model can be understood as the basic components of the target model. For example, in a neural network, structural units can be understood as network layers, including but not limited to input layers, hidden layers (fully connected layers, convolutional layers, recurrent layers, etc.), and output layers.
  • the target structural unit can be understood as the structural unit corresponding to the current node, determined according to the target mapping table.
  • the pre-processing computation graph can be understood as the computation graph that processes the target data before executing the current node. Specifically, the target structural unit of the target model corresponding to the current node is first determined according to the target mapping table. A check is then performed to see if the target structural unit is in the pre-processing table. If so, the pre-processing computation graph corresponding to the target structural unit is determined from the pre-processing table. If not, the target data is processed according to the current node.
  • Figure 3 shows a schematic diagram of a pre-processing table provided in an embodiment of this specification.
  • the input data is usually added to a constant value outside the target calculation graph to realize the processing of the input data; at this time, according to the target mapping table, the target structure unit of the target model corresponding to the current node is determined to be structure unit 1.
  • the pre-data processing computation graph corresponding to the target structural unit is determined from the pre-processing table.
  • the target data is processed using the pre-data processing computation graph, thereby dynamically inserting the computation graph before the current node.
  • a target mapping table is constructed based on the mapping relationship between nodes in the target computation graph and the structural units of the target model.
  • a specific implementation method is as follows: Before determining the target structural unit of the target model corresponding to the current node according to the target mapping table, the method further includes: determining the structural unit for constructing the target model, wherein the structural unit is a network layer of the target model; determining the structural unit corresponding to each node in the target computation graph; and constructing the target mapping table based on the mapping relationship between the nodes in the target computation graph and the structural units of the target model.
  • UNET U-Net
  • CNN convolutional neural network
  • FIG4 shows a schematic diagram of the UNET model structure provided in an embodiment of this specification; the structure of the UNET model mainly includes two parts: an encoder block and a decoder block.
  • the encoder block typically includes a multi-layer structure, each layer including a self-attention mechanism and a feedforward neural network (FFN), etc. Therefore, each encoder block includes submodules, and similarly, the decoder block includes submodules.
  • FNN feedforward neural network
  • FIG5 shows a schematic diagram of a target mapping table provided in an embodiment of this specification, where node 1 is associated with structural unit 0.0
  • node 2 corresponds to structural unit 0.1
  • node 3 corresponds to structural unit 0.2
  • node 4 corresponds to structural unit 1.0
  • so on up to node n corresponding to structural unit nn.
  • the data processing method provided in the embodiments of this specification constructs a target mapping table to locate the specific structural unit within the target model corresponding to the current node in the target computation graph, and accurately perform the relevant data processing and calculations. This provides a clearer understanding and control of the entire target model computation process, ensuring that data is processed in accordance with the target model design requirements as it passes through each node in the target computation graph.
  • accurate data processing is performed based on actual conditions through the pre-data processing computation graph, the current node, and the post-data processing computation graph. Functions such as inserting and deleting nodes in the target computation graph are also implemented through the pre-data processing computation graph and the post-data processing computation graph.
  • Processing the target data according to the current node and/or the data processing computation graph to obtain a data processing result includes: processing the target data according to the pre-processing computation graph to obtain pre-processing data; when the current node is determined to be executed according to the pre-processing data, processing the pre-processing data according to the current node to obtain current processing data; when the target structure unit is in a post-processing table, determining the post-processing computation graph corresponding to the target structure unit from the post-processing table, wherein the post-processing table includes a mapping relationship between the target structure unit and the post-processing computation graph, and the post-processing computation graph is used to perform post-processing on the target processing data; processing the current processing data according to the post-processing computation graph to obtain the data processing result.
  • the pre-processing data can be understood as processed data obtained by processing the target data using the pre-processing computation graph; and the current processing data can be understood as a processing result obtained by processing the pre-processing data output by the pre-processing computation graph using the current node.
  • the post-data processing calculation graph can be understood as a calculation graph that processes the target processing data after executing the current node.
  • the target processing data when the pre-processing data is obtained and the current node is not executed, can be understood as the pre-processing data, that is, the pre-processing data is processed using the post-data processing calculation graph to obtain the data processing result; when the pre-processing data is obtained and the current node is executed, the target processing data can be understood as the current processing data, that is, the data processing result is obtained by using the post-data processing calculation graph for the current processing data; or, when the structural unit corresponding to the current node is not in the pre-processing table, the target data is processed using the current node to obtain the target processing result.
  • the target processing data can be understood as the target processing result, that is, the target processing result is processed using the post-data processing calculation graph to obtain the data processing result.
  • the pre-data processing computation graph corresponding to the target structural unit is determined from the pre-processing table.
  • the target data is processed using the pre-data processing computation graph to obtain pre-processing data.
  • it is determined whether to continue executing the current node for example, if the pre-data processing computation graph is used to detect environmental readiness, which is a necessary step before executing the current node, subsequent nodes are executed only when the pre-processing data is in the "Ready" state).
  • the pre-processing data is processed based on the current node to obtain the current processing data.
  • the computation graph is added before the current node.
  • the step of processing the target data according to the current node and/or the data processing calculation graph to obtain a data processing result includes: processing the target data according to the pre-processing calculation graph to obtain pre-processing data; determining according to the pre-processing data that the current node is not to be executed and that the target structure unit is in post-processing If the target structural unit is not in the post-processing table, the post-data processing calculation graph corresponding to the target structural unit is determined from the post-processing table, and the pre-processing data is processed according to the post-data processing calculation graph to obtain the data processing result.
  • the pre-processing data determines that the current node is not to be executed and the target structural unit is not in the post-processing table
  • the pre-processing data is determined as the data processing result. Specifically, if the target structural unit is in the pre-processing table, the pre-data processing calculation graph corresponding to the target structural unit is determined from the pre-processing table, and the target data is processed using the pre-data processing calculation graph to obtain the pre-processing data. If the pre-processing data determines that the current node is not to be executed, it is determined whether the target structural unit is in the post-processing table. If so, the pre-processing data is processed using the post-data processing calculation graph to obtain the data processing result.
  • the pre-processing data is determined as the data processing result. If the current node is not to be executed, the current node is deleted.
  • the data processing method provided in the present embodiment implements dynamic insertion of other computational flows into the target computation graph by inserting a pre-data processing computation graph and a post-data processing computation graph before/after executing the current node during target model inference. In one or more embodiments of this specification, if the target structural unit is not in the pre-processing table, the target data is processed using the current node.
  • Determining the data processing computation graph corresponding to the current node includes: determining the target structural unit of the target model corresponding to the current node according to a target mapping table; if the target structural unit is not in the pre-processing table, processing the target data according to the current node to obtain the currently processed data; and if the target structural unit is in the post-processing table, determining the post-data processing computation graph corresponding to the target structural unit from the post-processing table. Specifically, if the target structural unit is not in the pre-processing table, the current node is executed according to the order in the target computation graph. The target data is processed using the current node to obtain the currently processed data.
  • the post-data computation graph corresponding to the target structural unit in the post-processing table is used to process the data.
  • the data processing method provided in the embodiments of this specification uses the pre-processing table and the post-processing table to orderly manage the data processing process of each structural unit in a complex model, ensuring that data flows and is processed according to preset rules at different stages.
  • a post-data processing computation graph is determined and used to process the currently processed data.
  • a specific implementation method is as follows: Processing the target data according to the current node and/or the data processing computation graph to obtain a data processing result includes processing the currently processed data according to the post-data processing computation graph to obtain the data processing result. Specifically, when the target structure unit is in the post-processing table, the post-data processing calculation graph corresponding to the target structure unit is determined from the post-processing table, and the post-data processing calculation graph is used to process the current processing data to obtain the data processing result.
  • the data processing method provided in the embodiment of this specification determines whether the target structure unit is in the post-processing table after executing the current node.
  • the corresponding post-data processing calculation graph can be found in the post-processing table to ensure that the data undergoes necessary pre-processing before entering the next node, thereby improving the accuracy of data transmission.
  • the target calculation graph of the target model has multiple nodes. After executing the calculation process of the entire current node, it is determined whether the next node of the current node still exists. If so, the next node of the current node is determined. The data processing result is passed to the next node, and the next node is determined as the current node.
  • the specific implementation method is as follows: After obtaining the data processing result, the method further includes: determining whether a next node exists for the current node; if so, determining the next node as the current node, using the data processing result as the target data, executing the step of determining the data processing computation graph corresponding to the current node, processing the target data according to the current node and/or the data processing computation graph, and obtaining the data processing result. If not, outputting the data processing result.
  • the method checks whether the current node has a subsequent node; if the current node has a next node, setting the next node as the current node, and using the data processing result obtained at the current node as the target data.
  • the step of determining the data processing computation graph corresponding to the current node processing the target data according to the current node and/or the data processing computation graph, and obtaining the data processing result based on the newly determined current node, and continuing to perform corresponding processing on the target data to obtain the data processing result.
  • This process is repeated until all nodes in the target computation graph are executed. If the current node has no next node, it means the model inference process has reached the end of the target computation graph. At this point, iteration to the next node is stopped and the current data processing result is directly output.
  • the data processing method provided in this embodiment ensures that the input target data is calculated and processed layer by layer at each node according to the design of the target computation graph, ultimately yielding the model prediction or inference result.
  • the data processing method provided in the embodiments of this specification determines a target computation graph for a target model.
  • the target computation graph cannot be updated while the target model is running. That is, the target computation graph is fully defined and compiled before the target model is running. This facilitates optimizing the compilation of the target computation graph before model inference, reducing the processor's computational burden and improving processor execution efficiency.
  • the target model can perform efficient and accurate pre-processing or post-processing operations on the target data, enabling dynamic insertion of computational flows into the target computation graph without the need for secondary compilation. This reduces computation graph compilation overhead, reduces the demand and consumption of computer hardware resources, and improves model inference efficiency.
  • FIG6 shows a flowchart of a single-node processing process of a data processing method provided in one embodiment of this specification, specifically including the following steps: Step 602: Obtain the target structural unit corresponding to the current node based on the target mapping table.
  • a target model implemented using a dynamic graph architecture is obtained, and the target model's dynamic computation graph is converted into a static computation graph.
  • a node->block mapping table (i.e., the target mapping table) is constructed.
  • a node represents each node in the static computation graph, and a block represents a structural unit in the model structure.
  • Step 604 Determine whether the target structural unit is in the pre-processing table. If so, execute step 606; if not, execute step 610. Determine whether the block corresponding to the current node is in the pre_process table (i.e., the pre-processing table in the above embodiment). If so, execute step 606, i.e., execute the computation graph corresponding to the block in the pre_process table. If not, execute step 610, i.e., directly execute the computation for the current node.
  • the pre_process table i.e., the pre-processing table in the above embodiment
  • Step 606 Execute the pre-data processing computation graph corresponding to the target structural unit in the pre-processing table. If the block corresponding to the current node is in the pre_process table, execute the computation graph corresponding to the block in the pre_process table and obtain the return data (i.e., the pre-processed data in the above embodiment) and whether to continue. Continue the calculation result.
  • Step 608 Determine whether to continue the calculation. If so, execute step 610; if not, execute step 612. If the calculation is continued, the calculation of the current node is executed. This is equivalent to inserting the calculation graph before the current node, implementing the calculation graph addition function.
  • Step 610 Execute the calculation of the current node.
  • Step 612 Determine whether the target structural unit is in the post-processing table. If so, execute step 614; if not, execute step 616.
  • the block of the current node is obtained according to the node->block mapping table. Then, the block is checked to see if it is in the after_process table (post-processing table).
  • Step 614 executes the calculation graph corresponding to the block in the after_process table; if it is not in the after_process table, the entire calculation process for the current node is terminated.
  • Step 614 Execute the post-data processing computation graph corresponding to the target structural unit in the post-processing table. If the block of the current node is in the after_process table, execute the computation graph corresponding to the block in the after_process table and obtain return data (i.e., the data processing result in the above embodiment).
  • Step 616 End. The entire computation flow for the current node is completed, and the obtained data processing result is passed to the node next to the current node.
  • the data processing method provided in the embodiments of this specification by flexibly calling the data processing computation graph, can ensure that the target model performs efficient and accurate pre-processing or post-processing operations on the target data. This allows for the dynamic insertion of computation flows into the target computation graph without the need for secondary compilation, saving computation graph compilation overhead, reducing the demand and consumption of computer hardware resources, and improving model inference efficiency.
  • Figure 7 shows a flowchart of a text processing method provided in one embodiment of this specification, which specifically includes the following steps.
  • Step 702 Determine a target computation graph for a target model and input a target text into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph cannot be updated while the target model is running.
  • Step 704 Determine a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes.
  • Step 706 Determine a text processing computation graph corresponding to the current node, and process the target text based on the current node and/or the text processing computation graph to obtain a text processing result.
  • the text processing method will be described in detail using a deep learning text classification model as an example.
  • the text classification model is constructed in the form of a dynamic graph, which is first converted into a static computation graph to facilitate management and optimize the inference process.
  • a node->block mapping table is constructed, where each node represents an operational step in the static computation graph, while the block corresponds to the actual structural unit of the text classification model.
  • node calculations are performed sequentially according to the static computation graph. Assuming that the current node corresponds to the word embedding layer (block), the pre-processing table is searched to find the existence of a pre-text processing computation graph for this block.
  • pre-processing such as word segmentation or padding is performed on the input target text to obtain the pre-processed data, and then a determination is made as to whether the conditions for continuing calculation are met (such as data validity and appropriate length). If the conditions for continuing calculation are met, the actual calculation of the current node (word embedding layer) is performed, converting the pre-processed text into a word vector representation. After the calculation of the current node is completed, a further check is made to see whether the current node has a pre-text in the post-processing table.
  • Processing computation graphs such as performing data normalization or other post-processing steps; if a corresponding post-data processing computation graph exists, executing the corresponding post-data processing computation graph and obtaining the result; if not, directly ending the computation flow of the current node and passing the result to the next node.
  • the text processing method provided in the embodiments of this specification by calling data processing computation graphs, can flexibly insert or delete portions of the static computation graph to accommodate different data pre-processing or post-processing requirements, thereby optimizing the inference efficiency and effectiveness of the entire target model. See Figure 8, which shows a flowchart of an image processing method provided in one embodiment of this specification, specifically including the following steps.
  • Step 802 Determine a target computation graph for a target model and a target image to be input into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph cannot be updated while the target model is running.
  • Step 804 Determine a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes.
  • Step 806 Determine an image processing computation graph corresponding to the current node, and process the target image based on the current node and/or the image processing computation graph to obtain an image processing result.
  • the image processing method is described in detail using an image classification model as an example.
  • the image classification model includes multiple structural units, such as an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer.
  • a mapping relationship between nodes and model structural units is constructed based on the static computation graph of the image classification model. For example, a certain node corresponds to the computation of the first convolutional layer.
  • node calculations are performed sequentially according to the static computation graph. Based on the node->block mapping table, it is determined that the current node corresponds to the first convolutional layer. A determination is made as to whether this convolutional layer is in the pre-processing table.
  • the apparatus includes: a data determination module 902 configured to determine a target computation graph of a target model and target data input to the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; a node determination module 904 configured to determine a current node for processing the target data from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module 906 configured to determine a data processing computation graph corresponding to the current node, and process the target data based on the current node and/or the data processing computation graph to obtain a data processing result.
  • a data determination module 902 configured to determine a target computation graph of a target model and target data input to the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the
  • the result acquisition module 906 is further configured to: determine a target structural unit of the target model corresponding to the current node based on a target mapping table; and if the target structural unit is in a pre-processing table, determine the target structural unit from the pre-processing table.
  • a pre-data processing calculation graph corresponding to the target structural unit is stored in the pre-processing table, wherein the pre-processing table includes a mapping relationship between the target structural unit and the pre-data processing calculation graph, and the pre-data processing calculation graph is used to perform pre-processing on the target processed data.
  • the result acquisition module 906 is further configured to: process the target data according to the pre-data processing calculation graph to obtain pre-processing data; if the current node is determined to be executed according to the pre-processing data, process the pre-processing data according to the current node to obtain current processed data; if the target structural unit is in the post-processing table, determine the post-data processing calculation graph corresponding to the target structural unit from the post-processing table, wherein the post-processing table includes a mapping relationship between the target structural unit and the post-data processing calculation graph, and the post-data processing calculation graph is used to perform post-processing on the target processed data; and process the current processed data according to the post-data processing calculation graph to obtain the data processing result.
  • the result obtaining module 906 is further configured to: process the target data according to the pre-data processing calculation graph to obtain pre-processing data; if it is determined according to the pre-processing data that the current node is not to be executed and the target structural unit is in the post-processing table, determine the post-data processing calculation graph corresponding to the target structural unit from the post-processing table, and process the pre-processing data according to the post-data processing calculation graph to obtain the data processing result; or, if it is determined according to the pre-processing data that the current node is not to be executed and the target structural unit is not in the post-processing table, determine the pre-processing data as the data processing result.
  • the result obtaining module 906 is further configured to: determine the target structural unit of the target model corresponding to the current node according to a target mapping table; if the target structural unit is not in the pre-processing table, process the target data according to the current node to obtain current processing data; and if the target structural unit is in the post-processing table, determine the post-data processing calculation graph corresponding to the target structural unit from the post-processing table.
  • the result acquisition module 906 is further configured to: process the current processing data according to the post-data processing computation graph to obtain the data processing result.
  • the data determination module 902 is further configured to: obtain the target model, use the processing operations of the target model for data processing as the nodes, and use the associations between the processing operations as edges; and construct the target computation graph based on the nodes and edges.
  • the data determination module 902 is further configured to: construct an initial computation graph based on the nodes and edges; perform redundancy elimination on target nodes and target edges in the initial computation graph to obtain a target computation graph for the target model, so that the target model runs under a low utilization state of the target processor.
  • the apparatus further includes: a construction module configured to determine structural units for constructing the target model, wherein the structural units are network layers of the target model; determine the structural units corresponding to each node in the target computation graph; and construct the target mapping table based on the mapping relationships between the nodes in the target computation graph and the structural units of the target model.
  • the device further includes: a post-processing module configured to determine whether there is a next node of the current node, If so, the next node of the current node is determined as the current node, and the data processing result is used as the target data. The steps of determining the data processing computation graph corresponding to the current node, processing the target data according to the current node and/or the data processing computation graph, and obtaining the data processing result are executed.
  • the data determination module 902 is further configured to: determine the target computation graph of the target model and input the target data of the target model based on the hardware resources of the computer hardware supporting machine learning model calculations.
  • the above is a schematic diagram of a data processing device according to this embodiment. It should be noted that the technical solution of this data processing device and the technical solution of the above-mentioned data processing method are based on the same concept. For details not described in detail in the technical solution of the data processing device, please refer to the description of the technical solution of the above-mentioned data processing method. Corresponding to the above-mentioned method embodiment, this specification also provides an embodiment of a text processing device.
  • Figure 10 shows a schematic diagram of the structure of a text processing device according to one embodiment of this specification.
  • the device includes: a text determination module 1002 configured to determine a target computation graph for a target model and input a target text into the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; a node determination module 1004 configured to determine a current node for processing the target text from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module 1006 configured to determine a text processing computation graph corresponding to the current node, and process the target text based on the current node and/or the text processing computation graph to obtain a text processing result.
  • a text determination module 1002 configured to determine a target computation graph for a target model and input a target text into the target model, wherein the target model is a machine learning model, the target computation
  • the device includes: an image determination module 1102, configured to determine a target computation graph of a target model and a target image input to the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target model is running; a node determination module 1104, configured to determine a current node for processing the target image from the target computation graph, wherein the current node is any one of the multiple nodes; and a result acquisition module 1106, configured to determine the image processing computation graph corresponding to the current node, and process the target image according to the current node and/or the image processing computation graph to obtain an image processing result.
  • an image determination module 1102 configured to determine a target computation graph of a target model and a target image input to the target model, wherein the target model is a machine learning model, the target computation graph is constructed from multiple nodes and edges connecting the nodes, and the target computation graph is a computation graph that cannot be updated while the target
  • FIG. 12 shows a structural block diagram of a computing device 1200 provided according to an embodiment of this specification.
  • the components of the computing device 1200 include but are not limited to a memory 1210 and a processor 1220.
  • the processor 1220 is connected to the memory 1210 via a bus 1230, and the database 1250 is used to store data.
  • the computing device 1200 also includes an access device 1240, which enables the computing device 1200 to communicate via one or more networks 1260.
  • networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), and a public network. Wide Area Network), Personal Area Network (PAN), or a combination of communication networks such as the Internet.
  • the access device 1240 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB), or a wireless local area network (WLAN).
  • NIC network interface card
  • computing device 1200 USB, Universal Serial Bus
  • cellular network interface Bluetooth interface
  • NFC Near Field Communication
  • the aforementioned components of computing device 1200 and other components not shown in FIG12 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG12 is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
  • Computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC).
  • Computing device 1200 may also be a mobile or stationary server.
  • the processor 1220 is configured to execute the following computer program/instructions, which, when executed by the processor, implement the steps of the aforementioned data processing method, text processing method, or image processing method.
  • the various embodiments in this specification are described in a progressive manner.
  • Similar or identical portions between the various embodiments may be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments.
  • the computing device embodiment is generally similar to the data processing method embodiment, so the description is relatively simple. For relevant portions, refer to the description of the data processing method embodiment.
  • This specification also provides a computer-readable storage medium storing a computer program/instructions. When executed by the processor, the computer program/instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method.
  • the various embodiments in this specification are described in a progressive manner. Similar or identical portions between the various embodiments may be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments.
  • the computer-readable storage medium embodiment is generally similar to the data processing method embodiment, so the description is relatively simple. For relevant portions, refer to the description of the data processing method embodiment.
  • One embodiment of this specification also provides a computer program product, including a computer program/instructions. When executed by a processor, these computer program/instructions implement the steps of the aforementioned data processing method, text processing method, or image processing method.
  • the above is an illustrative embodiment of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the aforementioned data processing method are based on the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the aforementioned data processing method.
  • the computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, Disks, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals. It should be noted that for ease of description, the aforementioned method embodiments are described as a series of actions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computational Linguistics (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Image Analysis (AREA)

Abstract

本说明书实施例提供数据处理方法、文本处理方法、图像处理方法、计算设备、计算机存储介质以及计算机程序产品,其中所述数据处理方法,包括:确定目标模型的目标计算图以及输入所述目标模型的目标数据;从所述目标计算图中确定处理所述目标数据的当前节点;确定所述当前节点对应的数据处理计算图,根据所述当前节点和/或所述数据处理计算图,处理所述目标数据,获得数据处理结果;通过灵活地调用数据处理计算图,能确保目标模型对目标数据进行高效、准确的前置处理或后置处理操作,实现在目标计算图中动态插入计算流程,且无需二次编译,节省计算图编译的开销,减少对计算机硬件资源的需求和消耗,提高模型推理效率。

Description

数据处理方法、 文本处理方法、 图像处理方法、 计算设备、 计算机存储介质以及计算 机程序产品 本公开要求申请号为 202410217614.9的中国专利申请的优先权, 该中国专利申请 于 2024年 02月 27 日提交中国专利局, 申请名称为 “数据处理方法、 文本处理方法、 图像处理 方法、 计算设备、 计算机存储介质以及计算机程序产品”, 其全部内容通过引 用结合在 本公开中。 技术领域 本说明书实施例涉及计 算机技术领域, 特别涉及一种数据处理方法、 文本处理方 法、 图像处理方法、 计算设备、 计算机存储介质以及计算机程序产品。 背景技术 对于传统的深度学 习推理加速方案, 可利用静态图优化技术大幅提高模型推 理效 率, 即通过对计算图中的节点进行 融合, 并选择高度优化的内核函数执行运算, 从而 减少计算机 硬件资源的计算开销和提升模 型推理过程的执行速度 。 然而, 面对 Stable-Diffusion (图像生成模型, 其工作原理涉及到多次迭代过程以 逐渐从噪 声向清晰图像转化, 每次迭代都需要根据前一次迭代 的结果动态调整参数或 计算流程 , 这种动态和递归性质使得该模型难以直接用静态 图表示和优化) 这类具有 迭代扩散 过程和动态行为的模型时 , 这种静态图解决方案由于无法灵活应对模型在推 理过程 中根据前一步骤动态决定后 续步骤这一特性, 因此难以直接应用并发挥同样的 加速效果 ; 这意味着对于此类模型, 需要发展新的适应其内在动态属性的优化技术。 发明内容 有鉴于此, 本说明书实施例提供了一种数据处理 方法、 文本处理方法、 图像处理 方法、 计算设备、 计算机存储介质以及计算机程序产品, 以解决现有技术中存在的技 术缺陷。 根据本说明书实施例 的第一方面, 提供了一种数据处理方法, 包括: 确定目标模型的 目标计算图以及输入所述 目标模型的目标数据, 其中, 所述目标 模型为机 器学习模型, 所述目标计算图由多个节点以及连接各 节点之间的边构建, 且 所述 目标计算图为在所述目标模型运行 时不能进行更新的计算图 ; 从所述目标计算图 中确定处理所述目标数据的 当前节点, 其中, 所述当前节点为 所述多个 节点中的任意一个节点; 确定所述当前节点对应 的数据处理计算图, 根据所述当前节点和 /或所述数据处理 计算图, 处理所述目标数据, 获得数据处理结果。 根据本说明书实施例 的第二方面, 提供了一种数据处理装置, 包括: 数据确定模块, 被配置为确定目标模型的 目标计算图以及输入所述目标模型 的目 标数据, 其中, 所述目标模型为机器学习模型, 所述目标计算图由多个节点以及连接 各节点之 间的边构建, 且所述目标计算图为在所述目标模型运行 时不能进行更新的计 算图; 节点确定模块,被配置为从所述目标计算 图中确定处理所述目标数据的 当前节点, 其中, 所述当前节点为所述多个节点 中的任意一个节点; 结果获得模块, 被配置为确定所述当前节点对应 的数据处理计算图, 根据所述当 前节点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据处理结果。 根据本说明书实施例 的第三方面, 提供了一种文本处理方法, 包括: 确定目标模型的 目标计算图以及输入所述 目标模型的目标文本, 其中, 所述目标 模型为机 器学习模型, 所述目标计算图由多个节点以及连接各 节点之间的边构建, 且 所述 目标计算图为在所述目标模型运行 时不能进行更新的计算图 ; 从所述目标计算图 中确定处理所述目标文本的 当前节点, 其中, 所述当前节点为 所述多个 节点中的任意一个节点; 确定所述当前节点对应 的文本处理计算图, 根据所述当前节点和 /或所述文本处理 计算图, 处理所述目标文本, 获得文本处理结果。 根据本说明书实施例 的第四方面, 提供了一种文本处理装置, 包括: 文本确定模块, 被配置为确定目标模型的 目标计算图以及输入所述目标模型 的目 标文本, 其中, 所述目标模型为机器学习模型, 所述目标计算图由多个节点以及连接 各节点之 间的边构建, 且所述目标计算图为在所述目标模型运行 时不能进行更新的计 算图; 节点确定模块,被配置为从所述目标计算 图中确定处理所述目标文本的 当前节点, 其中, 所述当前节点为所述多个节点 中的任意一个节点; 结果获得模块, 被配置为确定所述当前节点对应 的文本处理计算图, 根据所述当 前节点和 /或所述文本处理计算图, 处理所述目标文本, 获得文本处理结果。 根据本说明书实施例 的第五方面, 提供了一种图像处理方法, 包括: 确定目标模型的 目标计算图以及输入所述 目标模型的目标图像, 其中, 所述目标 模型为机 器学习模型, 所述目标计算图由多个节点以及连接各 节点之间的边构建, 且 所述 目标计算图为在所述目标模型运行 时不能进行更新的计算图 ; 从所述目标计算图 中确定处理所述目标图像的 当前节点, 其中, 所述当前节点为 所述多个 节点中的任意一个节点; 确定所述当前节点对应 的图像处理计算图, 根据所述当前节点和 /或所述图像处理 计算图, 处理所述目标图像, 获得图像处理结果。 根据本说明书实施例 的第六方面, 提供了一种图像处理装置, 包括: 图像确定模块, 被配置为确定目标模型的目标计算 图以及输入所述目标模型 的目 标图像, 其中, 所述目标模型为机器学习模型, 所述目标计算图由多个节点以及连接 各节点之 间的边构建, 且所述目标计算图为在所述目标模型运行 时不能进行更新的计 算图; 节点确定模块,被配置为从所述目标计算 图中确定处理所述目标图像的 当前节点, 其中, 所述当前节点为所述多个节点 中的任意一个节点; 结果获得模块, 被配置为确定所述当前节点对应 的图像处理计算图, 根据所述当 前节点和 /或所述图像处理计算图, 处理所述目标图像, 获得图像处理结果。 根据本说明书实施例 的第七方面, 提供了一种计算设备, 包括: 存储器和处理器; 所述存储器用于存储计算 机程序 /指令,所述处理器用于执行所述计算机程序 /指令, 该计算机程 序 /指令被处理器执行时实现上述数据处理方法、 或文本处理方法、 或图像 处理方法 的步骤。 根据本说明书实施例的 第八方面, 提供了一种计算机可读存储介质, 其存储有计 算机程序 /指令, 该计算机程序 /指令被处理器执行时实现上述数据处理方法、或文本处 理方法、 或图像处理方法的步骤。 根据本说明书实施例的 第九方面, 提供了一种计算机程序产品, 包括计算机程序 / 指令, 该计算机程序 /指令被处理器执行时实现上述数据处理方法、 或文本处理方法、 或图像处理 方法的步骤。 本说明书一个实施例提供 一种数据处理方法, 包括: 确定目标模型的目标计算图 以及输入所 述目标模型的目标数据, 其中, 所述目标模型为机器学习模型, 所述目标 计算图由 多个节点以及连接各节点之 间的边构建, 且所述目标计算图为在所述目标模 型运行时不 能进行更新的计算图; 从所述目标计算图中确定处理所 述目标数据的当前 节点, 其中, 所述当前节点为所述多个节点中的任意一个节点 ; 确定所述当前节点对 应的数据处理 计算图, 根据所述当前节点和 /或所述数据处理计算图, 处理所述目标数 据, 获得数据处理结果。 本说明书实施例提供的数 据处理方法, 通过确定目标模型的目标计算图, 在给目 标模型输入 目标数据的情况下, 由于目标计算图为在目标模型运行 时不能进行更新的 计算图, 即目标计算图在目标模型运行前就被完全定义并编译, 这有利于在进行模型 推理前进行 对目标计算图的编译进行优 化, 降低处理器的运算负担, 提高处理器的执 行效率 ; 同时, 通过灵活地调用数据处理计算图, 能确保目标模型对目标数据进行高 效、 准确的前置处理或后置处理操作, 实现在目标计算图中动态插入计算流程, 且无 需二次编译 , 节省计算图编译的开销, 减少对计算机硬件资源的需求和消耗, 提高模 型推理效率 。 附图说明 图 1是本说明书一个实施例提供 的一种数据处理方法的场景示 意图; 图 2是本说明书一个实施例提供 的一种数据处理方法的流程 图; 图 3是本说明书一个实施例提供 的一种前置处理表的示意 图; 图 4是本说明书一个实施例提供 的一种 UNET模型结构 示意图; 图 5是本说明书一个实施例提供 的一种目标映射表的示意 图; 图 6是本说明书一个实施例提供 的一种数据处理方法的单节 点处理过程流程图; 图 7是本说明书一个实施例提供 的一种文本处理方法的流程 图; 图 8是本说明书一个实施例提供 的一种图像处理方法的流程 图; 图 9是本说明书一个实施例提供 的一种数据处理装置的结构示 意图; 图 10是本说明书一个实施例提供的一 种文本处理装置的结构示意 图; 图 11是本说明书一个实施例提供的一 种图像处理装置的结构示意 图; 图 12是本说明书一个实施例提供的一 种计算设备的结构框图。 具体实施方式 在下面的描述中阐述 了很多具体细节以便于充分理 解本说明书。 但是本说明书能 够以很多不 同于在此描述的其它方式 来实施, 本领域技术人员可以在不违背本说明书 内涵的情况 下做类似推广, 因此本说明书不受下面公开的具体实施 的限制。 在本说明书一个或多个 实施例中使用的术语是仅仅 出于描述特定实施例的 目的, 而非 旨在限制本说明书一个或多个实施 例。 在本说明书一个或多个实施例和所附权利 要求书 中所使用的单数形式的 “一种”、 “所述 ”和 “该 ”也旨在包括多数形式, 除非上下 文清楚地 表示其他含义。 还应当理解, 本说明书一个或多个实施例中使用的术 语 “和 / 或 ”是指并包含一个或多个相关联的列出项 目的任何或所有可能组合。 应当理解, 尽管在本说明书一个或多个实施例 中可能采用术语第一、 第二等来描 述各种信 息, 但这些信息不应限于这些术语。 这些术语仅用来将同一类型的信息彼此 区分开。 例如, 在不脱离本说明书一个或多个实施例范围的情 况下, 第一也可以被称 为第二 , 类似地, 第二也可以被称为第一。 取决于语境, 如在此所使用的词语 “如果” 可以被解释 成为 “在 时 "或 “当 时 "或 “响应于确定"。 此外, 需要说明的是, 本说明书一个或多个实施例所涉及的用户信息 (包括但不 限于用户设 备信息、 用户个人信息等) 和数据 (包括但不限于用于分析的数据、 存储 的数据、 展示的数据等) , 均为经用户授权或者经过各方充分授权的信息和数据, 并 且相关数据 的收集、 使用和处理需要遵守相关国家和地区的相 关法律法规和标准, 并 提供有相应 的操作入口, 供用户选择授权或者拒绝。 本说明书一个或多个实 施例中,大模型是指具有大规模模型参数的深度 学习模型, 通常包含 上亿、 上百亿、 上千亿、 上万亿甚至十万亿以上的模型参数。 大模型又可以 称为基石模 型/基础模型 (Foundation Model) , 通过大规模无标注的语料进行大模型 的预训练 , 产出亿级以上参数的预训练模型, 这种模型能适应广泛的下游任务, 模型 具有较好 的泛化能力, 例如大规模语言模型 (Large Language Model, LLM) 、 多模态 预训练模型 ( multi-modal pre-training model) 等。 大模型在实际应用时 , 仅需少量样本对预训练模型进行微调即可应用于不 同的任 务中,大模型可以广泛应用于 自然语言处理( Natural Language Processing,简称 NLP)、 计算机视 觉等领域, 具体可以应用于如视觉问答 (Visual Question Answering , 简称 VQA ) 、 图像描述 (Image Caption, 简称 IC) 、 图像生成等计算机视觉领域任务, 以 及基于文 本的情感分类、 文本摘要生成、 机器翻译等自然语言处理领域任务, 大模型 主要的应 用场景包括数字助理、 智能机器人、 搜索、在线教育、 办公软件、 电子商务、 智能设计等 。 首先, 对本说明书一个或多个实施例涉及的名词术语 进行解释。
Stable-Diffusion : 一种文本到图像的生成模型, 它主要用于根据文本的描述生成 详细图像 , 它也可以应用于其他任务, 如内补绘制、 外补绘制, 以及在提示词指导下 产生图生 图的转变。
Controlnet : Stable Diffusion模型中的一个重要配套插件, 它的作用是通过对特征 表示的控制 来引导图像的生成过程, 以保证生成的图像与输入的文本描述更加一致。
TensorRT : 一款高性能深度学习推理 SDK (Software Development Kit, 软件开发 工具包) , 包含深度学习推理优化器和运行环境, 可为深度学习推理应用提供低延迟 和高吞吐量 。 对于现代 的大模型, 如 LLM ( Large Language Model , 大规模语言模型) 和 Stable-Diffusion视觉生成模型, 在推理过程中采用了一系列轻量化控制技术来精确调 整输出结 果。 例如, Controlnet (Stable Diffusion模型中的一个重要配套插件) 设计了 一种并行 结构, 通过一个专门处理参考图像信息的独立网络模块 , 将其产生的计算结 果张量整合 到 Stable Diffusion模型的计算中, 以控制、 影响 Stable Diffusion模型生成 的图片。 另一方法则通过在模型内部插入特定 的上采样-下采样模块, 实现在不改变整 体模型架构 的情况下, 对生成的图片进行风格迁移和动态样式控制 。 现有技术一方法基于动 态图可动态调整的特性 , 通过替换计算图中的特定算子, 可以针对 不同输入或阶段自适应地优化 推理过程, 实现模型推理加速, 但这种方法限 制了可 以优化的方式, 不能实现更大规模上的算子融合; 现有技术的另一加速方法则 完全使 用静态图计算,无法动态修改计算图,无法动态支持如 Controlnet这样的方案。 因此, 本说明书实施例提供了一种数据处理方 法, 以静态图优化为基础, 同时保 留计算 图动态修改, 以在节省计算机硬件资源的基础上, 实现对计算图的动态修改。 在本说明书中, 提供了一种数据处理方法。 本说明书一个或者多个实施例 同时涉 及一种数据 处理装置, 一种文本处理方法, 一种文本处理装置, 一种图像处理方法, 一种图像 处理装置, 一种计算设备, 一种计算机可读存储介质以及一种计算机程序产 品, 在下面的实施例中逐一进行详细说 明。 参见图 1 , 图 1 示出了根据本说明书一个实施例提供的一种数据处理方法的场景 示意图。 具体的, 该数据处理方法应用客户端 102以及服务端 104实现, 客户端 102用于 向服务端 104发送目标数据, 在服务端 104中部署有目标模型, 将目标模型转换为静 态计算 图, 其中静态计算图中的节点代表数学运算 (即目标模型进行数据处理时的处 理操作) , 边则代表数据流 (即处理操作之间的关联关系) ; 并对目标模型的静态计 算图可 以进行编译优化, 比如通过合并重复操作、 减少冗余计算来提高处理效率, 并 能够利 用 GPU(Graphics Processing Unit, 图形处理器) 等硬件加速计算, 编译后的静 态计算 图能被高效地执行。 在将目标数据输入 目标模型的情况下, 执行目标模型的推理流程, 根据静态计算 图逐个节 点的进行计算,即从目标模型的静态计算图 中确定处理目标数据的当前节点 , 并确定 当前节点对应的数据处理计算 图, 其中, 数据处理计算图用于对目标处理数据 进行前置和 /或后置处理, 根据当前节点和 /或数据处理计算图, 处理目标数据, 获得数 据处理结 果, 并将该数据处理结果返回至客户端 102。 具体的, 通过判断当前节点是否存在其对应的数 据处理计算图, 并在存在的情况 下调用 当前节点对应的数据处理计算 图, 实际应用中, 数据处理计算图包括前置数据 处理计算 图、后置处理数据计算图,从而实现当前节点前后的数据处理计算图的增加 、 删除、 修改的功能。 客户端 102可以包括浏览器、 APP (Application, 应用程序) 、 或网页应用如 H5 (Hyper Text Markup Languages , 超文本标记语言第 5版) 应用、 或轻应用 (也被称 为小程序 , 一种轻量级应用程序) 或云应用等, 客户端可以基于服务端提供的相应服 务的软件开 发工具包 (SDK, Software Development Kit) , 如基于实时通信 (RTC, Real Time Communication) SDK开发获得等。 客户端可以部署在电子设备中, 需要依 赖设备运行 或者设备中的某些 APP而运行等。 电子设备可以具有显示屏并支持信息浏 览等, 如可以是个人移动终端如手机 、 平板电脑、 个人计算机等。 在电子设备中通常 还可 以配置各种其它类应用, 例如人机对话类应用、 模型训练类应用、 数据处理类应 用、 网页浏览器应用、 购物类应用、 搜索类应用、 即时通信工具、 邮箱客户端、 社交 平台软件等 。 服务端 104可以理解为提供各种服务的服务端, 包括物理服务端、 云服务端, 例 如为多个客 户端提供通信服务的服 务端, 又如为客户端上使用的模型提供支持的用于 后台训练 的服务端, 又如对客户端发送的数据进行处理的服 务端等。 需要说明的是, 服务端 104可以实现成多个服务端组成的分布式服 务端集群, 也可以实现成单个服务 端。 服务端 104也可以为分布式系统的服务端, 或者是结合了区块链的服务端 。 服务 端 104也可以是云服务、 云数据库、 云计算、 云函数、 云存储、 网络服务、 云通信、 中间件服 务、域名服务、安全服务、 内容分发网络(CDN, Content Delivery Network)、 以及大数据 和人工智能平台等基础 云计算服务的云服务端, 或者是带人工智能技术的 智能云计算服 务端或智能云主机。 值得说明的是, 本说明书实施例中提供的数据处理 方法可以由服务端 104执行, 在本说明 书的其它实施例中, 可以将目标模型部署在客户端 102 中, 使得客户端 102 也可以与服 务端 104具有相似的功能, 从而执行本说明书实施例所提供的数据 处理方 法; 在其它实施例中, 本说明书实施例所提供的数据处理方法还 可以是由客户端 102 与服务端 104共同执行。 本说明书实施例提供 的数据处理方法, 通过确定目标模型的目标计算图, 在给目 标模型输入 目标数据的情况下, 由于目标计算图为在目标模型运 行时不能进行更新的 计算图, 即目标计算图在目标模型运行前就被完全定义并编译, 这有利于在进行模型 推理前进行 对目标计算图的编译进行优 化, 降低处理器的运算负担, 提高处理器的执 行效率 ; 同时, 通过灵活地调用数据处理计算图, 能确保目标模型对目标数据进行高 效、 准确的前置处理或后置处理操作 , 实现在目标计算图中动态插入计算流程, 且无 需二次编译 , 节省计算图编译的开销, 减少对计算机硬件资源的需求和消耗, 提高模 型推理效率 。 参见图 2, 图 2示出了本说明书一个实施例提 供的一种数据处理方法的 流程图, 具体包括 以下步骤。 具体的, 所述数据处理方法应用于支持机器学习模型 计算的计算机硬件。 步骤 202 :确定目标模型的目标计算图以及输入所述目标模型的目标数据,其中, 所述 目标模型为机器学习模型, 所述目标计算图由多个节点 以及连接各节点之间的边 构建, 且所述目标计算图为在所述 目标模型运行时不能进行更新的计算 图。 其中, 目标模型可以理解为任意一种的数据处理模 型, 如文本处理模型、 图像处 理模型, 在此不做限定; 目标计算图可以理解为静态计算图, 根据目标模型的模型结 构以及运算流程 构建得到, 且为一个在目标模型执行推理流程前定 义并编译好的、 不 可变的计算 图。 具体的, 确定目标模型的目标计算图, 以及确定输入目标模型的目标数据, 输入 的 目标数据会被转换为目标计算图 的输入节点, 通过模型推理在目标模型中进行数据 传输, 并得到对目标数据处理后的数据 处理结果。 实际应用中, 在确定目标模型的静态计算图的情 况下, 由于静态计算图较动态计 算图来说 , 允许更高级别的优化, 如内存预分配、 计算图优化和硬件特定优化等, 因 此在部署和 大规模生产环境时, 利用静态计算图编译的 目标模型相比动态计算图能够 提升更高 的性能, 执行效率更快。 在本说明书一个或多个 实施例中, 由于动态计算图的运算和构建是一起进行 的, 也就是先计 算动态计算图中前面的 节点的值, 再根据这些得到的值构建后面的动态计 算图, 而在需要对构建好的动态计算 图进行修改的情况下, 整个动态计算图需重新构 建, 也就需要重新编译动态计算图 , 编译过程会存在大量计算机硬件资源的开销, 因 此为节省编 译带来的计算机硬件资 源的开销, 确定目标模型的静态计算图。 具体实现 方式如下所 述: 所述确定目标模型的 目标计算图以及输入所述 目标模型的目标数据, 包括: 根据所述支持机器学 习模型计算的计算机硬件的硬 件资源, 确定目标模型的目标 计算图 以及输入所述目标模型的 目标数据。 其中, 硬件资源包括但不限于 CPU (Central Processing Unit, 中央处理器) 、 内 存、 存储器、 网络等。 具体的, 在利用目标模型进行实际推理流程前, 需要对目标模型对应的计算图进 行编译, 即将源代码转换为计算机执行的目标代码; 而实际应用中, 在进行计算图编 译的情况 下, 不论是静态计算图还是动态计算图, 均需要大量的计算机硬件资源的开 销。 例如, 编译过程中需要 CPU来完成大量的计算, 如词法分析、 语法分析等; 需要 内存来存储 数据, 包括源代码、 中间代码、 目标代码等; 需要利用存储器资源来读取 和写入 大量的文件, 如源代码文件、 头文件等; 且在需要从网络下载依赖项或库的情 况下, 要用到网络资源。 由于动态计算图一边运算 一边构建的特性, 在需要对构建好的动态计算图进行修 改的情况 下, 会重新构建动态计算图, 此时则需要进行二次编译, 即重新对新构建的 动态计算 图机进行编译, 存在消耗大量计算机硬件资源的问题。 在本说明书实施例提供 的数据处理方法, 应用于支持机器学习模型计算的计 算机 硬件的基础 上, 根据所述支持机器学习模型计算的计算机硬件 的硬件资源, 来确定目 标模型的 目标计算图, 即在计算机硬件的硬件资源受限、 配置不足的情况下, 可将目 标模型转换 为静态计算图, 在需要对静态计算图进行修改的情况 下, 利用动态的调用 数据处理计 算图的方式实现, 因此不会存在二次编译的情况, 即无需重新编译静态计 算图, 能够节省大量计算图编译的开销 , 减少对计算机硬件资源的需求和消耗。 在本说明书一个或多个 实施例中, 为准确的构建目标模型的目标计算图, 在获得 目标模型 的情况下, 根据目标模型确定目标计算图中的节点 以及边。 具体实现方式如 下所述 : 所述确定所述目标模型的 目标计算图, 包括: 获取所述目标模型, 将所述目标模型进行数据处理 的处理操作作为所述节 点, 将 所述处理操作 之间的关联关系作为边 ; 根据所述节点和所述边 , 构建所述目标计算图。 其中, 节点可以理解为, 一个具体的数学运算或者数据处理操作; 边用于表示数 据流的方 向和数据处理操作之间的依赖 关系。 具体的, 首先根据机器学习任务的需求设计并实现 目标模型的模型结构, 从而获 得 目标模型, 或者可以获取一个已设计完成的目标模型, 将目标模型在进行数据处理 过程中的处 理操作作为构建目标计算 图的节点, 例如, 在神经网络中, 节点可以代表 矩阵乘法 、 加法、 激活函数应用、 损失函数计算、 优化器更新步骤等; 并根据各个处 理操作之 间的关联关系作为构建 目标计算图的边, 比如, 在目标模型推理过程中, 输 入数据经过 第一个卷积层的处理后得 到的输出, 作为下一个卷积层或池化层的输入, 这种前后层 之间的联系就可以通过边来 表达; 从而根据节点和边, 构建目标计算图。 本说明实施例提供的数 据处理方法, 通过构建目标计算图的方式, 能够明确表示 出 目标计算图中可以并行执行的计算 步骤, 这有利于大规模数据集上的高效的进行模 型推理流程 。 在分布式环境下, 根据目标计算图的结构还可将数据处理任务分解到不 同的计算资 源上, 提高计算机系统的性能和稳定性。 在本说明书一个或多个 实施例中, 首先根据节点和边, 构建初始计算图, 在初始 计算图也 为静态计算图的情况下, 通过编译初始计算图中的各个 节点, 实现图优化, 得到 目标计算图。 具体实现方式如下所述: 所述根据所述节点和所述 边, 构建所述目标计算图, 包括: 根据所述节点和所述边 , 构建初始计算图; 对所述初始计算图 中的目标节点以及目标边进行 冗余消除操作, 获得所述目标模 型的 目标计算图, 以使目标模型在目标处理器低使用率的状态下运行 。 其中, 目标节点可以理解为, 需要优化或者调整的节点, 例如重复的计算节点、 可以融合 的节点等; 目标边则可以理解为, 与目标节点相关联的边, 如在对目标节点 删除的情 况下, 需要对与其相关联的目标边也进行删除; 目标处理器可以理解为, 运 行 目标模型的处理器, 用于为目标模型进行模型推理流程时提供 计算资源, 如中央处 理器、 图形处理器等, 在此不做限定。 具体的, 根据节点以及边, 构建初始计算图的情况下, 由于初始计算图为静态计 算图, 可以对初始计算图中的节点进 行编译, 实现对初始计算图的图优化, 包括但不 限于常量折 叠、 算子融合、 死代码删除等冗余消除操作, 从而得到更简洁、 高效的目 标计算 图。 在通过消除不必要的重 复计算或合并连续的操作 , 获得目标计算图的情况下, 可 以减少 目标模型推理过程中的计算 步骤和内存访问次数, 且去除目标节点后, 不需要 为这些无 效或重复的计算分配额外 的内存, 有助于降低内存占用, 实现目标处理器能 够以低使 用率的状态运行目标模型。 本说明实施例提供的数 据处理方法, 通过对初始计算图中的节点进行冗余 消除操 作, 能够提高目标模型的执行性能 , 更简洁高效的目标计算图也有助于目标模型在不 同硬件平 台上的部署与移植。 步骤 204 : 从所述目标计算图中确定处理所述目标数据的当前节点, 其中, 所述 当前节点 为所述多个节点中的任意一个 节点。 其中, 当前节点可以理解为, 目标模型按照目标计算图的结构顺序执行运算 时所 处的具体 节点。 具体的,在目标模型执行推理过程时,引擎根据目标计算图逐个节点 的进行计算, 其中, 在深度学习框架中, 引擎可以理解为处理目标计算图的 内核部分, 能够解析目 标计算 图的结构, 调度节点执行顺序, 并利用底层计算机硬件进行并行计算和内存管 理。 实际应用中, 当目标数据输入目标模型后, 目标数据会首先被传递到目标计算图 中的第一个 节点进行处理, 该节点可以为对应于目标模型输入层 的节点, 负责对目标 数据进行初 步转换; 随着计算流程的推进, 每个节点根据其定义的处理操作和关联边 接收上一个 节点的输出作为输入, 并产生新的输出。 步骤 206: 确定所述当前节点对应的数据处理计算图, 根据所述当前节点和 /或所 述数据处理 计算图, 处理所述目标数据, 获得数据处理结果。 其中, 数据处理计算图可以理解为, 在目标计算图之外的、 进行数据处理的静态 计算图。 具体的, 可以确定当前节点对应的数据处理计算 图, 根据是否需要对目标处理数 据进行前置 和 /或后置处理的需求, 利用当前节点和 /或所述数据处理计算图, 处理所述 目标数据 , 获得数据处理结果。 实际应用中, 在数据处理计算图也为静态计算 图的情况下, 通过目标计算图与数 据处理计算 图结合实现的计算图框架 , 能够实现多变的动态计算逻辑, 并且数据处理 计算图可 以根据实际需求随时进行适应性 的调用, 灵活度大。 在本说明书一个或多个 实施例中, 通过判断当前节点对应的目标模型的 目标结构 单元是否在 前置处理表中, 确定目标结构单元对应的前置数据处理 计算图。 具体实现 方式如下所 述: 所述确定所述当前节点对应 的数据处理计算图, 包括: 根据目标映射表, 确定所述当前节点对应的所述 目标模型的目标结构单元; 在所述目标结构单元在前 置处理表中的情况下, 从所述前置处理表中确定所述 目 标结构单元对 应的前置数据处理计算 图, 其中, 所述前置处理表中包括所述目标结构 单元与所述 前置数据处理计算图的 映射关系, 所述前置数据处理计算图用于对目标处 理数据进行 前置处理。 其中, 目标映射表可以理解为, 描述目标计算图中的节点与目标模型的结构 单元 之间的对应 关系的数据结构; 其中, 目标模型的结构单元可以理解为, 构建目标模型 的基本组成 元素, 例如在神经网络中, 结构单元可以理解为网络层, 包括但不限于输 入层、 隐藏层 (全连接层、 卷积层、 循环层等) 、 输出层等; 目标结构单元可以理解 为, 根据目标映射表确定的、 与当前节点对应的结构单元。 前置数据处理计算 图可以理解为, 执行当前节点之前, 对目标数据进行处理的计 算图。 具体的, 首先根据目标映射表确定当前节点对应 的目标模型的目标结构单元 , 查 找 目标结构单元是否在前置处理表 中, 若在, 从所述前置处理表中确定所述目标结构 单元对应 的前置数据处理计算图, 若不在, 则根据当前节点对目标数据进行处理。 如图 3所示, 图 3示出了本说明书实施例提供的一种前置处理表的示 意图。 例如在 Controlnet 中, 通常将输入数据与一个目标计算图外的常量值进行相加, 实现对输入 数据的处理; 此时根据目标映射表, 确定当前节点对应的目标模型的目标 结构单元为结 构单元 1 , 通过如图 3所示的前置处理表, 结构单元 1指向一个外部加 法计算 图 (即前置数据处理计算图),其中,输入 [0]=获取输入 () (input[O]=getInputs()) 表示获取输 入数据; 输入 [1]=常量 () (input[l]=Constant()) 表示设置一个常量值; 输出 [0]=输入 [0]+输入 [1] (output[0]=input[0]+input[l] ) 表示将输入数据与常量值相加, 得 到输出结果 ; 返回输出 [0] (return output[0] ) 表示返回计算后的输出结果; 由此, 经过 外部加法计 算图, 实现在当前节点之前将输入数据与外部的数据进 行加法, 完成外部 加法计算 图的插入。 本说明实施例提供的数 据处理方法, 在根据目标映射表确定的目标结构单元在 前 置处理表 中的情况下,从前置处理表中确定目标结构单元对应 的前置数据处理计算图, 以通过前置 数据处理计算图对 目标数据进行处理,实现在当前节点前动态插入计算 图。 在本说明书一个或多个 实施例中, 根据目标计算图中的节点以及目标模型 的结构 单元之 间的映射关系, 构建目标映射表。 具体实现方式如下所述: 所述根据目标映射表 , 确定所述当前节点对应的目标模型的目标结构单元之前 , 还包括 : 确定构建所述目标模型的结 构单元, 其中, 所述结构单元为目标模型的网络层; 确定所述目标计算图中各 节点对应的结构单元; 根据所述目标计算 图中的节点以及所述目标模型 的结构单元之间的映射关 系, 构 建所述 目标映射表。 具体的, 以一个包含多个结构单元的 UNET模型 为例, 其中, UNET (U-Net) 是 一种卷积神 经网络 (Convolutional Neural Network, CNN) 架构, U-Net的名字来源于 其独特的 U形结构。 如图 4所示, 图 4示出了本说明书实施例提供的一种 UNET模型 结构示意 图; UNET模型的结构主要 包含两部分: 编码器块 (Encoder block) 和解码 器块 (Decoder block) 。 而编码器块通常包含 多层结构, 每一层又包括自注意力机制 ( Self- Attention) 和 前馈神经 网络 (Feedforward Neural Network, 简称 FFN) 等, 因此, 每个编码器块包 括有子模块 , 类似的, 解码器块包括有子模块。 在将目标模型转换为 目标计算图的过程中时, 目标模型会被转换为包含若干节点 的静态计算 图, 记录目标计算图中的各节点在目标模型中的结构 单元位置和索引, 记 录为 目标映射表, 即节点与每个 block及其子模块之间的对应关系表; 如图 5所示, 图 5示出了本说明书实施例提供的一 种目标映射表的示意图, 节点 1 与结构单元 0.0 对应, 节点 2与结构单元 0.1对应, 节点 3与结构单元 0.2对应, 节点 4与结构单元 1.0对应, 直到节点 n与结构单元 n.n对应。 本说明实施例提供的数据 处理方法, 通过构建目标映射表, 实现根据目标计算图 中当前节 点, 找到其所对应的目标模型内部的具体结构单元, 并准确地进行相关的数 据处理和运算 ; 从而更清晰地了解并控制整个目标模型计算流程 , 确保数据在经过目 标计算图 中的每个节点时, 都能够按照目标模型设计的要求进行处理 。 在本说明书一个或多个 实施例中, 通过前置数据处理计算图、 当前节点、 后置数 据处理计算 图, 根据实际情况准确的进行数据处理, 且通过前置数据处理计算图以及 后置数据处 理计算图实现对目标计算 图中节点的插入、 删除等功能。 具体实现方式如 下所述 : 所述根据所述当前节点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据 处理结果, 包括: 根据所述前置数据处理计 算图, 处理所述目标数据, 获得前置处理数据; 在根据所述前置处理数据 确定执行所述当前节点 的情况下, 根据所述当前节点处 理所述前置 处理数据, 获得当前处理数据; 在目标结构单元在后置处 理表中的情况下, 从所述后置处理表中确定所述 目标结 构单元对应 的后置数据处理计算图, 其中, 所述后置处理表中包括所述目标结构单元 与所述后置 数据处理计算图的映射关 系, 所述后置数据处理计算图用于对目标处理数 据进行后置 处理; 根据所述后置数据处理计 算图,处理所述当前处理数据,获得所述数据处理结果。 其中, 前置处理数据可以理解为, 利用前置数据处理计算图对目标数据进行 处理 获得的处理 数据; 当前处理数据可以理解为, 利用当前节点对前置数据处理计算图输 出的前置处理 数据, 进行处理获得的处理结果。 后置数据处理计算图可 以理解为, 执行当前节点之后, 对目标处理数据进行处理 的计算图 , 其中, 在获得前置处理数据且不执行当前节点的情况下, 目标处理数据可 以理解为前 置处理数据, 即利用后置数据处理计算图对前置处理数 据进行处理, 获得 数据处理结 果; 在获得前置处理数据且执行当前节点的情况下, 目标处理数据可以理 解为当前处理 数据,即利用后置数据处理计算图对当前处理数 据,获得数据处理结果; 或者, 在当前节点对应的结构单元不在 前置处理表中的情况下, 利用当前节点对目标 数据进行处 理, 获得目标处理结果, 此时, 目标处理数据可以理解为目标处理结果, 即利用后置数 据处理计算图对 目标处理结果进行处理, 获得数据处理结果。 具体的, 在目标结构单元在前置处理表中的情况下 , 从前置处理表中确定目标结 构单元对应 的前置数据处理计算图, 利用前置数据处理计算图, 处理目标数据, 获得 前置处理数 据; 且根据前置处理数据判断是否要继续执行当前节 点 (例如, 如果前置 数据处理计 算图用于检测环境准备就 绪, 为在执行当前节点之前的必要步骤, 当前置 处理数据 的状态为 “就绪 ”时才继续执行后续节点) , 若是, 则根据所述当前节点处理 前置处理数据 , 获得当前处理数据, 此时即在当前节点前实现了计算图的添加。 在执行当前节点之后 , 判断目标结构单元是否在后置处理表中, 若是, 从后置处 理表中 目标结构单元对应的后置数据处理 计算图, 并根据后置数据处理计算图, 处理 当前处理数据 , 获得数据处理结果; 若否, 则将当前处理数据, 确定为数据处理结果。 所述根据所述当前节点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据 处理结果, 包括: 根据所述前置数据处理计 算图, 处理所述目标数据, 获得前置处理数据; 在根据所述前置处理数据 确定不执行所述当前节 点、 且目标结构单元在后置处理 表中的情 况下, 从所述后置处理表中确定所述目标结构单元对应 的后置数据处理计算 图,根据所述后置数据处 理计算图,处理所述前置处理数据,获得所述数据处理结 果, 或者, 在根据所述前置处理数 据确定不执行所述当前节 点、 且目标结构单元不在后置处 理表的情 况下, 将所述前置处理数据确定为数据处理结果。 具体的, 在目标结构单元在前置处理表中的情况 下, 从前置处理表中确定目标结 构单元对应 的前置数据处理计算图, 利用前置数据处理计算 图, 处理目标数据, 获得 前置处理数 据, 而在根据前置处理数据确定不继续执行当前节 点的情况下, 判断目标 结构单元是 否在后置处理表中,若是,利用后置数据处理计算图,处理前置处理数据 , 获得数据 处理结果; 若否, 即目标结构单元不在后置处理表中, 将前置处理数据, 确 定为数据处 理结果; 在不继续执行当前节点的情况下, 实现了对当前节点的删除。 本说明实施例提供的数 据处理方法, 通过在目标模型推理过程中, 在执行当前节 点之前 /之后插入判断是否存在前置数据处理计算图 、 后置数据处理计算图的方式, 实 现在 目标计算图中的动态的插入其他计算 流程。 在本说明书一个或 多个实施例中, 在目标结构单元不在前置处理表中的情况 下, 利用当前 节点对目标数据进行处理。 具体实现方式如下所述: 所述确定所述当前节点对 应的数据处理计算图, 包括: 根据目标映射表, 确定所述当前节点对应的所述 目标模型的目标结构单元; 在所述目标结构单元不在 前置处理表中的情况下 , 根据所述当前节点处理所述目 标数据, 获得当前处理数据; 在目标结构单元在后置 处理表中的情况下, 从所述后置处理表中确定所述 目标结 构单元对应 的后置数据处理计算图。 具体的, 在目标结构单元不在前置处理表中的情 况下, 则按照目标计算图中的顺 序执行 当前节点, 利用当前节点对目标数据进行处理, 获得当前处理数据, 并在执行 当前节点之 后, 判断目标结构单元是否在后置处理表, 若在, 则从后置处理表中所述 目标结构单 元对应的后置数据处理计算 图。 本说明实施例提供的数 据处理方法, 通过前置处理表和后置处理表, 能够对复杂 模型中的各 个结构单元的数据处理过程 进行有序管理, 保证数据在不同阶段按照预设 的规则流动 和处理。 在本说明书一个或 多个实施例中, 在执行当前节点之后, 可在目标结构单元在后 置处理表 中的情况下, 确定后置数据处理计算图, 并利用后置数据处理计算图对当前 处理数据进 行处理。 具体实现方式如下所述: 所述根据所述当前节 点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据 处理结果 , 包括: 根据所述后置数据处理 计算图,处理所述当前处理数据,获得所述数据处理结果。 具体的, 在目标结构单元在后置处理表中的情况 下, 从后置处理表中确定目标结 构单元对应 的后置数据处理计算图, 从而利用后置数据处理计算 图, 处理当前处理数 据, 获得所述数据处理结果。 本说明实施例提供的数 据处理方法, 在执行当前节点之后, 判断目标结构单元是 否在后置 处理表中, 在目标结构单元在后置处理表时, 则可以从后置处理表中找到对 应的后置数 据处理计算图, 确保数据在进入下一节点之前经过必 要的预处理, 提高数 据传递的 准确性。 在本说明书一个或 多个实施例中, 目标模型的目标计算图存在多个节点, 在执行 完整个 当前节点的计算流程后, 判断是否还存在当前节点的下一 节点, 若存在, 则将 数据处理 结果传递给下一节点, 并将下一节点确定为当前节点 。 具体实现方式如下所 述: 所述获得所述数据处理 结果之后, 还包括: 判断是否存在所述 当前节点的下一节点, 若存在, 将所述当前节点的下一节点确定为 当前节点, 并将所述数据处理结果作 为所述 目标数据, 执行所述确定所述当前节点对应的数据处理计 算图, 根据所述当前 节点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据处理结果的步骤。 若不存在, 输出所述数据处理结果。 在目标模型的推理过程 中, 检查当前节点是否还有后续的节点; 如果当前节点有 下一节 点, 则将下一节点设置为当前节点, 并将当前节点得到的数据处理结果作为 目 标数据 , 然后, 根据新确定的当前节点执行所述确定所述当前节点对应的数据处理计 算图, 根据所述当前节点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据处 理结果 的步骤,继续对目标数据进行相应的处理,获得数据处理结 果;重复这个过程, 直到 目标计算图中的节点都执行完毕 。 在当前节点没有下一 节点的情况下, 意味着模型推理流程已经到达了 目标计算图 的末端 , 此时, 不再继续迭代到下一节点, 而是直接输出当前的数据处理结果。 本说明实施例提供 的数据处理方法, 通过该种方式, 确保了输入的目标数据能够 按照 目标计算图的设计, 逐层经过各个节点的运算和处理, 最终得出模型预测或推理 的结果 。 本说明书实施例提供 的数据处理方法, 通过确定目标模型的目标计算图, 在给目 标模型输 入目标数据的情况下, 由于目标计算图为在目标模型运行时不能进行更新的 计算 图, 即目标计算图在目标模型运行前就被完全定义并编译 , 这有利于在进行模型 推理前进 行对目标计算图的编译进 行优化, 降低处理器的运算负担, 提高处理器的执 行效率 ; 同时, 通过灵活地调用数据处理计算图, 能确保目标模型对目标数据进行高 效、 准确的前置处理或后置处理操作 , 实现在目标计算图中动态插入计算流程, 且无 需二次编译 , 节省计算图编译的开销, 减少对计算机硬件资源的需求和消耗, 提高模 型推理 效率。 参见图 6, 图 6示出了本说明书一个实施例提供的一种数据处理方法 的单节点处 理过程流程 图, 具体包括以下步骤。 步骤 602: 根据目标映射表, 得到当前节点对应的目标结构单元。 实际应用中, 获取以动态图架构实现的 目标模型, 并将目标模型的动态计算图转 换为静 态计算图, 并根据静态计算图中各个节点与模型结构 中的各个结构单元的对应 关系, 构建 node->block映射表 (即目标映射表) , node即静态计算图中各个节点, block即模型结构中的结构单元。 在执行模型推理过程 的情况下, 根据静态计算图逐节点进行计算; 而针对当前节 点首先根据 上述 node->block映射表得到当前节点对应的 blocko 步骤 604 : 判断目标结构单元是否在前置处理表中, 若是, 执行步骤 606 ; 若否, 则执行 步骤 610o 判断当前节点对应的 block是否在 pre_process表(即上述实施例中的前置处理表) 中, 若在, 执行步骤 606, 即执行 pre_process表中该 block对应的计算图, 若否, 执 行 610, 即直接执行当前节点计算。 步骤 606: 执行前置处理表中目标结构单元对应的前置数据处理计算图。 在当前节点对应的 block在 pre_process表中的情况下, 执行 pre_process表中的该 block对应的计算图, 并得到返回数据 (即上述实施例中的前置处理数据) 以及是否继 续计算 的结果。 步骤 608: 判断是否继续计算, 若是, 执行步骤 610; 若否, 则执行步骤 612。 在确定继续计算的情况 下, 执行当前节点计算, 此时相当于在当前节点前插入了 计算图 ,实现了计算图的添加功能;在不继续计算的情况下,则跳过当前节点的计 算, 并将返 回数据传递给当前节点的下一个 节点, 即实现了当前节点的删除功能。 步骤 610: 执行当前节点计算。 步骤 612: 判断目标结构单元是否在后置处理表中, 若是, 执行步骤 614; 若否, 则执行 步骤 616o 类似的,在执行完当前节点后,也根据 node->block映射表得到当前节点的 block, 而后查找 block是否在 after_process表 (后置处理表) 中, 如果在 after_process表中, 则执行 步骤 614,即执行 after_process表中的 block对应的计算图;若不在 after_process 表中, 则直接结束当前节点的整个计算 流程。 步骤 614 : 执行后置处理表中目标结构单元对应的后置数据处理计算图。 在当前节点的 block在 after_process表中的情况下, 执行 after_process表中的该 block对应的计算图, 并得到返回数据 (即上述实施例中的数据处理结果) 。 步骤 616 : 结束。 完成当前节点的整个 计算流程, 并将得到的数据处理结果传递给当前节点 的下一 节点。 本说明书实施例提供 的数据处理方法, 通过灵活地调用数据处理计算图, 能确保 目标模型 对目标数据进行高效、 准确的前置处理或后置处理操作 , 实现在目标计算图 中动态插入 计算流程, 且无需二次编译, 节省计算图编译的开销, 减少对计算机硬件 资源的 需求和消耗, 提高模型推理效率。 参见图 7, 图 7示出了本说明书一个实施例提供的一种文本处理方法 的流程图, 具体包括 以下步骤。 步骤 702 :确定目标模型的目标计算图以及输入所述目标模型的目标文本,其中, 所述 目标模型为机器学习模型, 所述目标计算图由多个节点 以及连接各节点之间的边 构建, 且所述目标计算图为在所述 目标模型运行时不能进行更新的计 算图; 步骤 704 : 从所述目标计算图中确定处理所述目标文本的当前节点, 其中, 所述 当前节 点为所述多个节点中的任意一个 节点; 步骤 706: 确定所述当前节点对应的文本处理计算图, 根据所述当前节点和 /或所 述文本处理 计算图, 处理所述目标文本, 获得文本处理结果。 具体的, 以目标模型为一个深度学习的文本分 类模型为例, 对该文本处理方法进 行详细说 明。 文本分类模型以动 态图形式构建, 首先, 将其转换为静态计算图以便于管理和优 化推理过程 。 根据模型结构 (如词嵌入层、 卷积层、 循环神经网络层、 全连接层等) , 构建一个 node->block映射表, 其中每个节点代表静态计算图中的运算步骤, 而 block 则对应文 本分类模型实际的结构单元 。 在模型推理阶段, 在输入目标文本的情况下, 根据静态计算图按顺序执行 节点计 算, 假设当前节点对应的是词嵌入层 (block) , 在前置处理表中查找到该 block存在 前置文本 处理计算图, 比如对输入的目标文本进行分词或者填 充等预处理, 得到预处 理后的数 据, 并判断是否满足继续计算的条件 (如数据有效、 长度合适等) ; 若满足 继续计算 条件, 则执行当前节点 (词嵌入层) 的实际计算, 将预处理后的文本转化为 词向量表 示。 当前节点计算完成后 , 进一步检查该当前节点在后置处理表中是否存在前 置文本 处理计算 图, 比如进行数据归一化或者其他后处理步骤; 如果存在, 则执行相应的后 置数据处理 计算图并获取结果; 若不存在, 则直接结束当前节点计算流程, 将计算结 果传递给下 一个节点。 本说明书实施例提供 的文本处理方法, 通过调用数据处理计算图, 可以灵活地插 入或删除静 态计算图的部分, 以适应不同的数据预处理需求或后 处理需求, 从而优化 整个 目标模型的推理效率与效果。 参见图 8, 图 8示出了本说明书一个实施例提供的一种图像处理方法的 流程图, 具体包括 以下步骤。 步骤 802:确定目标模型的目标计算图以及输入所述目标模型的 目标图像,其中, 所述 目标模型为机器学习模型, 所述目标计算图由多个节点 以及连接各节点之间的边 构建, 且所述目标计算图为在所述 目标模型运行时不能进行更新的计算 图; 步骤 804: 从所述目标计算图中确定处理所述目标图像的当前节点, 其中, 所述 当前节点 为所述多个节点中的任意一个 节点; 步骤 806: 确定所述当前节点对应的图像处理计算图, 根据所述当前节点和 /或所 述图像处理 计算图, 处理所述目标图像, 获得图像处理结果。 具体的, 以目标模型为图像分类模型为例, 对该图像处理方法进行详细说明。 该图像分类模型包含 多个结构单元, 如输入层、 卷积层、 池化层、 全连接层和输 出层等。 在将动态图转换为静态计算 图后, 首先, 根据图像分类模型的静态计算图, 构建节点与模 型结构单元之间的映射关 系。 比如, 某个节点对应着第一个卷积层的计 算。 在模型推理阶段, 在输入目标图像的情况下, 根据静态计算图按顺序逐个 节点执 行节点计算 , 根据 node->block映射表, 得知当前节点对应的是第一个卷积层。 判断该卷积层是否在前置 处理表中, 若在 pre_process表中, 执行前置处理表中该 卷积层对应 的计算图, 根据该计算图对输入的目标图像进行预处 理操作, 得到标准化 后的图像数 据;并确定需要继续执行当前节点计算,执行当前节点 (即第一个卷积层) 的计算, 对预处理过的图像数据进行 特征提取, 获得特征提取结果; 判断该当前节点 是否在后置 处理表中, 若不存在则将特征提取结果传递给下一个 节点。 本说明书实施例提供 的图像处理方法, 通过调用数据处理计算图, 可以灵活地插 入或删除静 态计算图的部分, 以适应不同的数据预处理需求或后 处理需求, 从而优化 整个 目标模型的推理效率与效果。 与上述方法实施例相对应 , 本说明书还提供了数据处理装置实施例, 图 9示出了 本说明书一 个实施例提供的一种数据处理 装置的结构示意图。 如图 9所示, 该装置包 括 : 数据确定模块 902, 被配置为确定目标模型的目标计算图以及输入所述 目标模型 的 目标数据, 其中, 所述目标模型为机器学习模型, 所述目标计算图由多个节点以及 连接各节 点之间的边构建, 且所述目标计算图为在所述 目标模型运行时不能进行更新 的计算 图; 节点确定模块 904, 被配置为从所述目标计算图中确定处理所述目标数据 的当前 节点, 其中, 所述当前节点为所述多个节点中的任意一个节点 ; 结果获得模块 906, 被配置为确定所述当前节点对应的数据处理计算图, 根据所 述当前节 点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据处理结果。 可选地, 所述结果获得模块 906, 进一步被配置为: 根据目标映射表, 确定所述当前节点对应的所述 目标模型的目标结构单元; 在所述目标结构单元在前 置处理表中的情况下, 从所述前置处理表中确定所述 目 标结构单元对 应的前置数据处理计算 图, 其中, 所述前置处理表中包括所述目标结构 单元与所述 前置数据处理计算图的映射 关系, 所述前置数据处理计算图用于对目标处 理数据进行 前置处理。 可选地, 所述结果获得模块 906, 进一步被配置为: 根据所述前置数据处理计 算图, 处理所述目标数据, 获得前置处理数据; 在根据所述前置处理数据 确定执行所述当前节点 的情况下, 根据所述当前节点处 理所述前置 处理数据, 获得当前处理数据; 在目标结构单元在后置处 理表中的情况下, 从所述后置处理表中确定所述 目标结 构单元对应 的后置数据处理计算图, 其中, 所述后置处理表中包括所述目标结构单元 与所述后置 数据处理计算图的映射关 系, 所述后置数据处理计算图用于对目标处理数 据进行后置 处理; 根据所述后置数据处理计 算图,处理所述当前处理数据,获得所述数据处理结果。 可选地, 所述结果获得模块 906, 进一步被配置为: 根据所述前置数据处理计 算图, 处理所述目标数据, 获得前置处理数据; 在根据所述前置处理数据 确定不执行所述当前节 点、 且目标结构单元在后置处理 表中的情况 下, 从所述后置处理表中确定所述目标结构单元对应的 后置数据处理计算 图,根据所述后置数据处理 计算图,处理所述前置处理数据,获得所述数据处理结 果, 或者, 在根据所述前置处理数据 确定不执行所述当前节 点、 且目标结构单元不在后置处 理表的情况 下, 将所述前置处理数据确定为数据处理结果。 可选地, 所述结果获得模块 906, 进一步被配置为: 根据目标映射表, 确定所述当前节点对应的所述 目标模型的目标结构单元; 在所述目标结构单元不在 前置处理表中的情况下 , 根据所述当前节点处理所述目 标数据, 获得当前处理数据; 在目标结构单元在后置处 理表中的情况下, 从所述后置处理表中确定所述 目标结 构单元对应 的后置数据处理计算图。 可选地, 所述结果获得模块 906, 进一步被配置为: 根据所述后置数据处理计 算图,处理所述当前处理数据,获得所述数据处理结果。 可选地, 所述数据确定模块 902, 进一步被配置为: 获取所述目标模型, 将所述目标模型进行数据处理 的处理操作作为所述节点 , 将 所述处理操作 之间的关联关系作为边 ; 根据所述节点和所述边 , 构建所述目标计算图。 可选地, 所述数据确定模块 902, 进一步被配置为: 根据所述节点和所述边 , 构建初始计算图; 对所述初始计算图中的 目标节点以及目标边进行 冗余消除操作, 获得所述目标模 型的 目标计算图, 以使目标模型在目标处理器低使用率的状态下运行 。 所述装置, 还包括: 构建模块, 被配置为确定构建所述目标模型的结构单元 , 其中, 所述结构单元为 目标模型的 网络层; 确定所述目标计算图中各 节点对应的结构单元; 根据所述目标计算图 中的节点以及所述目标模型 的结构单元之间的映射关 系, 构 建所述 目标映射表。 所述装置, 还包括: 后处理模块, 被配置为判断是否存在所述当前节点 的下一节点, 若存在, 将所述当前节点的下一节点确定为当前 节点, 并将所述数据处理结果作 为所述 目标数据, 执行所述确定所述当前节点对应的数据处理计算 图, 根据所述当前 节点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据处理结果的步骤, 若不存在, 输出所述数据处理结果。 可选地, 所述数据确定模块 902, 进一步被配置为: 根据所述支持机器学 习模型计算的计算机硬件的硬 件资源, 确定目标模型的目标 计算图 以及输入所述目标模型的 目标数据。 上述为本实施例的一种 数据处理装置的示意性方 案。 需要说明的是, 该数据处理 装置的技术 方案与上述的数据处理 方法的技术方案属于同一构思 , 数据处理装置的技 术方案未详 细描述的细节内容, 均可以参见上述数据处理方法的技 术方案的描述。 与上述方法实施例相对应 , 本说明书还提供了文本处理装置实施例, 图 10示出了 本说明书一 个实施例提供的一种文本处理 装置的结构示意图。如图 10所示, 该装置包 括 : 文本确定模块 1002, 被配置为确定目标模型的目标计算图以及输入所述目标模型 的 目标文本, 其中, 所述目标模型为机器学习模型, 所述目标计算图由多个节点以及 连接各节 点之间的边构建, 且所述目标计算图为在所述 目标模型运行时不能进行更新 的计算 图; 节点确定模块 1004, 被配置为从所述目标计算图中确定处理所述目标文本的当前 节点, 其中, 所述当前节点为所述多个节点中的任意一个节点 ; 结果获得模块 1006, 被配置为确定所述当前节点对应的文本处理计算图, 根据所 述当前节 点和 /或所述文本处理计算图, 处理所述目标文本, 获得文本处理结果。 上述为本实施例的一种 文本处理装置的示意性方 案。 需要说明的是, 该文本处理 装置的技术 方案与上述的数据处理 方法的技术方案属于同一构思 , 文本处理装置的技 术方案未详 细描述的细节内容, 均可以参见上述数据处理方法的技 术方案的描述。 与上述方法实施例相对应 , 本说明书还提供了图像处理装置实施例, 图 11示出了 本说明书一 个实施例提供的一种图像处理 装置的结构示意图。如图 11所示, 该装置包 括 : 图像确定模块 1102, 被配置为确定目标模型的目标计算图以及输入所述目标模型 的 目标图像, 其中, 所述目标模型为机器学习模型, 所述目标计算图由多个节点以及 连接各节 点之间的边构建, 且所述目标计算图为在所述 目标模型运行时不能进行更新 的计算 图; 节点确定模块 1104, 被配置为从所述目标计算图中确定处理所述目标图像的当前 节点, 其中, 所述当前节点为所述多个节点中的任意一个节点 ; 结果获得模块 1106, 被配置为确定所述当前节点对应的图像处理计算图, 根据所 述当前节 点和 /或所述图像处理计算图, 处理所述目标图像, 获得图像处理结果。 上述为本实施例的一种 图像处理装置的示意性方 案。 需要说明的是, 该图像处理 装置的技术 方案与上述的数据处理 方法的技术方案属于同一构思 , 图像处理装置的技 术方案未详 细描述的细节内容, 均可以参见上述数据处理方法的技 术方案的描述。 图 12示出了根据本说明书一个实施 例提供的一种计算设备 1200的结构框图。 该 计算设备 1200的部件包括但不限于存储器 1210和处理器 1220。 处理器 1220与存储 器 1210通过总线 1230相连接, 数据库 1250用于保存数据。 计算设备 1200还包括接入设备 1240, 接入设备 1240使得计算设备 1200能够经 由一个或 多个网络 1260 通信。 这些网络的示例包括公用交换电话网 (PSTN, Public Switched Telephone Network)、 局域网 (LAN, Local Area Network)、 广域网 (WAN, Wide Area Network) 、 个域网 (PAN, Personal Area Network) 或诸如因特网的通信网 络的组合 。 接入设备 1240可以包括有线或无线的任何类型的网络接口 (例如, 网络接 口卡 (NIC, network interface controller) ) 中的一个或多个, 诸如 IEEE802.i l无线局 域网 (WLAN, Wireless Local Area Network)无线接口、全球微波互联接入 (Wi-MAX, Worldwide Interoperability for Microwave Access ) 接口、 以太网接口、 通用串行总线
(USB, Universal Serial Bus)接口、 蜂窝网络接口、 蓝牙接口、 近场通信 (NFC, Near Field Communication ) 。 在本说明书的一个实施 例中, 计算设备 1200的上述部件以及图 12中未示出的其 他部件也 可以彼此相连接, 例如通过总线。 应当理解, 图 12所示的计算设备结构框图 仅仅是 出于示例的目的, 而不是对本说明书范围的限制。 本领域技术人员可以根据需 要, 增添或替换其他部件。 计算设备 1200可以是任何类型的静止或移动计算设备,包括移动计算机或移动计 算设备 (例如, 平板计算机、 个人数字助理、 膝上型计算机、 笔记本计算机、 上网本 等) 、 移动电话 (例如, 智能手机) 、 可佩戴的计算设备 (例如, 智能手表、 智能眼 镜等) 或其他类型的移动 设备, 或者诸如台式计算机 或个人计算机 ( PC , Personal Computer) 的静止计算设备。 计算设备 1200还可以是移动式或静止式的服务器。 其中, 处理器 1220用于执行如下计算机程序 /指令, 该计算机程序 /指令被处理器 执行时实现 上述数据处理方法、 或文本处理方法、 或图像处理方法的步骤。 本说明书中的各个实 施例均采用递进的方式描述 , 各个实施例之间相同相似的部 分互相参 见即可, 每个实施例重点说明的都是与其他实施例 的不同之处。 尤其, 对于 计算设备 实施例而言,由于其基本相似于数据处理方法实施 例,所以描述的比较简单, 相关之处 参见数据处理方法实施例的部 分说明即可。 本说明书一实施例还 提供一种计算机可读 存储介质, 其存储有计算机程序 /指令, 该计算机程 序 /指令被处理器执行时实现上述数据处理方法、 或文本处理方法、 或图像 处理方 法的步骤。 本说明书中的各个实 施例均采用递进的方式描述 , 各个实施例之间相同相似的部 分互相参 见即可, 每个实施例重点说明的都是与其他实施例 的不同之处。 尤其, 对于 计算机可 读存储介质实施例而言, 由于其基本相似于数据处理方法实施例, 所以描述 的比较 简单, 相关之处参见数据处理方法实施例的部分说明即可 。 本说明书一实施例还提供 一种计算机程序产品, 包括计算机程序 /指令, 该计算机 程序 /指令被处理器执行时实现上述数据处理方法、 或文本处理方法、 或图像处理方法 的步骤 。 上述为本实施例的一 种计算机程序产品的示意性 方案。 需要说明的是, 该计算机 程序产品 的技术方案与上述的数据 处理方法的技术方案属于 同一构思, 计算机程序产 品的技术 方案未详细描述的细节 内容, 均可以参见上述数据处理方法的技术方案的描 述。 上述对本说明书特定 实施例进行了描述。其它实施例在所附权利要求 书的范围内。 在一些情 况下, 在权利要求书中记载的动作或步骤可以按照不 同于实施例中的顺序来 执行并且 仍然可以实现期望的结果 。 另外, 在附图中描绘的过程不一定要求示出的特 定顺序或 者连续顺序才能实现期望 的结果。 在某些实施方式中, 多任务处理和并行处 理也是可 以的或者可能是有利的。 所述计算机指令包括 计算机程序代码, 所述计算机程序代码可以为源代码 形式、 对象代码 形式、 可执行文件或某些中间形式等。 所述计算机可读介质可以包括: 能够 携带所述 计算机程序代码的任何实体 或装置、 记录介质、 U盘、 移动硬盘、 磁碟、 光 盘、计算机存储器、只读存储器 (ROM, Read-Only Memory)、随机存取存储器 (RAM, Random Access Memory) 、 电载波信号、 电信信号以及软件分发介质等。 需要说明的 是, 所述计算机可读介质包含的 内容可以根据专利实践的要求进 行适当的增减, 例如 在某些地 区, 根据专利实践, 计算机可读介质不包括电载波信号和电信信号。 需要说明的是, 对于前述的各方法实施例, 为了简便描述, 故将其都表述为一系 列的动作 组合, 但是本领域技术人员应该知悉, 本说明书实施例并不受所描述的动作 顺序的限 制, 因为依据本说明书实施例, 某些步骤可以采用其它顺序或者同时进行。 其次, 本领域技术人员也应该知悉 , 说明书中所描述的实施例均属于优选实施例, 所 涉及的动作 和模块并不一定都是本说 明书实施例所必须的。 在上述实施例中, 对各个实施例的描述都各有侧 重, 某个实施例中没有详述的部 分, 可以参见其它实施例的相关描述 。 以上公开的本说明书优 选实施例只是用于帮助 阐述本说明书。 可选实施例并没有 详尽叙述 所有的细节, 也不限制该发明仅为所述的具体实施方 式。 显然, 根据本说明 书实施例 的内容, 可作很多的修改和变化。 本说明书选取并具体描述这些实施例, 是 为了更好地 解释本说明书实施例的原 理和实际应用, 从而使所属技术领域技术人员能 很好地理解 和利用本说明书。本说明书仅受权利要求 书及其全部范围和等效物的限 制。

Claims

权 利 要 求 书
1.一种数据处理方法, 包括: 确定目标模型的 目标计算图以及输入所述 目标模型的目标数据, 其中, 所述目标 模型为机 器学习模型, 所述目标计算图由多个节点以及连接各 节点之间的边构建, 且 所述 目标计算图为在所述目标模型运行 时不能进行更新的计算图 ; 从所述目标计算图 中确定处理所述目标数据的 当前节点, 其中, 所述当前节点为 所述多个 节点中的任意一个节点; 确定所述当前节点对应 的数据处理计算图, 根据所述当前节点和 /或所述数据处理 计算图, 处理所述目标数据, 获得数据处理结果。
2.根据权利要求 1 所述的数据处理方法, 所述确定所述当前节点对应的数据处理 计算图, 包括: 根据目标映射表, 确定所述当前节点对应的所述 目标模型的目标结构单元; 在所述目标结构单元在 前置处理表中的情况下, 从所述前置处理表中确定所述 目 标结构单元 对应的前置数据处理计算 图, 其中, 所述前置处理表中包括所述目标结构 单元与所 述前置数据处理计算图的 映射关系, 所述前置数据处理计算图用于对目标处 理数据进行 前置处理。
3.根据权利要求 2所述的数据处理方法, 所述根据所述当前节点和/或所述数据处 理计算 图, 处理所述目标数据, 获得数据处理结果, 包括: 根据所述前置数据处理 计算图, 处理所述目标数据, 获得前置处理数据; 在根据所述前置处理数 据确定执行所述当前节点 的情况下, 根据所述当前节点处 理所述前置 处理数据, 获得当前处理数据; 在目标结构单元在后置 处理表中的情况下, 从所述后置处理表中确定所述 目标结 构单元对应 的后置数据处理计算图, 其中, 所述后置处理表中包括所述目标结构单元 与所述后 置数据处理计算图的映射 关系, 所述后置数据处理计算图用于对目标处理数 据进行后置 处理; 根据所述后置数据处理 计算图,处理所述当前处理数据,获得所述数据处理结果。
4.根据权利要求 2-3任一项所述的数据处理方法, 所述根据所述当前节点和 /或所 述数据处理 计算图, 处理所述目标数据, 获得数据处理结果, 包括: 根据所述前置数据处理 计算图, 处理所述目标数据, 获得前置处理数据; 在根据所述前置处理数 据确定不执行所述当前节 点、 且目标结构单元在后置处理 表中的情 况下, 从所述后置处理表中确定所述目标结构单元对应 的后置数据处理计算 图,根据所述后置数据处 理计算图,处理所述前置处理数据,获得所述数据处理结 果, 或者, 在根据所述前置处理数 据确定不执行所述当前节 点、 且目标结构单元不在后置处 理表的情 况下, 将所述前置处理数据确定为数据处理结果。
5.根据权利要求 1 - 4任一项所述的数据处理方法,所述确定所述当前节点对应的数 据处理计算 图, 包括: 根据目标映射表, 确定所述当前节点对应的所述 目标模型的目标结构单元; 在所述目标结构单元不在 前置处理表中的情况下 , 根据所述当前节点处理所述目 标数据, 获得当前处理数据; 在目标结构单元在后置 处理表中的情况下, 从所述后置处理表中确定所述 目标结 构单元对应 的后置数据处理计算图。
6.根据权利要求 5所述的数据处理方法, 所述根据所述当前节点和 /或所述数据处 理计算 图, 处理所述目标数据, 获得数据处理结果, 包括: 根据所述后置数据处理 计算图,处理所述当前处理数据,获得所述数据处理结果。
7.根据权利要求 1-6任一项所述的数据处理方法,所述确定所述目标模型的目标计 算图, 包括: 获取所述目标模型, 将所述目标模型进行数据处 理的处理操作作为所述节 点, 将 所述处理操 作之间的关联关系作为边 ; 根据所述节点和所述边 , 构建所述目标计算图。
8.根据权利要求 7 所述的数据处理方法, 所述根据所述节点和所述边, 构建所述 目标计算 图, 包括: 根据所述节点和所述边 , 构建初始计算图; 对所述初始计算图 中的目标节点以及目标边进行 冗余消除操作, 获得所述目标模 型的 目标计算图, 以使目标模型在目标处理器低使用率的状态下运 行。
9.根据权利要求 2-8任一项所述的数据处理方法, 所述根据目标映射表,确定所述 当前节点对 应的目标模型的目标结构单 元之前, 还包括: 确定构建所述目标模型的 结构单元, 其中, 所述结构单元为目标模型的网络层; 确定所述目标计算图 中各节点对应的结构单元; 根据所述目标计算 图中的节点以及所述 目标模型的结构单元之间的映射关 系, 构 建所述 目标映射表。
10.根据权利要求 3或 4或 6所述的数据处理方法, 所述获得所述数据处理结果之 后, 还包括: 判断是否存在所述 当前节点的下一节点, 若存在, 将所述当前节点的下一节点确定为当前 节点, 并将所述数据处理结果作 为所述 目标数据, 执行所述确定所述当前节点对应的数据处理计 算图, 根据所述当前 节点和 /或所述数据处理计算图, 处理所述目标数据, 获得数据处理结果的步骤, 若不存在, 输出所述数据处理结果。
11.根据权利要求 1 - 10任一项所述的数据处理方法,所述数据处理方法应用于支持 机器学 习模型计算的计算机硬件。
12.根据权利要求 11 所述的数据处理方法, 所述确定目标模型的目标计算图以及 输入所述 目标模型的目标数据, 包括: 根据所述支持机器学 习模型计算的计算机硬件 的硬件资源, 确定目标模型的目标 计算图 以及输入所述目标模型的 目标数据。
13. —种文本处理方法, 包括: 确定目标模型的 目标计算图以及输入所述 目标模型的目标文本, 其中, 所述目标 模型为机 器学习模型, 所述目标计算图由多个节点以及连接各 节点之间的边构建, 且 所述 目标计算图为在所述目标模型运行 时不能进行更新的计算图 ; 从所述目标计算图 中确定处理所述目标文本的 当前节点, 其中, 所述当前节点为 所述多个 节点中的任意一个节点; 确定所述当前节点对应 的文本处理计算图, 根据所述当前节点和 /或所述文本处理 计算图, 处理所述目标文本, 获得文本处理结果。
14.一种图像处理方法, 包括: 确定目标模型的 目标计算图以及输入所述 目标模型的目标图像, 其中, 所述目标 模型为机 器学习模型, 所述目标计算图由多个节点以及连接各 节点之间的边构建, 且 所述 目标计算图为在所述目标模型运行 时不能进行更新的计算图 ; 从所述目标计算图 中确定处理所述目标图像的 当前节点, 其中, 所述当前节点为 所述多个节 点中的任意一个节点; 确 定所述当前节点对应的 图像处理计算图, 根据所述当前节点和 /或所述图像处理 计算图, 处理所述目标图像, 获得图像处理结果。
15. —种计算设备, 包括: 存储器和处理器; 所述存储器用于存储计算机 程序 /指令,所述处理器用于执行所述计算机程序 /指令, 该计算机程序/指令被处理 器执行时实现权利要求 1至 14任意一项所述方法的步骤。
16. —种计算机可读存储介质, 其存储有计算机程序 /指令, 该计算机程序 /指令被 处理器执行 时实现权利要求 1至 14任意一项所述方法的步骤。
17. —种计算机程序产品, 包括计算机程序 /指令, 该计算机程序 /指令被处理器执 行时实现权利 要求 1至 14任意一项所述方法的步骤。
PCT/IB2025/051210 2024-02-27 2025-02-05 数据处理方法、文本处理方法、图像处理方法、计算设备、计算机存储介质以及计算机程序产品 Pending WO2025181595A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410217614.9A CN120561447A (zh) 2024-02-27 2024-02-27 数据处理方法、文本处理方法、图像处理方法、计算设备、计算机存储介质以及计算机程序产品
CN202410217614.9 2024-02-27

Publications (1)

Publication Number Publication Date
WO2025181595A1 true WO2025181595A1 (zh) 2025-09-04

Family

ID=96815841

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/IB2025/051210 Pending WO2025181595A1 (zh) 2024-02-27 2025-02-05 数据处理方法、文本处理方法、图像处理方法、计算设备、计算机存储介质以及计算机程序产品

Country Status (2)

Country Link
CN (1) CN120561447A (zh)
WO (1) WO2025181595A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114638335A (zh) * 2020-12-15 2022-06-17 辉达公司 优化神经网络的技术

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338635A (zh) * 2020-02-20 2020-06-26 腾讯科技(深圳)有限公司 计算图的图编译方法、装置、设备及存储介质
CN113642721A (zh) * 2020-05-11 2021-11-12 平头哥(上海)半导体技术有限公司 处理单元、计算装置及深度学习模型的计算图处理方法
CN113760394A (zh) * 2020-06-03 2021-12-07 阿里巴巴集团控股有限公司 数据处理方法、装置、电子设备及存储介质
CN113887396A (zh) * 2021-09-29 2022-01-04 上海商汤智能科技有限公司 一种图像处理方法、装置、计算机设备和存储介质
CN116029385A (zh) * 2021-10-25 2023-04-28 深圳鲲云信息科技有限公司 模型编译方法、装置、编译器及模型运行系统
CN116823980A (zh) * 2023-05-19 2023-09-29 北京百度网讯科技有限公司 一种扩散模型的部署方法、图像生成方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111338635A (zh) * 2020-02-20 2020-06-26 腾讯科技(深圳)有限公司 计算图的图编译方法、装置、设备及存储介质
CN113642721A (zh) * 2020-05-11 2021-11-12 平头哥(上海)半导体技术有限公司 处理单元、计算装置及深度学习模型的计算图处理方法
CN113760394A (zh) * 2020-06-03 2021-12-07 阿里巴巴集团控股有限公司 数据处理方法、装置、电子设备及存储介质
CN113887396A (zh) * 2021-09-29 2022-01-04 上海商汤智能科技有限公司 一种图像处理方法、装置、计算机设备和存储介质
CN116029385A (zh) * 2021-10-25 2023-04-28 深圳鲲云信息科技有限公司 模型编译方法、装置、编译器及模型运行系统
CN116823980A (zh) * 2023-05-19 2023-09-29 北京百度网讯科技有限公司 一种扩散模型的部署方法、图像生成方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114638335A (zh) * 2020-12-15 2022-06-17 辉达公司 优化神经网络的技术

Also Published As

Publication number Publication date
CN120561447A (zh) 2025-08-29

Similar Documents

Publication Publication Date Title
JP7324831B2 (ja) ディープラーニングフレームワークにおける演算子の展開方法、展開装置及び電子機器
JP2023047318A (ja) コンピュータプログラミングに関連する言語モデルを訓練するためのコード強化
US20160350280A1 (en) Processing natural language text with context-specific linguistic model
US11521076B2 (en) Architecture-independent approximation discovery
US20220172044A1 (en) Method, electronic device, and computer program product for deploying machine learning model
CN112417156B (zh) 多任务学习方法、装置、设备以及存储介质
CN115934275A (zh) 任务处理方法及对话任务处理方法
US20240143928A1 (en) Generation of interactive utterances of code tasks
CN118034660A (zh) 针对大语言模型融合算子的图编译方法、装置及存储介质
WO2025218290A1 (zh) 一种任务处理方法及相关装置
KR20220092942A (ko) 계층적 데이터
US10133713B2 (en) Domain specific representation of document text for accelerated natural language processing
CN116578423B (zh) 任务处理方法、自动问答方法以及图像生成方法
CN114020898A (zh) 人机自动对话方法、装置、电子设备及存储介质
JP7832412B1 (ja) 生成ニューラルネットワークを使用したソースドキュメントのメタデータに基づくコンテンツ項目の生成
CN120561447A (zh) 数据处理方法、文本处理方法、图像处理方法、计算设备、计算机存储介质以及计算机程序产品
CN110058849A (zh) 流程图的生成方法、装置、计算机设备以及存储介质
WO2025241615A1 (zh) 目标代码确定方法、代码补全方法、计算机程序产品
CN120447910A (zh) 代码生成方法、装置、设备和计算机程序产品
WO2025236856A1 (zh) 答复内容预测方法、装置、设备、介质、产品及芯片
US12412051B1 (en) Dynamic generation of instructions for machine learning transcreation tasks
CN119046540A (zh) 用户社交行为表示方法、系统、电子设备及存储介质
CN115438678A (zh) 机器翻译方法、装置、电子设备及存储介质
CN118192978A (zh) 一种基于自定义dsl编排业务逻辑的实现方法、装置
CN113126965A (zh) 一种适用jsp前后端分离的高效率开发方法、介质及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25761761

Country of ref document: EP

Kind code of ref document: A1