WO2019233231A1 - 通用机器学习模型、模型文件的生成和解析方法 - Google Patents

通用机器学习模型、模型文件的生成和解析方法 Download PDF

Info

Publication number
WO2019233231A1
WO2019233231A1 PCT/CN2019/085853 CN2019085853W WO2019233231A1 WO 2019233231 A1 WO2019233231 A1 WO 2019233231A1 CN 2019085853 W CN2019085853 W CN 2019085853W WO 2019233231 A1 WO2019233231 A1 WO 2019233231A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
model
machine learning
parameters
stack
Prior art date
Application number
PCT/CN2019/085853
Other languages
English (en)
French (fr)
Inventor
杜伟健
吴林阳
陈峋宇
Original Assignee
上海寒武纪信息科技有限公司
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
Priority claimed from CN201810588623.3A external-priority patent/CN110647996B/zh
Priority claimed from CN201810589390.9A external-priority patent/CN110580527B/zh
Priority claimed from CN201811459679.5A external-priority patent/CN111338630B/zh
Priority claimed from CN201811459853.6A external-priority patent/CN111260071B/zh
Priority claimed from CN201811456246.4A external-priority patent/CN111258584B/zh
Priority claimed from CN201811457719.2A external-priority patent/CN111260018B/zh
Priority to US16/975,082 priority Critical patent/US11334329B2/en
Application filed by 上海寒武纪信息科技有限公司 filed Critical 上海寒武纪信息科技有限公司
Priority to KR1020197029038A priority patent/KR20210017985A/ko
Priority to JP2019554861A priority patent/JP7386706B2/ja
Priority to EP19815956.8A priority patent/EP3751477A4/en
Publication of WO2019233231A1 publication Critical patent/WO2019233231A1/zh
Priority to US17/130,300 priority patent/US11379199B2/en
Priority to US17/130,469 priority patent/US11036480B2/en
Priority to US17/130,348 priority patent/US11307836B2/en
Priority to US17/130,393 priority patent/US11403080B2/en
Priority to US17/130,370 priority patent/US11334330B2/en
Priority to US17/849,650 priority patent/US11726754B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/10Requirements analysis; Specification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/10Interfaces, programming languages or software development kits, e.g. for simulating neural networks
    • G06N3/105Shells for specifying net layout

Definitions

  • the present application relates to the field of artificial intelligence, and in particular, to a universal machine learning model, a method, a device, and a storage medium for generating a model file.
  • the present application discloses a method, device, and storage medium for generating, executing, and using a machine learning model, so as to realize that in the process of machine learning calculations, directly read the corresponding general
  • the model avoids repeated compilation, which greatly improves the efficiency of machine learning algorithm implementation and shortens the time from compilation to execution results.
  • a method for generating a general machine learning model includes:
  • the task parameters include algorithm control parameters and calculation parameters
  • the step of classifying the task parameters to obtain task instructions and model parameters includes:
  • the step of performing classification processing on the calculation parameters to obtain model parameters includes:
  • the step of collecting the task instruction and model parameters according to the data type to obtain stack data and heap data includes:
  • the model parameter stack data is collected to obtain the stack data.
  • the step of classifying the model parameters according to the data type to obtain model parameter stack data and model parameter stack data includes:
  • the non-shareable model parameters are collected to obtain model parameter stack data.
  • the model parameter stack data includes model parameter static data and model parameter dynamic data
  • the step of integrating the stack data and heap data to obtain a universal machine learning model includes:
  • the step of merging the continuous static data blocks, the continuous dynamic data blocks, and the stack data blocks to obtain a universal machine learning model includes:
  • the step of extracting data attribute parameters from the calculation parameters includes:
  • the input data storage space and the output data storage space are stored as heap data, and the intermediate result temporary space is stored as stack data.
  • the step of packaging and integrating the model parameter stack data according to the stack data layout information to obtain the stack data block includes:
  • the unshareable model parameters and intermediate result temporary space data are integrated to obtain the stack data block.
  • the step of obtaining hardware parameters according to the calculation parameters includes:
  • the step of packaging and integrating the task instruction stack data and the model parameter static data according to the static data layout information to obtain the continuous static data block includes:
  • the task instruction stack data, shareable model parameters, hardware platform information, and hardware configuration parameters are integrated to obtain the continuous static data block.
  • the step of packaging and integrating the model parameter dynamic data according to the dynamic data layout information to obtain continuous dynamic data blocks includes:
  • a device for generating a general machine learning model includes:
  • External interface module for obtaining task parameters of machine learning tasks
  • a classification processing module configured to perform classification processing on the task parameters to obtain task instructions and model parameters
  • a parameter collection module configured to collect the task instruction and model parameters according to the data type to obtain stack data and heap data;
  • a model generation module is configured to integrate the stack data and the heap data to obtain a universal machine learning model.
  • the task parameters include algorithm control parameters and calculation parameters
  • the classification processing module includes:
  • a task instruction generating module configured to compile the algorithm control parameters to obtain a task instruction
  • a model parameter generation module performs classification processing on the calculation parameters to obtain model parameters.
  • the model parameter generation module includes:
  • the model parameter stack data generation module is used to collect the shareable model parameters to obtain the model parameter stack data
  • a model parameter heap data generating module is configured to collect the non-shareable model parameters to obtain model parameter heap data.
  • the model parameter heap data generating module includes:
  • a model parameter static data generating module configured to collect static model parameter heap data to obtain model parameter static data
  • the model parameter dynamic data generating module is configured to collect dynamic model parameter stack data to obtain model parameter dynamic data.
  • the model parameter generation module further includes:
  • a pre-processing module configured to pre-process the calculation parameters to obtain pre-processed model data
  • a hardware parameter generation module configured to obtain hardware parameters according to the calculation parameters
  • An attribute extraction module is configured to extract data attribute parameters from the calculation parameters.
  • the task instruction includes task instruction heap data; and the parameter aggregator includes:
  • a stack data aggregator configured to package and integrate the model parameter stack data to obtain a stack data block
  • Model parameter dynamic data aggregator which is used to package and integrate the model parameter dynamic data to obtain continuous dynamic data blocks
  • the model parameter static data aggregator is configured to package and integrate the task instruction stack data and the model parameter static data to obtain continuous static data blocks.
  • the model generating module is configured to combine the continuous static data blocks, the continuous dynamic data blocks, and the stack data blocks to obtain a universal machine learning model.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program.
  • the processor executes the computer program, the steps of the method provided by any of the foregoing embodiments are implemented.
  • a computer-readable storage medium stores a computer program thereon.
  • the computer program is executed by a processor, the steps of the method provided by any one of the foregoing embodiments are implemented.
  • a method for executing a general machine learning model includes:
  • An embodiment of the present application further provides a device for executing a universal machine learning model, where the device includes:
  • a model disassembly module configured to classify and disassemble the general machine learning model to obtain stack area data and heap area data;
  • the result output module is configured to obtain the stack area data, the stack area data, and input data for calculation to obtain output data.
  • the stack area data includes stack data
  • the stack area data includes heap data
  • the step of classifying and disassembling the general machine learning model to obtain stack data and heap data includes:
  • the heap data is allocated to a heap area.
  • the stack data includes model parameter stack data, and the stack area data includes data in multiple stack areas;
  • the step of allocating the stack data to a stack area to obtain the stack area data includes:
  • the model parameter stack data is allocated to a model parameter stack area.
  • the step of allocating the model parameter stack data to a model parameter stack area includes:
  • the method further includes:
  • the step of allocating the heap data to a heap area includes:
  • the step of allocating the heap data to a heap area includes:
  • the model parameter static data is allocated to the model parameter static heap area.
  • the step of allocating the model parameter dynamic data to the model parameter dynamic heap area includes:
  • Allocate storage space of the model parameter dynamic heap area, and the storage space of the dynamic data heap area is greater than or equal to the size of the second storage space.
  • the storage space of the model parameter static heap area is greater than or equal to the storage space of the model parameter static data.
  • the model parameter static data includes task instruction heap data.
  • the step of allocating the heap data to a heap area and obtaining the heap area data further includes:
  • the step of allocating the heap data to a heap area further includes:
  • the model parameter dynamic heap area and the model parameter static heap area are allocated to a continuous storage space.
  • the data in the heap area includes the model parameter dynamic data, the model parameter static data, and the input data and the output data.
  • the step of obtaining the output data by performing calculation based on the stack area data, the heap area data, and the input data further includes:
  • the output data is output.
  • An execution device for a universal machine learning model characterized in that the device includes:
  • a model disassembly module configured to classify and disassemble the general machine learning model to obtain stack area data and heap area data;
  • the result output module is configured to obtain the stack area data, the stack area data, and input data for calculation to obtain output data.
  • the stack area data includes stack data
  • the stack area data includes heap data
  • the model disassembly module includes:
  • a stack area data allocation module configured to disassemble the unshareable data in the universal machine learning model into stack data
  • the heap area data allocation module is configured to disassemble the shareable data in the general machine learning model into heap data.
  • the stack area data allocation module is further configured to allocate the stack data to the stack area.
  • the heap area data allocation module is further configured to allocate the heap data to a heap area.
  • the stack data includes model parameter stack data; the stack data allocation module is further configured to allocate the model parameter stack data to a model parameter stack area.
  • the heap data includes model parameter static data and model parameter dynamic data; the heap data allocation module further includes:
  • a model parameter static data allocation module configured to allocate the model parameter static data to a model parameter static heap area
  • the model parameter dynamic data allocation module is configured to allocate the model parameter dynamic data to a model parameter dynamic heap area.
  • the result output module further includes:
  • a data extraction module configured to extract the output data from the heap area
  • a data output module is configured to output the output data.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program.
  • the processor executes the computer program, the steps of the method provided by any of the foregoing embodiments are implemented.
  • a computer-readable storage medium stores a computer program thereon.
  • the computer program is executed by a processor, the steps of the method provided by any one of the foregoing embodiments are implemented.
  • a method for generating a general machine learning model file includes a general machine learning model and a model directory.
  • the generation method includes:
  • the generating the general machine learning model file according to the general machine learning model and the model directory includes:
  • the step of calculating a storage offset of the universal machine learning model includes:
  • generating the general machine learning model file according to the general machine learning model and the model directory includes:
  • the generating a universal machine learning model file based on the universal machine learning model and the model directory includes:
  • generating the general machine learning model file based on the general machine learning model and the model directory further includes:
  • the generating the universal machine learning model file according to the universal machine learning model and the model directory includes:
  • generating the general machine learning model file based on the general machine learning model and the model directory further includes:
  • generating the universal machine learning model file according to the universal machine learning model and the model directory further includes:
  • a general machine learning model file generation method includes:
  • a device for generating a universal machine learning model file includes a universal machine learning model and a model directory.
  • the generating device includes:
  • a model filler, a directory generator, and a file generator is connected to the directory generator, and the file generator is connected to the model filler and the directory generator, respectively;
  • the model filler is used to obtain the universal machine learning model
  • the directory generator for calculating a storage offset of the universal machine learning model
  • the file generator is configured to generate the general machine learning model file according to the general machine learning model and the model directory.
  • the model filler is further configured to sequentially store the general machine learning model into the file generator.
  • the file generator further includes a file header generator and the file tail generator; the file header generator is connected to the directory generator, and the file tail generator is connected to the model The filler is connected.
  • the file header generator is further configured to create an identification code of a universal machine learning model file, and according to the identification code of the universal machine learning model file, the universal machine learning model, and the model directory To generate the universal machine learning model file.
  • the file tail generator is further configured to create a check code and / or an error correction code of the universal machine learning model file.
  • the generating device further includes a file size calculator, which is connected to the directory generator, and is configured to calculate a storage space occupied by the general machine learning model, and calculate Describes the amount of storage space required for general machine learning model files.
  • a general machine learning model file generating device includes:
  • External interface module for obtaining task parameters of machine learning tasks
  • a classification processing module configured to perform classification processing on the task parameters, and generate task instructions and model parameters
  • a parameter collection module configured to collect the task instruction and model parameters according to the data type to generate stack data and heap data;
  • a model generation module configured to integrate the stack data and the heap data to generate a general machine learning model
  • a storage offset calculation module configured to calculate a storage offset of the universal machine learning model
  • a model directory generating module configured to generate the model directory according to the general machine learning model and the general machine learning model storage offset
  • a model file generating module is configured to generate the general machine learning model file according to the general machine learning model and the model directory.
  • the file size calculator is connected to a model storage optimizer.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program.
  • the processor executes the computer program, the steps of the method according to any one of the foregoing embodiments are implemented.
  • a computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the method according to any one of the foregoing embodiments are implemented.
  • a method for generating a machine learning secondary model file includes a secondary model and a secondary model directory.
  • the generating method includes:
  • the step of performing storage optimization processing on the universal machine learning model and generating the secondary model includes: performing compression processing and / or encryption processing on the universal machine learning model to generate the Secondary model.
  • generating the machine learning secondary model file according to the secondary model and the secondary model directory includes:
  • the step of calculating a storage offset of the secondary model includes:
  • the storage offset of each of the secondary models is calculated according to the storage space occupied by each of the secondary models, the number of the secondary models, and the storage order of the secondary models.
  • the generating a machine learning secondary model file according to the general machine learning model and the model directory includes:
  • the generating a machine learning secondary model file according to the secondary model and the model directory includes:
  • a general machine learning model file generation method includes:
  • a device for generating a machine learning secondary model file includes a secondary model and a secondary model directory.
  • the generating device includes:
  • model filler is connected to the directory generator
  • file generator is respectively connected with the model filler and the directory generator
  • model storage optimizer is connected to the model filler
  • the secondary model filler is used to obtain a general machine learning model
  • the model storage optimizer is configured to perform storage optimization processing on the general machine learning model to generate a secondary model
  • the directory generator is configured to calculate a storage offset of the universal machine learning model; and generate a secondary model directory according to the secondary model and the secondary model storage offset;
  • the file generator is configured to generate a machine learning secondary model file according to the secondary model and the secondary model directory.
  • the secondary model filler is further configured to sequentially store the secondary model into the file generator.
  • the file generator further includes a file header generator and the file tail generator; the file header generator is connected to the directory generator, and the file tail generator is connected to the second file generator; Level model filler is connected.
  • the file header generator is further configured to create an identification code of a secondary model, and generate a secondary model of machine learning according to the identification code, the secondary model, and the secondary model directory. file.
  • the file tail generator is further configured to create a check code and / or an error correction code of the machine learning secondary model file.
  • the generating device further includes a file size calculator, which is connected to the directory generator, and is configured to calculate a size of a storage space occupied by the universal machine learning model, and calculate a calculation space. Describes the amount of storage space required by the model file.
  • the file size calculator is connected to a model storage optimizer.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program.
  • the processor executes the computer program, the steps of the method according to any one of the foregoing embodiments are implemented.
  • a computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the method according to any one of the foregoing embodiments are implemented.
  • the general machine learning model file includes a general machine learning model and a secondary model directory.
  • the method includes:
  • the method includes:
  • the target secondary model is restored to obtain a target universal machine learning model.
  • the obtaining a general machine learning model file includes:
  • a secondary model directory is read in the universal machine learning model file.
  • reading a model directory in the universal machine learning model file includes:
  • whether the check code is consistent with the preset standard code. If the check code is not consistent with the preset standard code, performing the error correction operation includes:
  • the reading the target secondary model according to the secondary model catalog includes:
  • the method further includes:
  • hardware matching information is generated.
  • the method further includes:
  • the general machine learning model file includes a general machine learning model and a secondary model directory.
  • the device is characterized in that the device includes:
  • the file obtainer is used to obtain a general machine learning model file
  • the model distributor is used to read a secondary model directory in the general machine learning model file; and read a target secondary model according to the secondary model directory; and restore the target secondary model Get the target universal machine learning model;
  • the directory parser is configured to read a model directory in the general machine learning model file
  • the model reader is configured to read a target universal machine learning model according to the model catalog.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program, and the processor executes the computer program. To implement the steps of the method described in any of the above embodiments.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program.
  • the processor executes the computer program, the steps of the method according to any of the foregoing embodiments are implemented
  • a computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the method described in any one of the above embodiments are implemented.
  • a general machine learning model file parsing method includes:
  • the obtaining a general machine learning model file includes:
  • a model directory is read in the general machine learning model file.
  • reading a model directory in the universal machine learning model file includes:
  • the error correction operation includes:
  • the checking whether the check code is consistent with a preset standard code, and if the check code is not consistent with the preset standard code, performing an error correction operation includes:
  • the reading the corresponding universal machine learning model according to the model catalog includes:
  • a general machine learning model file parsing method includes:
  • the target secondary model is restored to obtain a target universal machine learning model.
  • the method further includes:
  • hardware matching information is generated.
  • the method further includes:
  • a general machine learning model file parsing device includes:
  • the file obtainer is used to obtain a general machine learning model file
  • the directory parser is configured to read a model directory in the general machine learning model file
  • the model reader is configured to read a target universal machine learning model according to the model catalog.
  • a computer device includes a memory and a processor.
  • the memory stores a computer program.
  • the processor executes the computer program, the steps of the method according to any one of the foregoing embodiments are implemented.
  • a computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the method according to any one of the foregoing embodiments are implemented.
  • FIG. 1 is an application environment diagram of a general machine learning model generation method in an embodiment
  • FIG. 2 is a schematic flowchart of a method for generating a general machine learning model according to an embodiment
  • FIG. 3 is a schematic diagram of a general-purpose machine learning model generating device according to an embodiment
  • FIG. 4 is a schematic flowchart of a general machine learning model execution method in another embodiment
  • FIG. 5 is a schematic diagram of a general-purpose machine learning model execution apparatus according to an embodiment
  • FIG. 6 is a schematic flowchart of feature extraction of a jpg image by using a general machine learning model according to an embodiment
  • FIG. 7 is an internal structural diagram of a computer device provided in an embodiment
  • FIG. 8 is an application environment diagram of a method for generating a general machine learning model file according to an embodiment
  • FIG. 9 is a schematic flowchart of a method for generating a general machine learning model according to an embodiment
  • FIG. 10 is a schematic structural diagram of a universal machine learning model generating device according to an embodiment
  • FIG. 11 is a schematic flowchart of a method for generating a general machine learning model file according to an embodiment
  • FIG. 12 is a schematic flowchart of calculating a storage offset of the universal machine learning model according to an embodiment
  • FIG. 13 is a schematic flowchart of generating a universal machine learning model file according to the universal machine learning model and the model directory according to an embodiment
  • FIG. 14 is a schematic flowchart of generating a universal machine learning model file according to the universal machine learning model and the model directory in another embodiment
  • FIG. 15 is a schematic flowchart of generating a universal machine learning model file according to the universal machine learning model and the model directory in still another embodiment
  • FIG. 16 is a schematic flowchart of generating a general machine learning model file according to the general machine learning model and the model directory according to another embodiment
  • 17 is a schematic flowchart of a general machine learning model generation method in another embodiment
  • FIG. 18 is a schematic flowchart of a general machine learning model generation method in still another embodiment
  • FIG. 19 is a schematic structural diagram of a universal machine learning model file generating device according to an embodiment
  • 20 is a schematic structural diagram of a universal machine learning model file generating apparatus according to another embodiment
  • 21 is a schematic flowchart of a method for analyzing a general machine learning model according to an embodiment
  • FIG. 22 is a schematic flowchart of obtaining a general machine learning model file in an embodiment
  • FIG. 23 is a schematic flowchart of obtaining a general machine learning model file in an embodiment
  • FIG. 24 is a schematic flowchart of performing an error correction operation in an embodiment
  • FIG. 25 is a schematic flowchart of reading a target universal machine learning model according to the model catalog according to an embodiment
  • 26 is a schematic flowchart of a method for analyzing a general machine learning model in an embodiment
  • FIG. 27 is a schematic flowchart of a method for analyzing a general machine learning model in another embodiment
  • FIG. 28 is a schematic flowchart of a method for analyzing a general machine learning model in another embodiment
  • FIG. 29 is a schematic structural diagram of a general-purpose machine learning model analysis apparatus according to an embodiment.
  • FIG. 30 is a schematic structural diagram of a general machine learning model execution device according to an embodiment
  • FIG. 31 is an internal structural diagram of a computer device in one embodiment.
  • the present application discloses a method, a device, and a storage medium for generating, executing, and using a machine learning model, so as to directly read a corresponding general model in a general machine learning model file during a machine learning operation according to an operation requirement. Avoid repeated compilation, which greatly improves the efficiency of machine learning algorithm implementation and shortens the time from compilation to execution results.
  • the method for generating a universal machine learning model provided in this application can be applied to an application environment as shown in FIG. 1.
  • the application environment shown in FIG. 1 is a machine learning development platform, including a framework layer 1101, a compilation layer 1102, an aggregation layer 1103, a driver layer 1104, and a hardware layer 1105.
  • the framework layer 1101 is used to provide algorithm design conditions for machine learning tasks, to provide users with convenient neural network structures, and to provide convenient training and prediction tools. Understandably, the framework layer 101 is used to implement the following steps:
  • Receive user-designed machine learning algorithms e.g., neural network structures
  • the compilation layer 1102 is used to generate machine instructions in a machine learning task.
  • the compilation layer includes a compiler, a high-performance programming library specially optimized for high-frequency operators, and other modules, devices, and databases capable of generating machine instructions. It can be understood that the compilation layer 1102 is used to receive the parameters of the machine learning task passed by the upper frame layer 1101, compile and generate the binary machine instructions of the hardware, and pass it to the lower runtime layer to save or execute the calculation.
  • the convergence layer 1103 is a program that further encapsulates the driver program, which can shield the difference between different underlying hardware and drivers, and provide a unified program interface to the upper compilation layer 1102 or the user.
  • the aggregation layer 1103 encapsulates the upper-layer software without considering the details of the hardware and drivers.
  • the convergence layer 1103 is used to provide a program interface for basic operations of machine learning tasks, save and load machine learning models and necessary elements such as machine instructions required for execution on hardware, so that upper-layer software and users only need to focus on machine learning tasks Per se, without having to consider differences in specific hardware.
  • the program interface provided by the aggregation layer for basic operations of the machine learning task includes program interfaces for memory space allocation, data copying, startup calculation, and other basic operations of the machine learning task.
  • the driver layer 1104 is used to package and encapsulate the basic operations of the hardware layer 1105 device, and provides a callable program interface to the upper convergence layer 1103.
  • the basic operations of the driver layer 1104 include controlling input and output of a data flow, sending control signals to hardware, receiving and processing abnormal signals generated by the hardware, multi-tasking management and scheduling, and the like.
  • the hardware layer 1105 includes all hardware facilities in a machine learning development platform.
  • the optional hardware layer 1105 includes a main processor, a coprocessor, a memory, an input / output device, a power supply module, and their connection devices. It can be understood that the hardware layer 1105 is not limited to the above devices.
  • step S1201 is to obtain task parameters of a machine learning task.
  • the task parameters of the machine learning task are obtained through the external interface module 131000.
  • the task parameters are parameters required to generate a general machine learning model, and the parameters include parameters other than input data and output data.
  • the task parameters are input from an external program, or input from a user. It can be understood that when the task parameters come from the user's input, the user's input data needs to be converted in format to get the task parameters.
  • step S1202 the task parameters are classified and processed to obtain task instructions and model parameters.
  • the model parameters are obtained by the model parameter generation module 132100, and the task instructions are obtained by the task instruction generation module 132200.
  • the task instruction refers to the task parameters that have been compiled and processed.
  • Model parameters refer to the processing results of other processing of the task parameters required during the operation of the machine learning algorithm.
  • step S1203 the task instructions and model parameters are aggregated according to the data type to obtain stack data and heap data.
  • non-shareable data is collected by a stack data aggregator 133100
  • shared data is collected by a heap data aggregator 133200.
  • unshareable data refers to data not shared between cores in a multi-core platform
  • shared data refers to data shared between cores in a multi-core platform.
  • pooling refers to packing and ordering task instructions and model parameters.
  • step S1204 the stack data and heap data are integrated to obtain a universal machine learning model.
  • the general machine learning model has good universality.
  • the general machine learning model is compatible with different upper-layer frameworks, such as the upper-layer framework layer 1101, the compilation layer 1102, and the convergence layer 1103; it is also compatible with different lower-layer driver layers and hardware. Further, after a general machine learning model is formed, data blocks can be adjusted according to different numbers of computing cores, addresses of input data, addresses of output data, and other general machine learning models to suit different situations.
  • the generation step of the general machine learning model is not limited to the above steps, and is not limited to the execution order of the above steps. Any modification made based on the concept of the present invention is considered as the protection scope of the present invention.
  • the task parameters include algorithm control parameters and calculation parameters.
  • the step of classifying the task parameters to obtain task instructions and model parameters includes:
  • the algorithm instruction parameters are compiled by the task instruction generation module 132200.
  • the algorithm control parameter includes an operation structure of the algorithm.
  • compilation refers to the process of converting a high-level language into a machine language. Understandably, the compilation process is the process of generating the target program.
  • the task instructions include instructions directly recognized and executed by a computer. Understandably, the task instruction uses a binary encoding format.
  • the step of combining the task instructions and model parameters according to the data type to obtain stack data and heap data includes: classifying the task instructions to obtain task instruction stack data.
  • the task instruction stack data refers to task instruction data generated by the task instruction generation module and shared among cores in a multi-core platform.
  • the calculation parameters are classified and processed by a model parameter generation module to obtain model parameters.
  • the calculation parameters include data excluding input data and output data during a machine learning operation.
  • the classification processing includes processing of input data and output data required in machine learning, such as a pre-processing operation or a post-processing operation.
  • the classification processing further includes data or parameters required to be obtained when performing a machine learning operation on input data in machine learning.
  • hardware platform information For example, hardware platform information. It can be understood that the classification processing operation is not limited to the pre-processing operation or the post-processing operation, nor is it limited to obtaining the hardware platform information, and other operations that perform non-machine learning operations on the input data and output data are classified processing operations. Through the classification processing operation, it is compatible with various operations required when different input data pairs perform different operations on different hardware platforms. It can be understood that the classification processing operation can be modified and supplemented in practice to meet the application of the general machine learning model in different scenarios.
  • the calculation parameters are classified and processed by the model parameter generation module 132100 to obtain the model parameters.
  • the step of combining the task instruction and model parameters according to the data type to obtain stack data and stack data includes: classifying and processing model parameters according to the data type to obtain model parameter stack data and Model parameter stack data;
  • the model parameters are classified and processed by the model parameter generation module 132100 to obtain model parameter stack data and model parameter stack data.
  • the model parameter stack data refers to model parameters that cannot be shared among cores in a multi-core platform
  • the model parameter stack data refers to model parameters that can be shared among cores in a multi-core platform.
  • the model parameter stack data is obtained by the model parameter stack data generation module
  • the model parameter stack data is obtained by the model parameter stack data generation module.
  • the calculation parameters are classified and processed, and the step of obtaining model parameters includes pre-processing the calculation parameters to obtain pre-processed model data.
  • the calculation parameters are pre-processed by a pre-processing module 132121.
  • the pre-processing operation performed on the calculation parameter includes performing a format conversion operation, a split operation, and a classification operation on the calculation parameter.
  • the preprocessing operation is not limited to the format conversion operation, the split operation, and the classification operation, and other operations performed on the calculation parameters are preprocessing operations.
  • the calculation parameters are classified and the step of obtaining model parameters includes obtaining hardware parameters according to the calculation parameters.
  • the hardware parameter generating module 132122 is configured to generate a hardware parameter.
  • the hardware parameters include fixed index parameters of the hardware device, such as the model of the GPU, the number of cuda cores, the size of the private cache, the size of the shared cache, and the access bandwidth.
  • the calculation parameters are classified and the step of obtaining model parameters includes extracting data attribute parameters from the calculation parameters.
  • the attribute parameter extraction module 132123 is configured to extract attribute parameters of data in the calculation parameters.
  • the step of obtaining hardware parameters according to the calculation parameters includes: obtaining hardware platform information and hardware configuration parameters and storing the data as heap data.
  • the attribute parameters include some characteristics unique to the data. For example, when the input data is a picture, the attribute parameters include picture size, number of channels, storage space occupied, storage format, data type of each pixel, etc. .
  • the step of extracting data attribute parameters in the calculation parameters by the attribute extraction module 132123 includes:
  • the model parameters are classified and processed according to the data type, and the step of obtaining model parameter stack data includes: classifying the model parameters according to shared attributes to obtain shareable model parameters and unshareable model parameters; The non-shareable model parameters are aggregated to obtain model parameter stack data.
  • the model parameter stack data is generated by the model parameter stack data generating module 132110.
  • the step of collecting the task instruction and model parameters according to the data type to obtain stack data and heap data includes: collecting the model parameter stack data to obtain the stack data.
  • the stack data is collected by the stack data aggregator 133100.
  • the step of packaging and integrating the model parameter stack data according to the stack data layout information to obtain the stack data block further includes: according to the stack data layout information, the unshareable model The parameters and the intermediate result temporary space data are integrated to obtain the stack data block.
  • the model parameters are classified and processed according to the data type, and the step of obtaining model parameter stack data includes: classifying the model parameters according to shared attributes to obtain shareable model parameters and unshareable model parameters; Shareable model parameters are collected to obtain model parameter heap data.
  • the model parameter stack data generating module 132120 performs the above steps to obtain model parameter stack data. By pooling the heap data, the shared data can be processed uniformly, so that the stack data in the machine learning model can be patterned, so that the generated machine learning model is universal.
  • the model parameter stack data includes model parameter static data and model parameter dynamic data.
  • model parameter static data is data that does not change during the operation of the machine learning algorithm, such as task instructions, model parameter heap data, and hardware platform information.
  • Model parameter dynamic data refers to data that changes during the running of machine learning algorithms, such as input data and output data.
  • the step of integrating the stack data and heap data to obtain a universal machine learning model includes: packaging the task instruction heap data with the model parameter static data through a static data aggregator 133210 Integration to get continuous static data blocks.
  • the static data layout information the task instruction stack data, model parameter stack data, hardware platform information, and hardware configuration parameters are integrated to obtain the continuous static data block.
  • the static data block data can be uniformly processed, and the static data in the machine learning model can be patterned, so that the generated machine learning model is universal.
  • the step of integrating the stack data and the heap data to obtain a universal machine learning model includes: packaging and integrating the dynamic data of the model parameters through a dynamic data aggregator 133220 to obtain continuous dynamic data Piece.
  • the input data storage space and the output data storage space are integrated according to the dynamic data layout information to obtain the continuous dynamic data block.
  • the continuous static data block, the continuous dynamic data block, and the stack data block are combined to obtain a universal machine learning model.
  • the universal machine learning model is stored in an offline file.
  • the offline file includes one or more general machine learning models.
  • a general machine learning model in an offline file is called according to a preset rule.
  • the offline files are stored on the hard disk according to the established rules.
  • the offline file includes an online function. Specifically, online functions are stored in memory.
  • the step of merging the continuous static data blocks, the continuous dynamic data blocks, and the stack data blocks to obtain a universal machine learning model includes: obtaining static data layout information according to the task instruction. , Dynamic data layout information and stack data layout information; package and integrate the task instruction stack data and the model parameter static data according to the static data layout information to obtain the continuous static data block; according to the dynamic data Layout information packs and integrates the model parameter dynamic data to obtain continuous dynamic data blocks; packs and integrates the model parameter stack data according to the stack data layout information to obtain the stack data blocks; Integrated static data blocks, the continuous dynamic data blocks, and stack data blocks.
  • the algorithm control parameters are compiled to obtain layout information of each data block.
  • the data block layout information is used for data block collection and integration, and each data block is stored according to the data block layout information to optimize memory allocation.
  • the data block layout information is stored for each data block as a whole.
  • the memory allocation is optimized according to the processing order of the processor core, so that reading the data block information is convenient.
  • the universal machine learning model generation method further includes generating a hardware-specific parameter set.
  • the hardware-specific parameter set refers to preparing related parameters in advance to make up for the lack of hardware and satisfying the computing needs of different machine learning algorithms.
  • a device for generating a general machine learning model includes: an external interface module 131000 for acquiring task parameters of a machine learning task; a classification processing module 132000 for The task parameters are classified and processed to obtain task instructions and model parameters.
  • a parameter collection module 133000 is used to collect the task instructions and model parameters according to the data type to obtain stack data and heap data.
  • a model generation module 134000 is used to Integrating the stack data and heap data to obtain a universal machine learning model.
  • the above-mentioned general machine learning model generating device is well compatible with various types of machine learning algorithms by classifying and processing task parameters, and obtains a general model of the corresponding machine learning algorithm through the aggregation and integration process.
  • the general model of the machine learning algorithm described above the compilation results of the corresponding general model are directly executed during the running of the algorithm, avoiding repeated compilation, thereby greatly improving the implementation efficiency of the machine learning algorithm and shortening the time from compilation to obtaining the execution result.
  • the task parameters include algorithm control parameters and calculation parameters
  • the classification processing module 132000 includes: a task instruction generation module 132200 for compiling the algorithm control parameters to obtain task instructions; and model parameter generation Module 132110 performs classification processing on the calculation parameters to obtain model parameters.
  • the model parameter generation module 132100 includes: a model parameter stack data generation module 32110, configured to collect shareable model parameters to obtain model parameter stack data; and a model parameter stack data generation module 132120, configured to The non-shareable model parameters are aggregated to obtain model parameter heap data.
  • the model parameter generation module further includes: a preprocessing module 132121 configured to preprocess the calculation parameters to obtain preprocessed model data; and a hardware parameter generation module 132122 configured to perform calculations based on the calculated parameters. Acquiring hardware parameters; an attribute extraction module 132123, configured to extract data attribute parameters in the calculation parameters.
  • the task instruction includes task instruction stack data
  • the parameter collection module 133000 includes: a stack data aggregator 133100 for packaging and integrating the model parameter stack data to obtain a stack data block; model parameters A dynamic data aggregator 133220 is used to package and integrate the model parameter dynamic data to obtain continuous dynamic data blocks; a model parameter static data aggregator 133210 is used to combine the task instruction stack data with the model parameter static data Pack and integrate to get continuous static data blocks.
  • the model generating module 134000 is configured to merge the continuous static data blocks, the continuous dynamic data blocks, and the stack data blocks to obtain a universal machine learning model.
  • Each module in the above-mentioned general machine learning model device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware in or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a method for executing a universal machine learning model includes:
  • Step S1410 obtaining a general machine learning model
  • the general machine learning model is a general machine learning model generated according to the method of the general machine learning model described above.
  • the general machine learning model generation method refer to the above, which will not be repeated here.
  • Step S1420 classify and disassemble the universal machine learning model to obtain stack area data and heap area data;
  • the basis for classification and disassembly is to perform disassembly according to different data types.
  • stack data refers to data that cannot be shared between cores in a multi-core development platform
  • stack data refers to data that can be shared between cores in a multi-core development platform.
  • the classification and disassembly of the general machine learning model described in step S1420 to obtain stack data and heap data includes: step S14210, disassembling the shareable data in the general machine learning model into Stack data; step S14220, disassembling unshareable data in the universal machine learning model into heap data.
  • the method further includes allocating the stack data to a stack area
  • the stack area refers to a storage space in the memory that mainly stores stack data.
  • the data stored in the stack area also includes intermediate results generated during the machine learning operation.
  • the method further includes allocating the heap data to a heap area
  • the heap area refers to the storage space in the memory where the heap data is mainly stored.
  • the data stored in the heap area also includes intermediate results generated during the machine learning operation.
  • the heap area data includes data stored in the heap area, such as heap data and layout information of each heap data block.
  • Step S1430 Perform calculation based on the stack area data, the stack area data, and the input data to obtain output data. Specifically, the calculation process of step S1430 is performed by a hardware calculation unit. After the execution of step S1403 is completed, the neural network processor controls the hardware calculation unit to shut down.
  • the hardware calculation unit is composed of an arithmetic logic unit, an accumulator, a status register, a general register group, and the like.
  • the basic functions of the arithmetic logic operation unit are four operations of addition, subtraction, multiplication, and division, logical operations such as AND, OR, NOT, XOR, and operations such as shift and complement. It can be understood that the hardware computing unit can directly perform the operation by taking the stack area data and the heap area data, without waiting for the machine learning algorithm to be compiled. Therefore, the general machine learning model can improve the operation efficiency of machine learning algorithms.
  • the stack data includes model parameter stack data
  • step S14230 the step of allocating stack data to the stack area further includes:
  • step S14231 the size of the space required for the model parameter stack data and the size of the temporary storage space for the intermediate results are obtained. Specifically, a storage address and a storage space are allocated for the model parameter stack data and the intermediate result temporary storage space according to the required space of the model parameter stack data and the size of the temporary result temporary storage space.
  • step S14232 the sum of the size of the storage space required for the model parameter stack data and the size of the intermediate result temporary storage space is calculated to obtain the size of the first storage space. Understandably, the model parameter stack data will produce intermediate results during the machine learning operation. Therefore, the sum of the storage space required by the model parameter stack data and the temporary result temporary storage space is the minimum storage space allocated to the model parameter stack area. .
  • step S14233 the storage space of the model parameter stack area is allocated, and the storage space of the model parameter stack area is greater than or equal to the size of the first storage space.
  • the model parameter stack area refers to a storage area mainly used to store model parameter stack data.
  • the heap data that is changed during the operation phase is stored as model parameter dynamic heap data
  • the heap data that is not changed during the operation phase is stored as model parameter static heap data.
  • model parameter stack data and the model parameter stack data refer to the related content in the above general model generation method, which will not be repeated here.
  • step S14240 the step of allocating the heap data to the heap area further includes: step S14241, the size of the storage space required to obtain dynamic data of the model parameters; and step S14242, dynamically changing the model parameters
  • the data is allocated to the model parameter dynamic heap area; step S14243, the model parameter static data is allocated to the model parameter static heap area.
  • step S14242, the step of allocating the dynamic data of the model parameters to the dynamic data heap area further includes:
  • Step S14242 adding the storage space of the model parameter dynamic data and the input data storage space to the output data storage space to obtain the size of the second storage space;
  • Step S142422 the storage space of the model parameter dynamic heap area is allocated, and the storage space of the model parameter dynamic heap area is greater than or equal to the size of the second storage space. Specifically, the storage space of the allocation model parameter dynamic heap area is greater than or equal to the size of the second storage space.
  • the storage space is made more expandable under the condition of ensuring normal operation.
  • step S14240, the step of allocating the heap data to a heap area, and obtaining the heap area data further includes:
  • the model parameter dynamic heap area and the model parameter static heap area are allocated to a continuous storage space to obtain a heap area with continuous storage space.
  • the data in the heap area includes the model parameter dynamic data, the model parameter static data, and the input data and the output data.
  • the model parameter static data includes task instruction heap data.
  • the task instruction stack data refers to task instruction data that can be shared between cores.
  • the storage space of the model parameter static heap area is greater than or equal to the storage space of the model parameter static heap data. Specifically, the storage space of the model parameter static heap area is greater than or equal to the size of the storage space required for the model parameter static data. This embodiment enables the model parameter static heap area to obtain more expandability while ensuring normal operation.
  • performing the calculation based on the stack area data, the stack area data, and input data to obtain output data further includes: after the calculation of the input data is completed, closing a hardware calculation unit. Specifically, shutting down the hardware computing unit is beneficial to reducing the occupation of computer resources during the machine learning calculation process.
  • the step of calculating the input data to obtain output data according to the stack area data and the heap area data further includes: extracting the output data in the heap area; The output data is transmitted to the outside of the development platform.
  • input data and output data are stored in a heap area. Understandably, input data and output data are stored in the dynamic heap area of model parameters.
  • the device includes:
  • a model acquisition module 15100 for acquiring a general machine learning model
  • a model disassembly module 15200 configured to classify and disassemble the general machine learning model to obtain stack data and heap data;
  • the result output module 15400 obtains stack area data, heap area data, and input data for calculation to obtain output data.
  • the stack area data includes stack data
  • the stack area data includes heap data
  • the model disassembly module 15200 includes:
  • the stack area data allocation module 15310 is configured to disassemble the shareable data in the universal machine learning model into stack data.
  • the stack area data allocation module 15310 is further configured to allocate the stack data to the stack area;
  • the heap area data allocation module 15320 is configured to allocate the heap data to the heap area.
  • the heap area data allocation module 15320 is further configured to disassemble the unshareable data in the general machine learning model into heap data.
  • the stack data model parameters stack data includes: a first storage space calculation module, configured to calculate a sum of a storage space required by the model parameter stack data and a size of an intermediate result temporary storage space To obtain a size of the first storage space; a model parameter stack data allocation module allocates storage space of the model parameter stack area, and the storage space of the model parameter stack area is greater than or equal to the size of the second storage space.
  • the stack area data includes stack data
  • the stack area data includes heap data
  • the model disassembly module 15200 includes:
  • Stack area data allocation module 15310 is used to disassemble unshareable data in the general machine learning model into stack data; stack area data allocation module 15320 is used to disassemble shareable data in the general machine learning model For heap data. In one embodiment, the stack area data allocation module 15310 is further configured to allocate the stack data to the stack area. In one embodiment, the heap area data allocation module 15320 is further configured to allocate the heap data to a heap area.
  • the stack data includes model parameter stack data; the stack data allocation module is further configured to allocate the model parameter stack data to a model parameter stack area.
  • the result output module 15400 further includes:
  • a data extraction module 15410 configured to extract the output data from the heap area
  • a data output module 15420 is configured to output the output data.
  • Each module in the above-mentioned general machine learning model execution device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • Each of the above modules may be embedded in the processor in the form of hardware or independent of the processor in the computer device, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • FIG. 6 provides a schematic diagram of feature extraction of a picture in jpg format through a two-layer neural network.
  • a method for extracting pictures through a two-layer neural network includes:
  • Step S16100 performing an input preprocessing operation on the input picture to obtain a processed input picture
  • the attribute extraction module 132123 extracts input picture attribute information, such as the size, data format, and compression format information of the input picture, and transmits the extracted attribute information to the pre-processing layer.
  • the input pre-processing layer 6100 restores the jpg compressed image to an uncompressed original image according to the attribute information of the input image, and assigns a value to each data point to facilitate the processing of the image by the convolution layer 16200.
  • Step S16200 performing a convolution operation on the processed input picture to obtain a convolution operation result.
  • the convolution layer 16200 performs feature extraction on the image information.
  • the general machine learning model has generated corresponding task instructions according to the hardware information of the machine learning algorithm running platform shown in FIG. 6. After the corresponding hardware of the machine learning algorithm running platform is started, the task instruction controls the hardware to gradually obtain the input data and weight data for convolution operations until the calculation is completed and an intermediate result is obtained.
  • the weight data is data that has been trained in a general machine learning model.
  • the attributes of the intermediate result temporary space include attributes of the intermediate result, such as the size of the feature map and the size of the storage space occupied. Specifically, an appropriate storage space is requested for the intermediate result according to the attributes of the temporary result temporary space.
  • step S16300 the convolution operation result is activated to obtain the activation result.
  • the activation layer 16300 selects a sigmoid activation function and maps the convolution result between 0-1.
  • the general machine learning model has generated corresponding task instructions according to the hardware information of the machine learning algorithm running platform shown in FIG. 6. After the hardware of the machine learning algorithm running platform is started, the task instruction controls the corresponding hardware to gradually obtain input data and weight data for activation operations.
  • the machine learning algorithm running platform for performing picture recognition in this embodiment lacks a divider, but the sigmoid function includes a division operation, then the corresponding parameters are taken in the hardware-specific parameter set.
  • the hardware parameter set is prepared in advance and requires the reciprocal of the divisor.
  • the task instruction controls the hardware to obtain data for performing the activation operation, and to obtain parameter data in a hardware-specific parameter set. In one embodiment, the task instruction controls the hardware to perform a convolution operation until the convolution operation is completed to obtain output data.
  • step S16400 output preprocessing is performed on the activation result to obtain a final picture.
  • the output pre-processing layer 16400 performs an output pre-processing operation on the output data according to a preset storage format of the image.
  • the output picture is preset to be saved in jpg format, and then the output pre-processing layer 16400 processes the size, compression format, data format, etc. of the output picture according to the preset format of the output picture to obtain a final picture.
  • steps in the flowcharts of FIG. 2, FIG. 4, and FIG. 6 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed sequentially in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited, and these steps can be performed in other orders. Moreover, at least some of the steps in FIG. 2 and FIG. 4 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. These sub-steps or The execution order of the phases is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a part of the sub-steps or phases of other steps.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 7.
  • the computer device includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the internal memory provides an environment for running the operating system and computer programs in a non-volatile storage medium.
  • the computer equipment database is used to store general machine learning model data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the universal machine learning model file generation method provided in this application can be applied to the application environment shown in FIG. 1.
  • the method for generating a universal machine learning model provided in this application can be applied to the application environment shown in FIG. 8.
  • the application environment shown in FIG. 8 is a machine learning development platform, which includes a framework layer 2101, a compilation layer 2102, an aggregation layer 2103, a driver layer 2104, and a hardware layer 2105.
  • the framework layer 2101 is used to provide algorithm design conditions for machine learning tasks, to provide users with convenient neural network structures, and to provide convenient training and prediction tools. Understandably, the framework layer 2101 is used to implement the following steps: receiving a machine learning algorithm (for example, a neural network structure) designed by a user; parsing out the parameters of each sub-task, and passing them to the compiler layer to generate machine instructions and related necessary elements; pass to The runtime layer performs calculations and ultimately completes the machine learning tasks required by the user.
  • a machine learning algorithm for example, a neural network structure
  • the compilation layer 2102 is used to generate machine instructions in a machine learning task.
  • the compilation layer includes a compiler, a high-performance programming library specially optimized for high-frequency operators, and other modules, devices, and databases capable of generating machine instructions. It can be understood that the compilation layer 2102 is used to receive the parameters of the machine learning task passed by the upper framework layer 2101, compile and generate the binary machine instructions of the hardware, and pass it to the lower runtime layer to save or execute the calculation.
  • the convergence layer 2103 is a program that further encapsulates the driver program, which can shield the difference between different underlying hardware and drivers, and provide a unified program interface to the upper compilation layer 2102 or the user. Specifically, the aggregation layer 103 does not need to consider the details of the hardware and the driver to package the upper layer software. Further, the convergence layer 2103 is used to provide a program interface for basic operations of machine learning tasks, save and load machine learning models and necessary elements such as machine instructions required to execute on hardware, so that upper-layer software and users only need to focus on machine learning tasks Per se, without having to consider differences in specific hardware.
  • the program interface provided by the aggregation layer for basic operations of the machine learning task includes program interfaces for memory space allocation, data copying, startup calculation, and other basic operations of the machine learning task.
  • the driver layer 2104 is used to package and encapsulate the basic operations of the hardware layer 2105 device, and provides a callable program interface to the upper convergence layer 103.
  • the basic operations of the driver layer 2104 include controlling input and output of data streams, sending control signals to hardware, receiving and processing abnormal signals generated by hardware, management and scheduling of multi-tasking, and the like.
  • the hardware layer 2105 includes all hardware facilities in a machine learning development platform.
  • the optional hardware layer 2105 includes a main processor, a coprocessor, a memory, an input / output device, a power supply module, and their connection devices. It can be understood that the hardware layer 2105 is not limited to the above devices.
  • step S2201 is to obtain task parameters of a machine learning task.
  • the task parameters of the machine learning task are obtained through the external interface module 231000.
  • the task parameters are parameters required to generate a general machine learning model, and the parameters include parameters other than input data and output data.
  • the task parameters are input from an external program, or input from a user. Understandably, when the task parameters come from the user's input, the user's input data needs to undergo format conversion to generate task parameters.
  • step S2202 the task parameters are classified and processed to generate task instructions and model parameters.
  • the model parameters are generated by the model parameter generation module 232100, and the task instructions are generated by the task instruction generation module 232200.
  • the task instruction refers to the task parameters that have been compiled and processed.
  • Model parameters refer to the processing results of other processing of the task parameters required during the operation of the machine learning algorithm.
  • step S2203 the task instructions and model parameters are aggregated according to the data type to generate stack data and heap data.
  • non-shareable data is collected by a stack data aggregator 233100
  • shared data is collected by a heap data aggregator 233200.
  • unshareable data refers to data not shared between cores in a multi-core platform
  • shared data refers to data shared between cores in a multi-core platform.
  • pooling refers to packing and ordering task instructions and model parameters.
  • step S2204 the stack data and heap data are integrated to generate a universal machine learning model.
  • a general machine learning model file generation method includes:
  • Step S2402 Acquire a general machine learning model.
  • the general machine learning model may be the general machine learning model generated through the foregoing steps S2201-S2204, or may be another model file.
  • Step S2404 calculating a storage offset of the universal machine learning model.
  • there may be one or more general machine learning models.
  • the storage offset of each general machine learning model is calculated.
  • Step S2406 Generate a model catalog according to the universal machine learning model and the offset of the universal machine learning model.
  • the model directory is a record of all model storage locations in the general machine learning model file. Through the model directory, you can quickly index to the target model.
  • Step S2408 Generate a universal machine learning model file according to the universal machine learning model and the model directory.
  • the universal machine learning model file in this embodiment includes not only the universal machine learning model itself, but also a model directory, so that when the universal machine learning model in the universal machine learning model file is called, the corresponding model is quickly located and read.
  • the above general machine learning model file generation method generates a general machine learning model file by generating a catalog of the obtained general machine model, and generating the general machine learning model file according to the general machine learning model and the model catalog.
  • the corresponding general model is directly read in the general machine learning model file according to the calculation needs, avoiding repeated compilation, thereby greatly improving the efficiency of machine learning algorithm implementation, and shortening the time from compilation to generating execution results. time.
  • step S2404 includes:
  • Step S24041 Obtain the size of the storage space occupied by each of the universal machine learning models and the number of the universal machine learning models.
  • the size of the storage space to be occupied by the universal machine learning model file is generated according to the size of the storage space occupied by each of the universal machine learning models and the number of the universal machine learning models.
  • Step S24042 Obtain the storage order of the universal machine learning model.
  • the storage order of the general machine learning model may follow a preset rule, or a storage order may be randomly generated. Specifically, after the storage order of the general machine learning model is determined, the general machine learning model is stored according to the determined storage order.
  • Step S24043 Calculate the storage offset of each universal machine learning model according to the storage space occupied by each universal machine learning model, the number of the universal machine learning models, and the storage order of the universal machine learning models. the amount.
  • the storage offset refers to the relative position of each general machine learning model in the general machine learning model file.
  • model A, model B, and model C are stored from the beginning of the file to the end of the file.
  • the size of model A is 2 bits
  • the size of model B is 3 bits
  • the size of model C is 1 bit.
  • the offset of model B is 2 bits
  • Step S2408, according to the universal machine learning model and the model directory, generating a universal machine learning model file includes:
  • Step S2408a obtaining a file header and a file tail of the universal machine learning model file
  • Step S2408b generating the universal machine learning model file according to the file header, the model directory, the universal machine learning model, and the file tail.
  • the file header refers to a piece of data that assumes a certain task at the beginning of the general machine learning model file
  • the file tail refers to a piece of data that assumes a certain task at the end of the general machine learning model file.
  • step S2408 according to the universal machine learning model and the model directory, generating a universal machine learning model file includes:
  • step S2408c an identification code of the universal machine learning model file is created.
  • the identification code of the universal machine learning model file refers to the identification character attached to the universal machine learning model file.
  • the identification code of the file can distinguish different universal machine learning model files, which is convenient for accurately obtaining the corresponding universal machine.
  • Learning model files Step S2408d generates a universal machine learning model file according to the identification code, the universal machine learning model, and the model directory.
  • the identification code of the universal machine learning model file is stored in the file header.
  • step S2408 generates a universal machine learning model file according to the universal machine learning model and the model directory, including:
  • Step S2408e creates a check code and / or an error correction code of the universal machine learning model file.
  • the check code is obtained by an operation in a general machine learning model file to verify the correctness of the general machine learning model file.
  • the check code is the last bit in a general machine learning model file, where the error correction code refers to the file receiving end, and can detect errors that occur during the transmission of the general machine learning model file, and A string of characters to be corrected.
  • the security and stability of receiving the universal machine learning model file is increased.
  • errors can be found in time through the check code, and errors can be corrected by the error correction code, which increases the stability and fault tolerance of the data and prevents corresponding errors in subsequent processes due to reception errors.
  • Step S2408f Generate a universal machine learning model file according to the check code and / or error correction code of the universal machine learning model file, the universal machine learning model, and the model directory.
  • the check code and / or error correction code is stored at the end of the file in a general machine learning model.
  • step S2408 generating the universal machine learning model file according to the universal machine learning model and the model directory further includes:
  • Step S24081 Calculate the size of the storage space required by the universal machine learning model file.
  • the universal machine learning model file includes one or more universal machine learning models.
  • the universal machine learning model file further includes a file header, a file tail, and a model directory.
  • the general machine learning file may further include a storage space size of the model directory and a sum of storage space sizes of the multiple general machine learning models.
  • the general machine learning file may further include the storage space size of the file header, the storage space size of the file tail, the storage space size of the model directory, and the sum of the storage space sizes of the multiple general machine learning models.
  • Step S24082 Generate a universal machine learning model file according to the size of the universal machine learning model, the storage space required for the universal machine learning model file, and the model directory.
  • the general machine learning model file model directory and the general machine learning model are sequentially stored from the file head to the file tail.
  • step S2501 obtaining a general machine learning model
  • step S2502 performing storage optimization processing on the general machine learning model , Generating a secondary model
  • step S2504 generating a secondary model catalog based on the secondary model and the secondary model storage offset
  • Step S2501 is the same as the execution process of step S2402 in the foregoing embodiment, and details are not described herein again.
  • steps S2503 and S2404, steps S2504 and S2406, steps S2505 and S2408 differ in the execution target, that is, the execution targets of step S2503, step S2504, and step S2505 are secondary models, steps S2404, step S2406, and step The execution object of S2408 is a general machine learning model. The corresponding steps in the two embodiments are executed in the same way, and details are not described herein again.
  • step S2501-step S2505 the original general-purpose machine learning model is optimized to facilitate the storage and transmission of the general machine-learning model file, which increases the security and stability in the transmission process.
  • step S2502 performing storage optimization processing on the general-purpose machine learning model, and generating a secondary model includes: performing compression processing on the general-purpose machine learning model to generate a secondary model.
  • step S2502 performing storage optimization processing on the universal machine learning model, and generating a secondary model further includes: performing encryption processing on the universal machine learning model to generate a secondary model.
  • generating the machine learning secondary model file according to the secondary model and the secondary model directory includes:
  • the step of calculating a storage offset of the secondary model includes:
  • the storage offset of each of the secondary models is calculated according to the storage space occupied by each of the secondary models, the number of the secondary models, and the storage order of the secondary models.
  • the generating a machine learning secondary model file according to the general machine learning model and the model directory includes:
  • the generating a machine learning secondary model file according to the secondary model and the model directory includes:
  • a general machine learning model file generation method includes:
  • FIG. 18 please refer to FIG. 18 together, and provide another general machine learning model generation method, including:
  • Step S2601 Obtain task parameters of the machine learning task.
  • the task parameters are parameters required to generate a general machine learning model, and the parameters include parameters other than input data and output data.
  • the task parameters are input from an external program, or input from a user. Understandably, when the task parameters come from the user's input, the user's input data needs to undergo format conversion to generate task parameters.
  • step S2602 the task parameters are classified and processed to generate task instructions and model parameters.
  • the task instruction refers to the task parameters that have been compiled and processed.
  • Model parameters refer to the processing results of other processing of the task parameters required during the operation of the machine learning algorithm.
  • step S2603 the task instructions and model parameters are aggregated according to the data type to generate stack data and heap data.
  • unshareable data refers to data not shared between cores in a multi-core platform
  • shared data refers to data shared between cores in a multi-core platform.
  • pooling refers to packing and ordering task instructions and model parameters.
  • the stack data and the heap data are integrated to generate a universal machine learning model.
  • the general machine learning model has good universality.
  • the universal machine learning model is compatible with different upper-layer frameworks, such as the upper-layer framework layer 2101, the compilation layer 2102, and the convergence layer 2103; it is also compatible with different lower-layer driver layers and hardware. Further, after a general machine learning model is formed, data blocks can be adjusted according to different numbers of computing cores, addresses of input data, addresses of output data, and other general machine learning models to suit different situations.
  • Step S2605 calculating a storage offset of the universal machine learning model; step S2606, generating a model directory based on the universal machine learning model and the universal machine learning model storage offset; step S2607, according to the universal machine
  • the learning model and the model directory generate a general machine learning model file.
  • Steps S2605, S2606, and S2607 in this embodiment are the same as the execution processes of steps S2405, S2406, and S2408 in the foregoing embodiment, and details are not described herein again.
  • a general machine learning model file generating device including: a model filler 2701, a directory generator 2702, and a file generator 2703; the model filler 2701 and all The directory generator 2702 is connected, and the file generator 2703 is connected to the model filler 2701 and the directory generator 2702, respectively.
  • the model filler 2701 is configured to obtain the general machine learning model;
  • the catalog generator 2702 is configured to calculate a storage offset of the universal machine learning model
  • the file generator 2703 is configured to generate a general machine learning model file according to the general machine learning model and the model directory.
  • the model filler 2701 is further configured to sequentially store the general machine learning model into the file generator.
  • the file generator 2703 further includes a file header generator 27033 and the file tail generator 27032; the file header generator 27033 is connected to the directory generator 2702, and the file tail generator 27032 is connected to the model filler 2701.
  • the file header generator 27033 is further configured to create an identification code of a universal machine learning model file, and generate a universal machine learning based on the identification code, the universal machine learning model, and the model directory. Model files.
  • the file tail generator 27032 is further configured to create a check code and / or an error correction code of the universal machine learning model file.
  • the generating device further includes a model storage optimizer 2704, which is connected to the model filler 2701 and connected to the catalog generator, and is configured to apply the universal machine learning model Perform storage optimization processing to generate a secondary model.
  • a secondary model filler is used to receive the secondary model and store the secondary model in the file generator in order.
  • the generating device further includes a file size calculator 2705, which is connected to the directory generator 2702 and is configured to calculate a storage space occupied by the universal machine learning model, and Calculate the size of the storage space required for the universal machine learning model file.
  • a file size calculator 2705 which is connected to the directory generator 2702 and is configured to calculate a storage space occupied by the universal machine learning model, and Calculate the size of the storage space required for the universal machine learning model file.
  • the file size calculator 2705 is connected to a model storage optimizer 2704.
  • the connection relationship in the foregoing embodiment includes an electrical connection or a wireless connection.
  • a general-purpose machine learning model file generating device please refer to FIG. 20 together.
  • the generating device includes:
  • External interface module 2801 for acquiring task parameters of a machine learning task
  • a classification processing module 2802 configured to perform classification processing on the task parameters to generate task instructions and model parameters;
  • a parameter collection module 2803 configured to collect the task instructions and model parameters according to the data type to generate stack data and heap data;
  • a model generation module 2804 configured to integrate the stack data and the heap data to generate a general machine learning model
  • a storage offset calculation module 2805 configured to calculate a storage offset of the universal machine learning model
  • a model directory generating module 2806 configured to generate a model directory according to the universal machine learning model and the offset of the universal machine learning model
  • a model file generating module 2807 is configured to generate a general machine learning model file according to the general machine learning model and the model directory.
  • the universal machine learning model generating device is connected to the universal machine learning model file generating device.
  • the universal machine learning model file generating device is used to generate the general machine learning model generating device.
  • the universal machine learning model is converted into a universal machine learning model file.
  • Each module in the above-mentioned general machine learning model file generating device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware in or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a general machine learning model file parsing method including:
  • Step S2701 obtaining a general machine learning model file.
  • the general machine learning model file includes the model file generated in step S2402 and step S2408. Further, the universal machine learning model in the universal machine learning file includes the universal machine learning model generated in steps S2201-S2204.
  • step S2702 a model directory is read from the universal machine learning model file.
  • the model directory includes the model directory generated by the above step S2406.
  • Step S2703 Read the target universal machine learning model according to the model catalog.
  • the target universal machine learning model refers to the general machine learning model to be taken out from the general machine learning model file.
  • the target universal machine learning model can be determined according to the user's operation instructions, and can also be determined according to the task execution needs.
  • step S2701 obtaining a universal machine learning model file includes:
  • Step S27011 Obtain an identification code of the universal machine learning model file.
  • the identification code of the universal machine learning model file may be located at the header of the universal machine learning model file, so as to facilitate identification of the universal machine learning model file.
  • the identification code of the universal machine learning model file refers to the identification character attached to the universal machine learning model file.
  • the identification code of the identification file can distinguish different universal machine learning model files, which is convenient for accurately obtaining the corresponding universal Machine learning model files.
  • the identification code may be an identification code of the universal machine learning model file created by the foregoing step S408c.
  • Step S27012 detecting whether the identification code complies with a preset rule.
  • the preset rule refers to the description information of the identification code of the universal machine learning model file obtained before the corresponding universal machine learning model file is read. Further, after the universal machine learning model file is obtained, it is detected whether the identification code of the universal machine learning model file matches the description information. If they match, it is determined that the identification code meets a preset rule. Set rules.
  • Step S27013 if the identification code complies with a preset rule, read a model directory in the universal machine learning model file. Specifically, if the identification code complies with a preset rule, it can be determined that there is no abnormality in the universal machine learning model file during transmission.
  • the identification code does not conform to a preset rule, the obtained general machine learning model file is inconsistent with the general machine learning model file to be read. Specifically, if the identification code does not conform to a preset rule, it is determined that the read general machine learning model file is abnormal, and the general machine learning model file parsing method is stopped.
  • step S2701 obtaining a general machine learning model file includes:
  • Step S27014 Obtain a check code of the universal machine learning model file. Specifically, if the identification code is valid, the obtained universal machine learning model file is correct, and the check code of the obtained universal machine learning model file is further detected to determine whether the content of the universal machine learning model file is correct.
  • Step S27015 it is checked whether the check code is consistent with the preset standard code, and if the check code is not consistent with the preset standard code, an error correction operation is performed.
  • the preset standard code is consistent with the check code when the content of the universal machine learning model file is correct. Further, if the obtained check code is consistent with the preset standard code, it can be determined that the content of the universal machine learning model file is correct, otherwise, if the obtained check code is not consistent with the preset standard code, the universal machine learning model can be determined The file content is incorrect.
  • the cause of the error may be that the original file is wrong, or that the original file is correct but an error occurs during transmission.
  • Step S27015 checks whether the check code is consistent with the preset standard code. If the check code is not consistent with the preset standard code, performing the error correction operation includes:
  • Step S27015a obtaining an error correction code.
  • the error correction code may be the error correction code obtained through the foregoing step S2408e.
  • the error code refers to a string of characters that can be found at the receiving end of the file and can be used to correct errors that occur during the transmission of the universal machine learning model file.
  • Step S27015b Perform error correction on the universal machine learning model file according to the error correction code to obtain an error-corrected model file.
  • the error correction code may be located at the end of the file of the general machine learning model file.
  • Step S27015c It is checked whether the check code of the error-corrected model file is consistent with the preset standard code. Specifically, after the error correction is completed, it is checked again whether the check code of the error-corrected model file is consistent with the preset standard code to detect the error correction effect.
  • Step S27015d if the check code of the error-corrected universal machine learning model file is consistent with the preset standard code, read a model directory in the universal machine learning model file. Understandably, if the check code of the universal machine learning model file after the error correction is consistent with the preset standard code, it can be determined that the universal machine learning model after the error correction is correct.
  • the universal machine learning model file parsing method further includes: if the check code of the error-corrected universal machine learning model file is inconsistent with the preset standard code, the method stops executing . Understandably, if the check code of the universal machine learning model file after error correction is still inconsistent with the preset standard code, it can be judged that the error correction fails, and the universal machine learning model after error correction is still wrong.
  • Reading the target universal machine learning model according to the model catalog includes:
  • Step S27031 Obtain a storage offset of the target universal machine learning model in the universal machine learning model file.
  • the storage offset refers to the relative position of each general machine learning model in the general machine learning model file.
  • model A, model B, and model C are stored from the beginning of the file to the end of the file.
  • the size of model A is 2 bits
  • the size of model B is 3 bits
  • the size of model C is 1 bit.
  • the offset of model B is 2 bits
  • Step S27032 Read the target universal machine learning model according to the storage offset.
  • the position of the target universal machine learning model in the target universal machine learning model file is obtained according to the storage offset, and the target universal machine learning model is further read according to the position of the target universal machine learning model file.
  • FIG. 26 please refer to FIG. 26 together, and provide a general machine learning model file parsing method, including:
  • Step S2801 obtaining a general machine learning model file. Specifically, the execution process of step S2801 is the same as that of step S2701 described above, and details are not described herein again.
  • Step S2802 reading the secondary model directory from the general machine learning model file.
  • a general-purpose machine learning model file stores a secondary model file.
  • the second-level model and the second-level model directory in this embodiment may be generated through steps S2501 to S2505 described above.
  • Step S2803 Read the target secondary model according to the secondary model directory.
  • a storage offset of the target secondary model in the universal machine learning model file is obtained; and the target secondary model is read according to the storage offset.
  • the target secondary model refers to the general machine learning model to be taken out from the general machine learning model file.
  • Step S2804 Restore the target secondary model to obtain a target universal machine learning model.
  • the secondary model is a general-purpose machine learning model that has undergone storage optimization.
  • the secondary model is restored according to the operation of the storage optimization process. For example, if the storage optimization process is encryption, the restore operation is to decrypt the secondary model; for another example, if the storage optimization process is compression, the restore operation is to decompress the secondary model. Understandably, if the storage optimization process is encryption and compression, the restore operation is decryption and decompression.
  • the general machine learning model file parsing method further includes:
  • Step S2901 reading hardware parameter information in the universal machine learning model.
  • the hardware parameter information refers to hardware information required when executing a general machine learning model.
  • Step S2902 Generate hardware matching information according to the hardware parameter information.
  • the hardware matching the hardware parameter information is matched in the device pool.
  • the device pool may be devices in different hardware platforms.
  • the analysis process or execution process of the general machine learning model can be implemented across platforms.
  • a general machine learning model file requires a CPU and a GPU to implement, but there is only one CPU without a GPU in this platform, then looking for another platform with a GPU in the device pool, then connecting different platforms in the device pool Hardware equipment to complete the implementation of this general machine learning model.
  • the general machine learning model file parsing method further includes:
  • Step S2903 classify and disassemble the universal machine learning model to obtain stack area data and heap area data.
  • the basis for classification and disassembly is to perform disassembly according to different data types.
  • stack data refers to data that cannot be shared between cores in a multi-core development platform
  • stack data refers to data that can be shared between cores in a multi-core development platform.
  • the classification and disassembly of the general machine learning model described in step S2903 to obtain stack data and heap data includes: step S29031, disassembling the shareable data in the general machine learning model into Stack data; step S29032, disassembling unshareable data in the universal machine learning model into heap data.
  • Step S2904 Calculate according to the stack area data, the stack area data, and input data to obtain output data.
  • the method further includes allocating the stack data to a stack area;
  • the stack area refers to a storage space in the memory that mainly stores stack data.
  • the data stored in the stack area also includes intermediate results generated during the machine learning operation.
  • the method further includes allocating the heap data to a heap area; specifically, the heap area refers to a storage space in the memory where the heap data is mainly stored.
  • the data stored in the optional heap area also includes intermediate results generated during machine learning operations.
  • the heap area data includes data stored in the heap area, such as heap data and layout information of each heap data block.
  • steps in the flowcharts of FIGS. 9, 11-18, and 21-28 are sequentially displayed in accordance with the directions of the arrows, these steps are not necessarily performed sequentially in the order indicated by the arrows. Unless explicitly stated in this document, the execution of these steps is not strictly limited, and these steps can be performed in other orders. Moreover, at least some of the steps in FIGS. 9, 11-18, and 21-28 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily performed sequentially, but may be performed in turn or alternately with at least a part of other steps or sub-steps or stages of other steps.
  • a general machine learning model file parsing device including:
  • the file acquirer 2901 is configured to obtain a general machine learning model file
  • the directory parser 2902 is configured to read a model directory in the general machine learning model file
  • the model reader 2903 is configured to read a target universal machine learning model according to the model catalog.
  • the file acquirer 2901 includes a file header checker 29011;
  • the file header checker 29011 is configured to obtain an identification code of the universal machine learning model file; and detect whether the identification code conforms to a preset rule; if the identification code in the file header is valid, The model directory is read from the machine learning model file; the file header checker is also used to:
  • the file acquirer 2901 further includes a file tail corrector 29012;
  • the file tail corrector 29012 is used to obtain an error correction code at the end of the file; and is further used to correct the universal machine learning model file according to the error correction code to obtain an error corrected model file; and Checking whether the check code of the model file after the error correction is consistent with the pre-generated check code of the preset standard code; if the check code of the model file after the error correction is consistent with the preset standard If the pre-generated check codes are consistent, the model directory is read in the universal machine learning model file.
  • the file tail corrector 29012 is further configured to stop execution of the method if a check code of the error-corrected model file is inconsistent with the preset standard code.
  • the model reader 2903 is further specifically configured to obtain an offset of a target universal machine learning model in the universal machine learning model file; and read the offset according to the offset.
  • Target general machine learning model is further specifically configured to obtain an offset of a target universal machine learning model in the universal machine learning model file; and read the offset according to the offset.
  • the universal machine learning model file parsing device further includes a model distributor 2904, and the model distributor 2904 is connected to the directory parser 2902.
  • the model distributor 2904 is configured to read a secondary model directory in the universal machine learning model file; and read the target secondary model according to the secondary model directory; The target secondary model is analyzed to obtain a general machine learning model.
  • the universal machine learning model file parsing device further includes a hardware matcher 2905, which is connected to the model reader 2903.
  • the hardware matcher is used to read the universal machine Hardware parameter information in a learning model; and for matching corresponding hardware in a device pool according to the hardware parameter information.
  • the universal machine learning model file parsing device is connected to the universal machine learning execution device 29100. Please refer to FIG. 30 together.
  • the universal machine learning execution device includes:
  • a model acquirer 29101 for acquiring a general machine learning model
  • a model disassembler 29102 configured to classify and disassemble the general machine learning model to obtain stack area data and heap area data;
  • a result outputter 29103 is configured to obtain the stack area data, the stack area data, and input data for calculation to obtain output data.
  • Each module in the above-mentioned general machine learning model file generating device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware in or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 31.
  • the computer equipment includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for running the operating system and computer programs in a non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • FIG. 31 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
  • a computer device which includes a memory and a processor.
  • a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method provided by any of the foregoing embodiments are implemented.
  • a computer-readable storage medium has stored thereon a computer program that, when executed by a processor, implements the steps of the method provided in any of the above embodiments.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • FIG. 7 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer parts than shown in the figure, or combine certain parts, or have a different arrangement of parts.
  • relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. There is any such actual relationship or order between OR operations.

Abstract

一种通用机器学习模型的生成方法、装置、计算机设备和存储介质。该方法包括:获取机器学习任务的任务参数(S1201);对任务参数进行分类处理,得到任务指令及模型参数(S1202);根据数据类型将任务指令及模型参数进行汇集,得到栈数据和堆数据(S1203);将栈数据和堆数据进行整合,得到通用机器学习模型(S1204)。采用该方法能够使得算法运行中直接执行相应通用模型的编译结果,避免重复编译,从而大大提高机器学习算法实现的效率,缩短了从编译到得到执行结果的时间。

Description

通用机器学习模型、模型文件的生成和解析方法
相关申请
本申请要求2018年11月30日申请的,申请号为201811459853.6,名称为“通用机器学习模型文件解析方法、装置、存储介质”;申请号为201811459679.5,名称为“通用机器学习模型文件的生成方法、装置、存储介质”;申请号为201811457719.2,名称为“机器学习二级模型文件生成方法、装置、存储介质”;申请号为201811456246.4,名称为“通用机器学习二级模型文件解析方法、装置、存储介质”的中国专利申请的优先权;2018年6月8日申请的,申请号为201810589390.9,名称为“通用机器学习模型的生成方法、装置和存储介质”;以及申请号为201810588623.3,名称为“通用机器学习模型的执行方法、装置和存储介质”的中国专利申请的优先权,在此将其全文引入作为参考。
技术领域
本申请涉及一种人工智能领域,特别是涉及一种通用机器学习模型、模型文件的生成方法、装置和存储介质。
背景技术
随着人工智能技术的发展,出现了各种机器学习算法。传统的机器学习算法在开发平台中运行时,每次执行都要先经过编译过程。但是由于机器学习过程中,算法重复编译次数多,而编译过程耗时长,导致算法执行效率低。
发明内容
有鉴于此,本申请公开一种机器学习模型的生成、执行以及使用方法、装置和存储介质,以实现在机器学习运算过程中,根据运算需要直接在通用机器学习模型文件中读取对应的通用模型,避免重复编译,从而大大提高机器学习算法实现的效率,缩短了从编译到得到执行结果的时间。
一种通用机器学习模型的生成方法,所述方法包括:
获取机器学习任务的任务参数;
对所述任务参数进行分类处理,得到任务指令及模型参数;
根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据;
将所述栈数据和堆数据进行整合,得到通用机器学习模型。
在其中一个实施例中,所述任务参数包括算法控制参数和计算参数;
所述对所述任务参数进行分类处理,得到任务指令及模型参数的步骤包括:
对所述算法控制参数进行编译,得到任务指令;
对所述计算参数进行分类处理,得到模型参数。
在其中一个实施例中,所述对所述计算参数进行分类处理,得到模型参数的步骤包括:
对所述计算参数进行预处理,得到预处理模型数据;
根据所述计算参数获取硬件参数;
提取所述计算参数中的数据属性参数。
在其中一个实施例中,所述根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据的步骤包括:
对所述任务指令进行分类处理,得到任务指令堆数据;
根据所述数据类型对模型参数进行分类处理,得到模型参数栈数据及模型参数堆数据;
对所述模型参数栈数据进行汇集,得到所述栈数据;
对所述模型参数堆数据进行汇集,得到所述堆数据。
在其中一个实施例中,所述根据所述数据类型对模型参数进行分类处理,得到模型参数栈数据及模型参数堆数据的步骤包括:
根据共享属性对所述模型参数进行分类,得到可共享模型参数及不可共享模型参数;
对可共享模型参数进行汇集,得到模型参数堆数据;
对所述不可共享模型参数进行汇集,得到模型参数栈数据。
在其中一个实施例中,所述模型参数堆数据包括模型参数静态数据和模型参数动态数据;
所述将所述栈数据和堆数据进行整合,得到通用机器学习模型的步骤包括:
将所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到连续的静态数据块;
对所述模型参数动态数据进行打包整合,得到连续的动态数据块;
对所述模型参数栈数据进行打包整合,得到栈数据块;
对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型。
在其中一个实施例中,所述对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型的步骤包括:
根据所述任务指令获取静态数据布局信息、动态数据布局信息以及栈数据布局信息;
根据所述静态数据布局信息对所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到所述连续的静态数据块;
根据所述动态数据布局信息对对所述模型参数动态数据进行打包整合,得到连续的动态数据块;
根据所述栈数据布局信息对所述模型参数栈数据进行打包整合,得到所述栈数据块;
对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行整合。
在其中一个实施例中,所述提取所述计算参数中的数据属性参数的步骤包括:
获取计算参数的输入数据属性、输出数据属性及中间结果临时空间属性;
在所述输入数据的属性中提取所述输入数据的数据量,并分配所述输入数据存储空间;
在所述输出数据的属性中提取所述输出数据的数据量,并分配所述输出数据存储空间;
在所述中间结果临时空间属性中提取中间结果临时空间的数据量,并分配所述中间结果临时存储空间
将所述输入数据存储空间及输出数据存储空间存储为堆数据,将所述中间结果临时空间存储为栈数据。
在其中一个实施例中,所述根据所述栈数据布局信息对所述模型参数栈数据进行打包整合,得到所述栈数据块的步骤包括:
根据所述栈数据布局信息对所述不可共享模型参数、中间结果临时空间数据进行整合,得到所述栈数据块。
在其中一个实施例中,所述根据所述计算参数获取硬件参数的步骤包括:
获取硬件平台信息以及硬件配置参数并存储为堆数据。
在其中一个实施例中,所述根据所述静态数据布局信息对所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到所述连续的静态数据块的步骤包括:
根据所述静态数据布局信息,对所述任务指令堆数据、可共享模型参数、硬件平台信息以及硬件配置参数进行整合,得到所述连续的静态数据块。
在其中一个实施例中,所述根据所述动态数据布局信息对所述模型参数动态数据进行打包整合,得到连续的动态数据块的步骤包括:
根据所述动态数据布局信息对所述输入数据存储空间以及所述输出数据存储空间进行整合,得到所述连续的动态数据块。
一种通用机器学习模型的生成装置,所述装置包括:
对外接口模块,用于获取机器学习任务的任务参数;
分类处理模块,用于对所述任务参数进行分类处理,得到任务指令及模型参数;
参数汇集模块,用于根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据;
模型生成模块,用于将所述栈数据和堆数据进行整合,得到通用机器学习模型。
在其中一个实施例中,所述任务参数包括算法控制参数和计算参数;
所述分类处理模块包括:
任务指令生成模块,用于对所述算法控制参数进行编译,得到任务指令;
模型参数生成模块,对所述计算参数进行分类处理,得到模型参数。
在其中一个实施例中,所述模型参数生成模块包括:
模型参数栈数据生成模块,用于对可共享模型参数进行汇集,得到模型参数栈数据;
模型参数堆数据生成模块,用于对所述不可共享模型参数进行汇集,得到模型参数堆数据。
在其中一个实施例中,所述模型参数堆数据生成模块包括:
模型参数静态数据生成模块,用于对静态的所述模型参数堆数据进行汇集,得到模型参数静态数据;
模型参数动态数据生成模块,用于对动态的所述模型参数堆数据进行汇集,得到模型参数动态数据。
在其中一个实施例中,所述模型参数生成模块还包括:
预处理模块,用于对所述计算参数进行预处理,得到预处理模型数据;
硬件参数生成模块,用于根据所述计算参数获取硬件参数;
属性提取模块,用于提取所述计算参数中的数据属性参数。
在其中一个实施例中,所述任务指令包括任务指令堆数据;所述参数汇集器包括:
栈数据汇集器,用于对所述模型参数栈数据进行打包整合,得到栈数据块;
模型参数动态数据汇集器,用于对所述模型参数动态数据进行打包整合,得到连续的动态数据块;
模型参数静态数据汇集器,用于将所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到连续的静态数据块。
在其中一个实施例中,所述模型生成模块用于对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型。
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以上任一实施例所提供方法的步骤。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上任一实施例所提供方法的步骤。
一种通用机器学习模型的执行方法,所述方法包括:
获取通用机器学习模型;
对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数据;
根据所述栈区数据、所述堆区数据以及输入数据进行计算,得到输出数据。
本申请实施例还提供了一种通用机器学习模型的执行装置,所述装置包括:
模型获取模块,用于获取通用机器学习模型;
模型拆解模块,用于对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数 据;
结果输出模块,用于获取所述栈区数据和所述堆区数据、以及输入数据进行计算,得到输出数据。
在其中一个实施例中,所述栈区数据包括栈数据,所述堆区数据包括堆数据;所述对所述通用机器学习模型进行分类拆解,得到栈数据和堆数据的步骤包括:
将所述通用机器学习模型中可共享的数据拆解为栈数据;
将所述栈数据分配到栈区;
将所述通用机器学习模型中不可共享的数据拆解为堆数据;
将所述堆数据分配到堆区。
在其中一个实施例中,所述栈数据包括模型参数栈数据,所述栈区数据包括多个栈区中的数据;
所述将所述栈数据分配到栈区,得到栈区数据的步骤包括:
将所述模型参数栈数据分配到模型参数栈区。
在其中一个实施例中,所述将所述模型参数栈数据分配到模型参数栈区的步骤包括:
计算所述模型参数栈数据所需占用存储空间的大小与所述中间结果临时存储空间的大小之和,得到第一存储空间的大小;
分配所述模型参数栈区的存储空间,所述模型参数栈区的存储空间大于或等于所述第一存储空间的大小。
在其中一个实施例中,所述方法还包括:
将运行阶段变化的堆数据存储为模型参数动态数据;以及
将运行阶段不变的堆数据存储为模型参数静态数据。
在其中一个实施例中,所述将所述堆数据分配到堆区的步骤包括:
所述将所述堆数据分配到堆区的步骤包括:
将所述堆区分为模型参数动态堆区和模型参数静态堆区;
将所述模型参数动态数据分配到所述模型参数动态堆区;
将所述模型参数静态数据分配到所述模型参数静态堆区。
在其中一个实施例中,所述将所述模型参数动态数据分配到模型参数动态堆区的步骤包括:
将所述模型参数动态数据的存储空间与所述输入数据的存储空间、所述输出数据的存储空间相加,得到第二存储空间的大小;
分配所述模型参数动态堆区的存储空间,所述动态数据堆区的存储空间大于或等于所述第二存储空间的大小。
在其中一个实施例中,所述模型参数静态堆区的存储空间大于等于所述模型参数静态 数据的存储空间。
在其中一个实施例中,所述模型参数静态数据包括任务指令堆数据。
在其中一个实施例中,所述将所述堆数据分配到堆区,得到堆区数据的步骤还包括:
所述将所述堆数据分配到堆区的步骤还包括:
将所述模型参数动态堆区、所述模型参数静态堆区分配到一段连续的存储空间。
在其中一个实施例中,所述堆区中的数据包括所述模型参数动态数据、所述模型参数静态数据以及所述输入数据、所述输出数据。
在其中一个实施例中,所述根据所述栈区数据、所述堆区数据和所述输入数据进行计算,得到输出数据的步骤还包括:
从所述堆区提取所述输出数据;
输出所述输出数据。
一种通用机器学习模型的执行装置,其特征在于,所述装置包括:
模型获取模块,用于获取通用机器学习模型;
模型拆解模块,用于对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数据;
结果输出模块,用于获取所述栈区数据和所述堆区数据、以及输入数据进行计算,得到输出数据。
在其中一个实施例中,所述栈区数据包括栈数据,所述堆区数据包括堆数据;所述模型拆解模块包括:
栈区数据分配模块,用于将所述通用机器学习模型中不可共享的数据拆解为栈数据;
堆区数据分配模块,用于将所述通用机器学习模型中可共享的数据拆解为堆数据。
在其中一个实施例中,所述栈区数据分配模块还用于将所述栈数据分配到栈区。
在其中一个实施例中,所述堆区数据分配模块还用于将所述堆数据分配到堆区。
在其中一个实施例中,所述栈数据包括模型参数栈数据;所述栈数据分配模块还用于将所述模型参数栈数据分配到模型参数栈区。
在其中一个实施例中,所述堆数据包括模型参数静态数据以及模型参数动态数据;所述堆数据分配模块还包括:
模型参数静态数据分配模块,用于将所述模型参数静态数据分配到模型参数静态堆区;
模型参数动态数据分配模块,用于将所述模型参数动态数据分配到模型参数动态堆区。
在其中一个实施例中,所述结果输出模块还包括:
数据提取模块,用于从所述堆区提取所述输出数据;
数据输出模块,用于输出所述输出数据。
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器 执行所述计算机程序时实现以上任一实施例所提供方法的步骤。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上任一实施例所提供方法的步骤。
一种通用机器学习模型文件的生成方法,所述通用机器学习模型文件包括通用机器学习模型和模型目录,所述生成方法包括:
获取所述通用机器学习模型;
计算所述通用机器学习模型的存储偏移量;
根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成所述模型目录;
根据所述通用机器学习模型以及所述模型目录,生成所述通用机器学习模型文件。
在其中一个实施例中,所述根据所述通用机器学习模型以及所述模型目录,生成所述通用机器学习模型文件,包括:
获取所述通用机器学习模型文件的文件头和文件尾;
根据所述文件头、所述模型目录、所述通用机器学习模型以及所述文件尾,生成所述通用机器学习模型文件。
在其中一个实施例中,所述计算所述通用机器学习模型的存储偏移量的步骤包括:
获取每个所述通用机器学习模型占用的存储空间大小和所述通用机器学习模型的数量;
获取所述通用机器学习模型的存放顺序;
根据每个所述通用机器学习模型占用的存储空间大小、所述通用机器学习模型的数量、所述通用机器学习模型的存放顺序,计算每个所述通用机器学习模型的存储偏移量。
在其中一个实施例中,所述根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件,包括:
所述根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件,包括:
创建所述通用机器学习模型文件的标识码;
根据所述标识码、所述通用机器学习模型、所述模型目录,生成所述通用机器学习模型文件。
在其中一个实施例中,所述根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件,还包括:
所述根据所述通用机器学习模型以及所述模型目录,生成所述通用机器学习模型文件,包括:
创建所述通用机器学习模型文件的校验码和/或纠错码;
根据所述通用机器学习模型文件的校验码和/或纠错码、所述通用机器学习模型以及所述模型目录,生成所述通用机器学习模型文件。
在其中一个实施例中,所述根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件,还包括:
创建所述通用机器学习模型文件的纠错码;
根据所述通用机器学习模型文件的纠错码、所述通用机器学习模型、所述模型目录,生成通用机器学习模型文件。
在其中一个实施例中,所述根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件还包括:
计算所述通用机器学习模型文件所需占用的存储空间的大小;
根据所述通用机器学习模型、所述通用机器学习模型文件所需占用的存储空间的大小以及所述模型目录,生成通用机器学习模型文件。
一种通用机器学习模型文件生成方法,所述方法包括:
获取机器学习任务的任务参数;
对所述任务参数进行分类处理,生成任务指令及模型参数;
根据数据类型将所述任务指令及模型参数进行汇集,生成栈数据和堆数据;
将所述栈数据和堆数据进行整合,生成通用机器学习模型;
计算所述通用机器学习模型的存储偏移量;
根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成模型目录;
根据所述通用机器学习模型、所述模型目录,生成通用机器学习模型文件。
一种通用机器学习模型文件的生成装置,所述通用机器学习模型文件包括通用机器学习模型和模型目录,所述生成装置包括:
模型填充器、目录生成器以及文件生成器;所述模型填充器和所述目录生成器相连,所述文件生成器分别与所述模型填充器、所述目录生成器相连;
所述模型填充器,用于获取所述通用机器学习模型;
所述目录生成器,用于计算所述通用机器学习模型的存储偏移量;以及
根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成模型目录;
所述文件生成器用于根据所述通用机器学习模型、所述模型目录,生成所述通用机器学习模型文件。
在其中一个实施例中,所述模型填充器还用于将所述通用机器学习模型,按序存入所述文件生成器。
在其中一个实施例中,所述文件生成器还包括文件头生成器和所述文件尾生成器;所述文件头生成器与所述目录生成器相连,所述文件尾生成器与所述模型填充器相连。
在其中一个实施例中,所述文件头生成器还用于创建通用机器学习模型文件的标识码,以及根据所述通用机器学习模型文件的标识码、所述通用机器学习模型、所述模型目录,生成所述通用机器学习模型文件。
在其中一个实施例中,所述文件尾生成器还用于创建所述通用机器学习模型文件的校验码和/或纠错码。
在其中一个实施例中,所述生成装置还包括文件大小计算器,所述文件大小计算器与所述目录生成器连接,用于计算所述通用机器学习模型占用的存储空间大小,以及计算所述通用机器学习模型文件所需占用的存储空间的大小。
一种通用机器学习模型文件生成装置,所述生成装置包括:
对外接口模块,用于获取机器学习任务的任务参数;
分类处理模块,用于对所述任务参数进行分类处理,生成任务指令及模型参数;
参数汇集模块,用于根据数据类型将所述任务指令及模型参数进行汇集,生成栈数据和堆数据;
模型生成模块,用于将所述栈数据和堆数据进行整合,生成通用机器学习模型;
存储偏移量计算模块,用于计算所述通用机器学习模型的存储偏移量;
模型目录生成模块,用于根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成所述模型目录;
模型文件生成模块,用于根据所述通用机器学习模型、所述模型目录,生成所述通用机器学习模型文件。
在其中一个实施例中,所述文件大小计算器与模型存储优化器相连。一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以上任一实施例所述方法的步骤。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上任一实施例所述方法的步骤。
一种机器学习二级模型文件的生成方法,所述机器学习二级模型文件包括二级模型和二级模型目录,所述生成方法包括:
获取通用机器学习模型;
对所述通用机器学习模型进行存储优化处理,生成所述二级模型;
计算所述二级模型的存储偏移量;
根据所述二级模型以及所述二级模型的存储偏移量,生成二级模型目录;
根据所述二级模型以及所述二级模型目录,生成机器学习二级模型文件。
在其中一个实施例中,所述对所述通用机器学习模型进行存储优化处理,生成所述二级模型的步骤包括:对所述通用机器学习模型进行压缩处理和/或加密处理,生成所述二级 模型。
在其中一个实施例中,所述根据所述二级模型以及所述二级模型目录,生成机器学习二级模型文件,包括:
获取所述机器学习二级模型文件的文件头和文件尾;
根据所述文件头、所述二级模型目录、所述通用机器学习模型以及所述文件尾,生成所述机器学习二级模型文件。
在其中一个实施例中,所述计算所述二级模型的存储偏移量的步骤包括:
获取每个所述通用机器学习模型占用的存储空间大小和所述二级模型的数量;
获取所述二级模型的存放顺序;
根据每个所述二级模型占用的存储空间大小、所述二级模型的数量、所述二级模型的存放顺序,计算每个所述二级模型的存储偏移量。
在其中一个实施例中,所述根据所述通用机器学习模型以及所述模型目录,生成机器学习二级模型文件,包括:
创建机器学习二级模型文件的标识码;
根据所述模型文件的标识码、所述二级模型、所述二级模型目录,生成机器学习二级模型文件。
在其中一个实施例中,所述根据所述二级模型以及所述模型目录,生成机器学习二级模型文件,包括:
创建所述机器学习二级模型文件的校验码和/或纠错码;根据所述机器学习二级模型文件的校验码和/或纠错码、所述二级模型以及所述二级模型目录,生成机器学习二级模型文件。
一种通用机器学习模型文件生成方法,所述方法包括:
获取机器学习任务的任务参数;
对所述任务参数进行分类,生成任务指令及模型参数;
根据数据类型将所述任务指令及模型参数进行汇集,生成栈数据和堆数据;
将所述栈数据和堆数据进行整合,生成通用机器学习模型;
对所述通用机器学习模型进行存储优化处理,生成所述二级模型;计算所述二级模型的存储偏移量;
根据所述二级模型以及所述二级模型存储偏移量,生成二级模型目录;
根据所述二级模型、所述模型目录,生成机器学习二级模型文件。
一种机器学习二级模型文件的生成装置,所述机器学习二级模型文件包括二级模型和二级模型目录所述生成装置包括:
二级模型填充器、模型存储优化器、目录生成器以及文件生成器;所述模型填充器和 所述目录生成器相连,所述文件生成器分别与所述模型填充器、所述目录生成器相连,所述模型存储优化器与所述模型填充器相连;
所述二级模型填充器,用于获取通用机器学习模型;
所述模型存储优化器,用于对所述通用机器学习模型进行存储优化处理,生成二级模型;
所述目录生成器用于计算所述通用机器学习模型的存储偏移量;以及根据所述二级模型以及所述二级模型存储偏移量,生成二级模型目录;
所述文件生成器用于根据所述二级模型、所述二级模型目录,生成机器学习二级模型文件。
在其中一个实施例中,所述二级模型填充器还用于将所述二级模型,按序存入所述文件生成器。
在其中一个实施例中,所述文件生成器还包括文件头生成器和所述文件尾生成器;所述文件头生成器与所述目录生成器相连,所述文件尾生成器与所述二级模型填充器相连。
在其中一个实施例中,所述文件头生成器还用于创建二级模型的标识码,以及根据所述标识码、所述二级模型、所述二级模型目录,生成机器学习二级模型文件。
在其中一个实施例中,所述文件尾生成器还用于创建所述机器学习二级模型文件的校验码和/或纠错码。
在其中一个实施例中,所述生成装置还包括文件大小计算器,所述文件大小计算器与所述目录生成器连接,用于计算所述通用机器学习模型占用的存储空间大小,以及计算所述模型文件所需占用的存储空间的大小。
在其中一个实施例中,所述文件大小计算器与模型存储优化器相连。
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以上任一实施例所述方法的步骤。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上任一实施例所述方法的步骤。
一种通用机器学习模型文件解析方法,所述通用机器学习模型文件包括通用机器学习模型、二级模型目录,所述方法包括:
所述方法包括:
获取通用机器学习模型文件;
在所述通用机器学习模型文件中读取二级模型目录;
根据所述二级模型目录,读取目标二级模型;
对所述目标二级模型进行还原得到目标通用机器学习模型。
在其中一个实施例中,所述获取通用机器学习模型文件包括:
获取所述通用机器学习模型文件的标识码;
检测所述标识码是否符合预设规则;
若所述标识码符合预设规则,则在所述通用机器学习模型文件中读取二级模型目录。
在其中一个实施例中,所述若所述标识码符合预设规则,则在所述通用机器学习模型文件中读取模型目录包括:
获取所述通用机器学习模型文件的校验码;
校验所述校验码与预设标准码是否一致,若所述校验码与预设标准码不一致,则执行纠错运算。
在其中一个实施例中,所述校验码与预设标准码是否一致,若所述校验码与预设标准码不一致,则执行纠错运算包括:
获取纠错码;
根据所述纠错码对所述通用机器学习模型文件进行纠错,得到纠错后的模型文件;
校验所述纠错后的通用机器学习模型文件的校验码与所述预设标准码是否一致;
若所述纠错后的通用机器学习模型文件的校验码与所述预设标准码一致,则在所述通用机器学习模型文件中读取二级模型目录。
在其中一个实施例中,所述根据所述二级模型目录,读取目标二级模型包括:
获取目标二级模型在所述通用机器学习模型文件中的存储偏移量;
根据所述存储偏移量,读取所述目标通用机器学习模型。
在其中一个实施例中,所述方法还包括:
读取所述通用机器学习模型中的硬件参数信息;
根据所述硬件参数信息,生成硬件匹配信息。
在其中一个实施例中,所述方法还包括:
对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数据;
根据所述栈区数据、所述堆区数据以及输入数据计算,得到输出数据。
一种通用机器学习模型文件解析装置,所述通用机器学习模型文件包括通用机器学习模型、二级模型目录,其特征在于,所述装置包括:
文件获取器,模型分发器、目录解析器以及模型读取器;所述目录解析器分别与所述文件获取器、所述模型分发器以及所述模型读取器相连;
所述文件获取器,用于获取通用机器学习模型文件;
所述模型分发器,用于在所述通用机器学习模型文件中读取二级模型目录;并根据所述二级模型目录,读取目标二级模型;以及对所述目标二级模型进行还原得到目标通用机器学习模型;
所述目录解析器,用于在所述通用机器学习模型文件中读取模型目录;
所述模型读取器,用于根据所述模型目录,读取目标通用机器学习模型一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以上任一实施例所述方法的步骤。
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以上任一实施例所述方法的步骤
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以以上任一实施例所述方法的步骤。
一种通用机器学习模型文件解析方法,所述方法包括:
获取通用机器学习模型文件;
在所述通用机器学习模型文件中读取模型目录;
根据所述模型目录,读取目标通用机器学习模型。
在其中一个实施例中,所述获取通用机器学习模型文件包括:
获取所述通用机器学习模型文件的文件标识码;
检测所述文件标识码是否符合预设规则;
若所述文件标识码符合预设规则,则在所述通用机器学习模型文件中读取模型目录。
在其中一个实施例中,所述若所述文件标识码符合预设规则,则在所述通用机器学习模型文件中读取模型目录包括:
获取所述通用机器学习模型文件的校验码;
校验所述校验码与预设标准码是否一致,若所述校验码与预设标准码不一致,则执行纠错运算。
在其中一个实施例中,所述纠错运算包括:
所述校验所述校验码与预设标准码是否一致,若所述校验码与预设标准码不一致,则执行纠错运算包括:
获取纠错码;
根据所述纠错码对所述通用机器学习模型文件进行纠错,得到纠错后的模型文件;
校验所述纠错后的模型文件的校验码与所述预设标准码是否一致;
若所述纠错后的通用机器学习模型文件的校验码与所述预设标准码一致,则在所述通用机器学习模型文件中读取模型目录。
在其中一个实施例中,所述根据所述模型目录,读取对应的通用机器学习模型包括:
获取目标通用机器学习模型的在所述通用机器学习模型文件中的存储偏移量;
根据所述存储偏移量,读取所述目标通用机器学习模型。
一种通用机器学习模型文件解析方法,所述方法包括:
获取通用机器学习模型文件;
在所述通用机器学习模型文件中读取二级模型目录;
根据所述二级模型目录,读取目标二级模型;
对所述目标二级模型进行还原得到目标通用机器学习模型。
在其中一个实施例中,所述方法还包括:
读取所述通用机器学习模型中的硬件参数信息;
根据所述硬件参数信息,生成硬件匹配信息。
在其中一个实施例中,所述方法还包括:
对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数据;
根据所述栈区数据、所述堆区数据以及输入数据计算,得到输出数据。
一种通用机器学习模型文件解析装置,所述装置包括:
文件获取器,目录解析器以及模型读取器;所述目录解析器分别与所述文件获取器、以及所述模型读取器相连;
所述文件获取器,用于获取通用机器学习模型文件;
所述目录解析器,用于在所述通用机器学习模型文件中读取模型目录;
所述模型读取器,用于根据所述模型目录,读取目标通用机器学习模型。
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以上任一实施例所述方法的步骤。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上任一实施例所述方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据公开的附图获得其他的附图。
图1为一个实施例中通用机器学习模型生成方法的应用环境图;
图2为一个实施例中通用机器学习模型生成方法的流程示意图;
图3为一个实施例中通用机器学习模型生成装置的示意图;
图4为另一个实施例中通用机器学习模型执行方法的流程示意图;
图5为一个实施例中通用机器学习模型执行装置的示意图;
图6为一个实施例中通过通用机器学习模型对jpg图片进行特征提取的流程示意图;
图7为一个实施例中提供的计算机设备的内部结构图;
图8为一个实施例中通用机器学习模型文件生成方法的应用环境图;
图9为一个实施例中通用机器学习模型生成方法的流程示意图;
图10为一个实施例中通用机器学习模型生成装置的结构示意图;
图11为一个实施例中通用机器学习模型文件生成方法的流程示意图;
图12为一个实施例中计算所述通用机器学习模型的存储偏移量的流程示意图;
图13为一个实施例中根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件的流程示意图;
图14为另一个实施例中根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件的流程示意图;
图15为再一个实施例中根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件的流程示意图;
图16为又一个实施例中根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件的流程示意图;
图17为另一个实施例中通用机器学习模型生成方法的流程示意图;
图18为再一个实施例中通用机器学习模型生成方法的流程示意图;
图19为一个实施例中通用机器学习模型文件生成装置的结构示意图;
图20为另一个实施例中通用机器学习模型文件生成装置的结构示意图;
图21为一个实施例中通用机器学习模型解析方法的流程示意图;
图22为一个实施例中获取通用机器学习模型文件流程示意图;
图23为一个实施例中获取通用机器学习模型文件流程示意图;
图24为一个实施例中执行纠错运算流程示意图;
图25为一个实施例中根据所述模型目录,读取目标通用机器学习模型流程示意图;
图26为一个实施例中通用机器学习模型解析方法的流程示意图;
图27为另一个实施例中通用机器学习模型解析方法的流程示意图;
图28为又一个实施例中通用机器学习模型解析方法的流程示意图;
图29为一个实施例中通用机器学习模型解析装置的结构示意图;
图30为一个实施例中通用机器学习模型执行装置的结构示意图;
图31为一个实施例中计算机设备的内部结构图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本 申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请公开一种用于机器学习模型的生成、执行以及使用方法、装置和存储介质,以实现在机器学习运算过程中,根据运算需要直接在通用机器学习模型文件中读取对应的通用模型,避免重复编译,从而大大提高机器学习算法实现的效率,缩短了从编译到得到执行结果的时间。
本申请提供的通用机器学习模型的生成方法,可以应用于如图1所示的应用环境中。其中,图1所示的应用环境为机器学习开发平台,包括框架层1101、编译层1102、汇聚层1103、驱动层1104以及硬件层1105。
在其中一个实施例中,框架层1101用于提供机器学习任务的算法设计条件,为方便用户搭建自己的神经网络结构,提供便捷的训练和预测工具。可以理解的,框架层101用于实现以下步骤:
接收用户设计的机器学习算法(例如,神经网络结构);
解析出每个子任务的参数,传递给编译层生成机器指令及相关必要元素;
传递给运行时层执行计算,最终完成用户所需的机器学习任务。
在其中一个实施例中,编译层1102用于在机器学习任务中生成机器指令。具体的,编译层包括编译器、针对高频算子做特殊优化的高性能编程库以及其他能够生成机器指令的模块、装置以及数据库。可以理解的,编译层1102用于接收上层框架层1101传入的机器学习任务的参数,编译生成硬件的二进制机器指令,传递给下层的运行时层保存下来或执行计算。
在其中一个实施例中,汇聚层1103是对驱动程序做进一步封装的程序,可以屏蔽底层不同硬件和驱动的差异,向上层编译层1102或用户提供统一的程序接口。具体的,汇聚层1103封装上层软件不需考虑硬件和驱动程序的细节。进一步的,汇聚层1103用于提供机器学习任务基本操作的程序接口,保存和加载机器学习模型及其在硬件上执行所需的机器指令等必要元素,使上层软件和用户只需要关注机器学习任务本身,而不必考虑具体硬件的差异。可选地,汇聚层提供机器学习任务基本操作的程序接口包括内存空间分配、数据拷贝、启动计算以及其他机器学习任务基本操作的程序接口。
在其中一个实施例中,驱动层1104用于打包封装硬件层1105设备的基本操作,向上层汇聚层1103提供可被调用的程序接口。具体地,驱动层1104的基本操作包括控制数据流的输入输出,向硬件发送控制信号,接收与处理硬件产生的异常信号,多任务的管理和调度等。
在其中一个实施例中,硬件层1105包括机器学习开发平台中的所有硬件设施。可选的硬件层1105包括主处理器、协处理器、存储器,输入输出设备,供电模块以及它们的连接 设备。可以理解的,硬件层1105不限于上述器件。
在一个实施例中,请一并参阅图2、图3,提供了一种通用机器学习模型的生成方法及装置。在其中一个实施例中,步骤S1201,获取机器学习任务的任务参数。在其中一个实施例中,通过对外接口模块131000获取机器学习任务的任务参数。具体地,任务参数是生成通用机器学习模型所需要的参数,该参数包括除去输入数据、输出数据之外的参数。具体地,任务参数来自外部程序的输入,或者来自于用户的输入。可以理解的,当任务参数来自于用户的输入时,用户的输入数据需要经过格式转化才能得到任务参数。在其中一个实施例中,步骤S1202,对所述任务参数进行分类处理,得到任务指令及模型参数。在其中一个实施例中,通过模型参数生成模块132100得到模型参数,通过任务指令生成模块132200得到任务指令。具体的,任务指令是指经过编译处理的任务参数。模型参数是指机器学习算法运行过程中所需要对任务参数进行其他处理的处理结果。
在其中一个实施例中,步骤S1203,根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据。在其中一个实施例中,通过栈数据汇集器133100汇集不可共享的数据,通过堆数据汇集器133200汇集共享的数据。可以理解的,不可共享的数据是指在多核平台中,核间不共享的数据;共享的数据是指在多核平台中,核间共享的数据。具体地,汇集是指对任务指令及模型参数进行打包整理。
在其中一个实施例中,步骤S1204,将所述栈数据和堆数据进行整合,得到通用机器学习模型。具体的,通用机器学习模型具有良好的通用性。
具体的,通用机器学习模型既兼容上层的不同框架,例如兼容上层的框架层1101、编译层1102以及汇聚层1103;又能兼容下层的不同驱动层和硬件。进一步的,当一个通用机器学习模型形成之后,能够根据不同的运算核数量、输入数据的地址、输出数据的地址以及其他通用机器学习模型调整数据块,以适应不同的情况。
具体地,通用机器学习模型的生成步骤不限于上述步骤,不限于上述步骤的执行顺序,任何基于本发明构思所做出的变形都视为本发明的保护范围。
在一个实施例中,请一并参阅图3,具体的,所述任务参数包括算法控制参数和计算参数;
所述对所述任务参数进行分类处理,得到任务指令及模型参数的步骤包括:
对所述算法控制参数进行编译,得到任务指令;在其中一个实施例中,通过任务指令生成模块132200对算法控制参数进行编译。
具体地,算法控制参数包括算法的运算结构。具体地,编译指的是将高级语言转换为机器语言的过程。可以理解的,编译过程是产生目标程序的过程。具体的,任务指令包括直接被计算机识别和执行的指令。可以理解的,任务指令采用二进制编码格式。在一个实施例中,所述根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据的 步骤包括:对所述任务指令进行分类处理,得到任务指令堆数据。在一个实施例中,任务指令堆数据是指任务指令生成模块生成的在多核平台中,进行核间共享的任务指令数据。
对所述计算参数进行分类处理,得到模型参数。在其中一个实施例中,通过模型参数生成模块对计算参数进行分类处理,得到模型参数。
具体地,计算参数包括机器学习运算过程中的除去输入数据、输出数据之外的数据。可选的,分类处理包括机器学习中所需对输入数据、输出数据进行的处理,例如预处理操作或后处理操作。可选的,分类处理还包括在机器学习中,对输入数据执行机器学习运算时,所需要获取的数据或参数。例如硬件平台信息等。可以理解的,所述分类处理操作,不限于预处理操作或后处理操作,也不限于获取硬件平台信息,其他对输入数据、输出数据进行非机器学习运算的操作皆属于分类处理操作。通过分类处理操作,兼容了不同输入数据对在不同硬件平台上进行不同运算时所需的各种操作。可以理解的,分类处理操作可以在实践过程中进行修正和补充,以满足通用机器学习模型在不同场景下的应用。
在一个实施例中,请一并参阅图3,在其中一个实施例中,通过模型参数生成模块132100对计算参数进行分类处理,得到模型参数。在一个实施例中,所述根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据的步骤包括:根据所述数据类型对模型参数进行分类处理,得到模型参数栈数据及模型参数堆数据;作为一种可选的实施方式,通过模型参数生成模块132100对计算参数进行分类处理,得到模型参数栈数据和模型参数堆数据。具体的,模型参数栈数据是指在多核平台中不可进行核间共享的模型参数,模型参数堆数据是指在多核平台中可以进行核间共享的模型参数。具体的,通过模型参数栈数据生成模块获得模型参数栈数据,通过模型参数堆数据生成模块获取模型参数堆数据。
对计算参数进行分类处理,得到模型参数的步骤包括对计算参数进行预处理,得到预处理模型数据。在其中一个实施例中,通过预处理模块132121对计算参数进行预处理。在其中一个实施例中,对计算参数进行的预处理操作包括对计算参数进行格式转换操作、拆分操作和分类操作。可选的,预处理操作不限于格式转换操作、拆分操作和分类操作,对计算参数进行的其他操作皆为预处理操作。
在其中一个实施例中,对计算参数进行分类处理,得到模型参数的步骤包括根据所述计算参数获取硬件参数。作为一种可选的实施方式,硬件参数生成模块132122用于生成硬件参数。在其中一个实施例中,硬件参数包括硬件设备固定的指标参数,例如GPU的型号、cuda核数、私有cache大小、共享cache大小、访存带宽等。
在其中一个实施例中,对计算参数进行分类处理,得到模型参数的步骤包括提取所述计算参数中的数据属性参数。作为一种可选的实施方式,属性参数提取模块132123用于提取所述计算参数中的数据的属性参数。在其中一个实施例中,根据所述计算参数获取硬件参数的步骤包括:获取硬件平台信息以及硬件配置参数并存储为堆数据。在其中一个实施 例中,属性参数包括数据所特有的一些性质,例如当输入数据为图片时,属性参数就包括图片尺寸、通道数、占用的存储空间、保存格式、每个像素的数据类型等。
在一个实施例中,通过属性提取模块132123提取所述计算参数中的数据属性参数的步骤包括:
获取计算参数的输入数据属性、输出数据属性及中间结果临时空间属性;在所述输入数据的属性中提取所述输入数据的数据量,并分配所述输入数据存储空间;在所述输出数据的属性中提取所述输出数据的数据量,并分配所述输出数据存储空间;在所述中间结果临时空间属性中提取中间结果临时空间的数据量,并分配所述中间结果临时存储空间;将所述输入数据存储空间及输出数据存储空间存储为堆数据,将所述中间结果临时空间存储为栈数据。
在一个实施例中,根据所述数据类型对模型参数进行分类处理,得到模型参数栈数据的步骤包括:根据共享属性对所述模型参数进行分类,得到可共享模型参数及不可共享模型参数;对所述不可共享模型参数进行汇集,得到模型参数栈数据。在其中一个实施例中通过模型参数栈数据生成模块132110生成模型参数栈数据。在一个实施例中,所述根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据的步骤包括:对所述模型参数栈数据进行汇集,得到所述栈数据。在其中一个实施例中,通过栈数据汇集器133100汇集栈数据。通过汇集栈数据,能够对不可共享的数据进行统一处理,使得机器学习模型中的栈数据模式化,从而使得产生的机器学习模型具有通用性。
在一个实施例中,所述根据所述栈数据布局信息对所述模型参数栈数据进行打包整合,得到所述栈数据块的步骤还包括:根据所述栈数据布局信息对所述不可共享模型参数、所述中间结果临时空间数据进行整合,得到所述栈数据块。
在一个实施例中,根据所述数据类型对模型参数进行分类处理,得到模型参数堆数据的步骤包括:根据共享属性对所述模型参数进行分类,得到可共享模型参数及不可共享模型参数;对可共享模型参数进行汇集,得到模型参数堆数据。在其中一个实施例中,通过模型参数堆数据生成模块132120执行上述步骤,得到模型参数堆数据。通过汇集堆数据,能够对共享的数据进行统一处理,使得机器学习模型中的栈数据模式化,从而使得产生的机器学习模型具有通用性。
在一个实施例中,模型参数堆数据包括模型参数静态数据和模型参数动态数据。具体的,模型参数静态数据是在机器学习算法运行过程中不发生变化的数据,例如任务指令,模型参数堆数据、硬件平台信息。模型参数动态数据是指在机器学习算法运行过程中会发生变化的数据,例如输入数据、输出数据。
在一个实施例中,所述将所述栈数据和堆数据进行整合,得到通用机器学习模型的步骤包括:通过静态数据汇集器133210将所述任务指令堆数据与所述模型参数静态数据进 行打包整合,得到连续的静态数据块。在其中一个实施例中,根据所述静态数据布局信息,对所述任务指令堆数据、模型参数堆数据、硬件平台信息以及硬件配置参数进行整合,得到所述连续的静态数据块。
通过汇集静态数据块,能够对静态数据块数据进行统一处理,使得机器学习模型中的静态数据模式化,从而使得产生的机器学习模型具有通用性。
在一个实施例中,所述将所述栈数据和堆数据进行整合,得到通用机器学习模型的步骤包括:通过动态数据汇集器133220对所述模型参数动态数据进行打包整合,得到连续的动态数据块。在其中一个实施例中,根据所述动态数据布局信息对所述输入数据存储空间以及所述输出数据存储空间进行整合,得到所述连续的动态数据块。通过汇集动态数据块,能够对动态数据块数据进行统一处理,使得机器学习模型中的动态数据模式化,从而使得产生的机器学习模型具有通用性。
在一个实施例中,对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型。作为一种可选的实施方式,通用机器学习模型保存在离线文件中。具体的,离线文件中包括一种至多种通用机器学习模型。具体的,根据预先设定的规则,对离线文件中的通用机器学习模型进行调用。具体的,离线文件按照既定的规则存储在硬盘中。作为一种可选的实施方式,离线文件包括在线函数。具体的,在线函数存储在内存中。
在一个实施例中,所述对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型的步骤包括:根据所述任务指令获取静态数据布局信息、动态数据布局信息以及栈数据布局信息;根据所述静态数据布局信息对所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到所述连续的静态数据块;根据所述动态数据布局信息对对所述模型参数动态数据进行打包整合,得到连续的动态数据块;根据所述栈数据布局信息对所述模型参数栈数据进行打包整合,得到所述栈数据块;对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行整合。
在其中一个实施例中,对算法控制参数进行编译,得到各数据块布局信息。具体的,数据块布局信息用于数据块汇集整合,各数据块根据各数据块布局信息进行存放,以优化内存分配。作为一种可选的实施方式,数据块布局信息是对各数据块优先整块存储。作为一种可选的实施方式,当存储空间无法满足数据块整块存储时,根据处理器核的处理顺序对内存分配进行优化,使得读取数据块信息便捷。
在一个实施例中,通用机器学习模型生成方法进一步还包括生成硬件专用参数集。具体的,硬件专用参数集是指通过预先准备相关参数,弥补硬件不足,满足不同机器学习算法的运算需求。
在一个实施例中,请一并参阅图3,一种通用机器学习模型的生成装置,所述装置包 括:对外接口模块131000,用于获取机器学习任务的任务参数;分类处理模块132000,用于对所述任务参数进行分类处理,得到任务指令及模型参数;参数汇集模块133000,用于根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据;模型生成模块134000,用于将所述栈数据和堆数据进行整合,得到通用机器学习模型。
上述通用机器学习模型的生成装置,通过对任务参数进行分类处理,很好的兼容了各类机器学习算法的运算过程,并通过汇集及整合过程得到相应机器学习算法的通用模型。通过上述机器学习算法的通用模型,使得在算法运行中直接执行相应通用模型的编译结果,避免重复编译,从而大大提高机器学习算法实现的效率,缩短了从编译到得到执行结果的时间。
在一个实施例中,所述任务参数包括算法控制参数和计算参数;所述分类处理模块132000包括:任务指令生成模块132200,用于对所述算法控制参数进行编译,得到任务指令;模型参数生成模块132110,对所述计算参数进行分类处理,得到模型参数。
在一个实施例中,所述模型参数生成模块132100包括:模型参数栈数据生成模块32110,用于对可共享模型参数进行汇集,得到模型参数栈数据;模型参数堆数据生成模块132120,用于对所述不可共享模型参数进行汇集,得到模型参数堆数据。
在一个实施例中,所述模型参数生成模块还包括:预处理模块132121,用于对所述计算参数进行预处理,得到预处理模型数据;硬件参数生成模块132122,用于根据所述计算参数获取硬件参数;属性提取模块132123,用于提取所述计算参数中的数据属性参数。
在一个实施例中,所述任务指令包括任务指令堆数据;所述参数汇集模块133000包括:栈数据汇集器133100,用于对所述模型参数栈数据进行打包整合,得到栈数据块;模型参数动态数据汇集器133220,用于对所述模型参数动态数据进行打包整合,得到连续的动态数据块;模型参数静态数据汇集器133210,用于将所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到连续的静态数据块。
在一个实施例中,所述模型生成模块134000用于对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型。
关于通用机器学习模型生成装置的具体限定可以参见上文中对于通用机器学习模型生成方法的限定,在此不再赘述。上述通用机器学习模型装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,请一并参阅图4,提供了一种通用机器学习模型的执行方法。在一个实施例中,通用机器学习模型的执行方法包括:
步骤S1410,获取通用机器学习模型;
具体地,通用机器学习模型是按照上述通用机器学习模型的方法生成的通用机器学习模型。关于通用机器学习模型生成方法的具体说明参见上文,在此不再赘述。
步骤S1420,对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数据;
具体的,分类拆解的依据是根据数据类型的不同进行拆解。具体地,栈数据是指在多核开发平台中不可核间共享的数据,堆数据是指在多核开发平台中能够进行核间共享的数据。在一个实施例中,步骤S1420所述对所述通用机器学习模型进行分类拆解,得到栈数据和堆数据的步骤包括:步骤S14210,将所述通用机器学习模型中可共享的数据拆解为栈数据;步骤S14220,将所述通用机器学习模型中不可共享的数据拆解为堆数据。
在其中一个实施例中,所述方法还包括将所述栈数据分配到栈区;
具体的,栈区是指内存中主要存储栈数据的存储空间。可选的,栈区中存储的数据还包括机器学习运算过程中所产生的中间结果。
在其中一个实施例中,所述方法还包括将所述堆数据分配到堆区;
具体的,堆区是指内存中主要存储堆数据的存储空间。可选的,堆区中存储的数据还包括机器学习运算过程中所产生的中间结果。具体的,堆区数据包括存储在堆区的数据,例如堆数据以及各堆数据块布局信息。
步骤S1430,根据栈区数据、堆区数据以及输入数据进行计算,得到输出数据。具体的,步骤S1430的计算过程由硬件计算单元执行,在步骤S1403的步骤执行完毕后,神经网络处理器控制硬件计算单元关闭。具体的,硬件计算单元由算术逻辑单元、累加器、状态寄存器、通用寄存器组等组成。算术逻辑运算单元的基本功能为加、减、乘、除四则运算,与、或、非、异或等逻辑操作,以及移位、求补等操作。可以理解的,硬件计算单元通过取用栈区数据和堆区数据能够直接执行运算,不必等待机器学习算法编译完成。因此,通过通用机器学习模型能够提高机器学习算法的运算效率。
在一个实施例中,所述栈数据包括模型参数栈数据;
在其中一个实施例中,步骤S14230,将栈数据分配到栈区步骤还包括:
步骤S14231,获取所述模型参数栈数据所需占用空间的大小以及中间结果临时存储空间的大小。具体的,根据模型参数栈数据所需占用空间的大小以及中间结果临时存储空间的大小,为模型参数栈数据以及中间结果临时存储空间分配存储地址及存储空间。
步骤S14232,计算所述模型参数栈数据所需占用存储空间的大小与所述中间结果临时存储空间的大小之和,得到第一存储空间的大小。可以理解的,模型参数栈数据在机器学习运行过程中会产生中间结果,因此模型参数栈数据所需占用的存储空间与中间结果临时存储空间之和是内存分配给模型参数栈区的最小存储空间。
在一个实施例中,步骤S14233,分配所述模型参数栈区的存储空间,所述模型参数栈区的存储空间大于或等于所述第一存储空间的大小。具体的,模型参数栈区是指主要用于 存储模型参数栈数据的存储区。
在一个实施例中,将运行阶段变化的堆数据存储为模型参数动态堆数据,将运行阶段不变的堆数据存储为模型参数静态堆数据。关于模型参数栈数据和模型参数堆数据的具体说明参见上述关于通用模型生成方法中的相关内容,在此不再赘述。
在一个实施例中,步骤S14240,所述将所述堆数据分配到堆区的步骤还包括:步骤S14241,获取模型参数动态数据所需占用存储空间的大小;步骤S14242,将所述模型参数动态数据分配到模型参数动态堆区;步骤S14243,将所述模型参数静态数据分配到模型参数静态堆区。
在其中一个实施例中,步骤S14242,所述将所述模型参数动态数据分配到动态数据堆区的步骤还包括:
步骤S142421,将所述模型参数动态数据的存储空间与所述输入数据的存储空间与所述输出数据的存储空间相加,得到第二存储空间的大小;
步骤S142422,分配模型参数动态堆区的存储空间,所述模型参数动态堆区的存储空间大于或等于所述第二存储空间的大小。具体的,分配模型参数动态堆区的存储空间大于或等于所述第二存储空间的大小。通过步骤S142422的步骤,使得存储空间在保证正常运行的情况下获取更多的扩展性。
在一个实施例中,步骤S14240,所述将所述堆数据分配到堆区,得到堆区数据的步骤还包括:
将所述模型参数动态堆区、所述模型参数静态堆区分配到一段连续的存储空间,得到一个具有连续存储空间的堆区。在其中一个实施例中,所述堆区中的数据包括所述模型参数动态数据、所述模型参数静态数据以及所述输入数据、所述输出数据。
在一个实施例中,模型参数静态数据包括任务指令堆数据。具体的,任务指令堆数据是指能够进行核间共享的任务指令数据。
在一个实施例中,所述模型参数静态堆区的存储空间大于或等于所述模型参数静态堆数据的存储空间。具体的,模型参数静态堆区的存储空间大于或等于模型参数静态数据所需占用的存储空间大小。通过本实施例使得模型参数静态堆区在保证正常运行的情况下获取更多的扩展性。
在一个实施例中,所述根据所述栈区数据和所述堆区数据以及输入数据进行计算,得到输出数据的步骤还包括:待所述对所述输入数据计算完成,关闭硬件计算单元。具体的,关闭硬件计算单元有利于降低在机器学习运算过程中对计算机资源的占用。
在一个实施例中,所述根据所述栈区数据和所述堆区数据,对所述输入数据进行计算,得到输出数据的步骤还包括:在所述堆区提取所述输出数据;将所述输出数据传输至开发平台外部。在一个实施例中,将输入数据、输出数据存储于堆区。可以理解的,将输入数 据、输出数据存储于模型参数动态堆区。
在一个实施例中,请一并参阅图5,提供了一种通用机器学习模型的执行装置,所述装置包括:
模型获取模块15100,用于获取通用机器学习模型;
模型拆解模块15200,用于对所述通用机器学习模型进行分类拆解,得到栈数据和堆数据;
结果输出模块15400,获取栈区数据、堆区数据以及输入数据进行计算,得到输出数据。
在其中一个实施例中,所述栈区数据包括栈数据,所述堆区数据包括堆数据;所述模型拆解模块15200包括:
栈区数据分配模块15310,用于将所述通用机器学习模型中可共享的数据拆解为栈数据。可选的,栈区数据分配模块15310还用于将所述栈数据分配到栈区;
堆区数据分配模块15320,用于将所述堆数据分配到堆区。可选的,堆区数据分配模块15320还用于将所述通用机器学习模型中不可共享的数据拆解为堆数据。
在其中一个实施例中,所述栈数据模型参数栈数据。在其中一个实施例中,所述模型参数栈数据分配模块包括:第一存储空间计算模块,用于计算所述模型参数栈数据所需占用存储空间的大小与中间结果临时存储空间的大小之和,得到第一存储空间的大小;模型参数栈数据分配模块,分配所述模型参数栈区的存储空间,所述模型参数栈区的存储空间大于或等于所述第二存储空间的大小。
在其中一个实施例中,所述栈区数据包括栈数据,所述堆区数据包括堆数据;所述模型拆解模块15200包括:
栈区数据分配模块15310,用于将所述通用机器学习模型中不可共享的数据拆解为栈数据;堆区数据分配模块15320,用于将所述通用机器学习模型中可共享的数据拆解为堆数据。在其中一个实施例中,所述栈区数据分配模块15310还用于将所述栈数据分配到栈区。在其中一个实施例中,所述堆区数据分配模块15320还用于将所述堆数据分配到堆区。
在其中一个实施例中,所述栈数据包括模型参数栈数据;所述栈数据分配模块还用于将所述模型参数栈数据分配到模型参数栈区。
在其中一个实施例中,所述结果输出模块15400还包括:
数据提取模块15410,用于从所述堆区提取所述输出数据;
数据输出模块15420,用于输出所述输出数据。关于通用机器学习模型执行装置的具体限定可以参见上文中对于通用机器学习模型执行方法的限定,在此不再赘述。上述通用机器学习模型执行装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于 计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,请一并参阅图3、图6,其中图6提供了一个通过两层神经网络对jpg格式的图片进行特征提取的示意图。在一个实施例中,通过两层神经网络对图片进行提取的方法包括:
步骤S16100,对输入图片进行输入预处理操作,得到处理后的输入图片;
在一个实施例中,属性提取模块132123提取输入图片属性信息,例如输入图片的尺寸、数据格式、压缩格式信息,并将提取的属性信息传送至预处理层。具体的,输入预处理层6100根据输入图片的属性信息,将jpg压缩图片还原成未经压缩的原始图像,并为逐个数据点赋值,以便于卷积层16200对图像的处理。
步骤S16200,对所述处理后的输入图片进行卷积运算,得到卷积运算结果。
在一个实施例中,卷积层16200对图像信息进行特征提取。通用机器学习模型已经根据图6所示的机器学习算法运行平台的硬件信息生成了相对应的任务指令。当机器学习算法运行平台的相应硬件启动后,任务指令控制硬件逐步获取输入数据和权值数据做卷积运算,直到计算完成,得到中间结果。具体的,权值数据是在通用机器学习模型中已经训练完成的数据。在一个实施例中,中间结果临时空间的属性包括中间结果的属性,例如特征图的尺寸、占用的存储空间大小。具体的,根据中间结果临时空间的属性为中间结果申请合适的存储空间。
步骤S16300,对卷积运算结果进行激活,得到激活结果。
在一个实施例中,激活层16300选用sigmoid激活函数,对卷积结果做0-1之间的映射。具体的,通用机器学习模型已经根据图6所示的机器学习算法运行平台的硬件信息生成了相对应的任务指令。当机器学习算法运行平台的硬件启动后,任务指令控制相应硬件逐步获取输入数据和权值数据做激活运算。在其中一个实施例中,在执行本实施例中图片识别的机器学习算法运行平台缺少除法器,但sigmoid函数包含除法运算,则在硬件专用参数集中取用相应参数。在一个实施例中,硬件参数集中提前准备好需要除数的倒数。
在一个实施例中,在激活层16300进行激活运算时,由任务指令控制硬件获取进行激活运算的数据,以及在硬件专用参数集中获取参数数据。在一个实施例中,任务指令控制硬件进行卷积运算,直至卷积运算完成,得到输出数据。
步骤S16400,对激活结果进行输出预处理,得到最终图片。
在一个实施例中,输出预处理层16400根据图像预设的保存格式,对输出数据进行输出预处理操作。在一个实施例中,输出图片预设以jpg格式进行保存,则输出预处理层16400根据输出图片的预设格式对输出图片的尺寸、压缩格式、数据格式等进行处理,得到最终图片。
可以理解的是,虽然图2、图4以及图6的流程图中的各个步骤按照箭头的指示依次 显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2、图4中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储通用机器学习模型数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种通用机器学习模型的生成方法和/或通用机器学习模型执行方法。
本申请提供的通用机器学习模型文件生成方法,可以应用于如图1所示的应用环境中。本申请提供的通用机器学习模型的生成方法,可以应用于如图8所示的应用环境中。其中,图8所示的应用环境为机器学习开发平台,包括框架层2101、编译层2102、汇聚层2103、驱动层2104以及硬件层2105。
在其中一个实施例中,框架层2101用于提供机器学习任务的算法设计条件,为方便用户搭建自己的神经网络结构,提供便捷的训练和预测工具。可以理解的,框架层2101用于实现以下步骤:接收用户设计的机器学习算法(例如,神经网络结构);解析出每个子任务的参数,传递给编译层生成机器指令及相关必要元素;传递给运行时层执行计算,最终完成用户所需的机器学习任务。
在其中一个实施例中,编译层2102用于在机器学习任务中生成机器指令。具体的,编译层包括编译器、针对高频算子做特殊优化的高性能编程库以及其他能够生成机器指令的模块、装置以及数据库。可以理解的,编译层2102用于接收上层框架层2101传入的机器学习任务的参数,编译生成硬件的二进制机器指令,传递给下层的运行时层保存下来或执行计算。
在其中一个实施例中,汇聚层2103是对驱动程序做进一步封装的程序,可以屏蔽底层不同硬件和驱动的差异,向上层编译层2102或用户提供统一的程序接口。具体的,汇聚层103封装上层软件不需考虑硬件和驱动程序的细节。进一步的,汇聚层2103用于提供机器学习任务基本操作的程序接口,保存和加载机器学习模型及其在硬件上执行所需的机器指令等必要元素,使上层软件和用户只需要关注机器学习任务本身,而不必考虑具体硬件的 差异。可选地,汇聚层提供机器学习任务基本操作的程序接口包括内存空间分配、数据拷贝、启动计算以及其他机器学习任务基本操作的程序接口。
在其中一个实施例中,驱动层2104用于打包封装硬件层2105设备的基本操作,向上层汇聚层103提供可被调用的程序接口。具体地,驱动层2104的基本操作包括控制数据流的输入输出,向硬件发送控制信号,接收与处理硬件产生的异常信号,多任务的管理和调度等。
在其中一个实施例中,硬件层2105包括机器学习开发平台中的所有硬件设施。可选的硬件层2105包括主处理器、协处理器、存储器,输入输出设备,供电模块以及它们的连接设备。可以理解的,硬件层2105不限于上述器件。
在一个实施例中,请一并参阅图9、图10,提供了一种通用机器学习模型的生成方法及装置。在其中一个实施例中,步骤S2201,获取机器学习任务的任务参数。在其中一个实施例中,通过对外接口模块231000获取机器学习任务的任务参数。具体地,任务参数是生成通用机器学习模型所需要的参数,该参数包括除去输入数据、输出数据之外的参数。具体地,任务参数来自外部程序的输入,或者来自于用户的输入。可以理解的,当任务参数来自于用户的输入时,用户的输入数据需要经过格式转化才能生成任务参数。在其中一个实施例中,步骤S2202,对所述任务参数进行分类处理,生成任务指令及模型参数。在其中一个实施例中,通过模型参数生成模块232100生成模型参数,通过任务指令生成模块232200生成任务指令。具体的,任务指令是指经过编译处理的任务参数。模型参数是指机器学习算法运行过程中所需要对任务参数进行其他处理的处理结果。
在其中一个实施例中,步骤S2203,根据数据类型将所述任务指令及模型参数进行汇集,生成栈数据和堆数据。在其中一个实施例中,通过栈数据汇集器233100汇集不可共享的数据,通过堆数据汇集器233200汇集共享的数据。可以理解的,不可共享的数据是指在多核平台中,核间不共享的数据;共享的数据是指在多核平台中,核间共享的数据。具体地,汇集是指对任务指令及模型参数进行打包整理。在其中一个实施例中,步骤S2204,将所述栈数据和堆数据进行整合,生成通用机器学习模型。
在一个实施例中,请一并参阅图11,通用机器学习模型文件生成方法,包括:
步骤S2402,获取通用机器学习模型。可选地,通用机器学习模型可以是前述通过步骤S2201-步骤S2204生成的通用机器学习模型,还可以是其他模型文件。
步骤S2404,计算所述通用机器学习模型的存储偏移量。具体地,通用机器学习模型可以是一个,也可以是多个。在其中一个实施例中,当通用机器学习模型为多个时,计算每个通用机器学习模型的存储偏移量。
步骤S2406,根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成模型目录。其中,模型目录是通用机器学习模型文件中所有模型存放位置的记录,通过 模型目录,可以快速索引到目标模型。
步骤S2408,根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件。本实施例中的通用机器学习模型文件中不仅包括通用机器学习模型本身,还包括模型目录,使得在调用通用机器学习模型文件中的通用机器学习模型时,快速定位和读取对应的模型。
上述通用机器学习模型文件生成方法,通过生成关于获取的通用机器模型的目录,并根据通用机器学习模型以及模型目录生成通用机器学习模型文件。实现了在机器学习运算过程中,根据运算需要直接在通用机器学习模型文件中读取对应的通用模型,避免重复编译,从而大大提高机器学习算法实现的效率,缩短了从编译到生成执行结果的时间。
在一个实施例中,请一并参阅图12,步骤S2404计算所述通用机器学习模型的存储偏移量的步骤包括:
步骤S24041,获取每个所述通用机器学习模型占用的存储空间大小和所述通用机器学习模型的数量。在其中一个实施例中,根据每个所述通用机器学习模型占用的存储空间大小和所述通用机器学习模型的数量,生成通用机器学习模型文件所要占用的存储空间大小。
步骤S24042,获取所述通用机器学习模型的存放顺序。具体地,通用机器学习模型的存放顺序可以遵循预设规则,也可以随机生成存放顺序。具体地,通用机器学习模型的存放顺序确定后,通用机器学习模型即按照确定的存放顺序进行存放。
步骤S24043,根据每个所述通用机器学习模型占用的存储空间大小、所述通用机器学习模型的数量、所述通用机器学习模型的存放顺序,计算每个所述通用机器学习模型的存储偏移量。其中,存储偏移量是指每个通用机器学习模型在通用机器学习模型文件中的存储的相对位置。例如模型A、模型B与模型C依次从文件头到文件尾存储,模型A的大小为2比特,模型B的大小为3比特,模型C的大小为1比特,则模型A的偏移量为0,模型B的偏移量为2比特,模型C的偏移量为2+3=5比特。
在其中一个实施例中,请一并参阅图13,步骤S2408根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件包括:
步骤S2408a,获取所述通用机器学习模型文件的文件头和文件尾;
步骤S2408b,根据所述文件头、所述模型目录、所述通用机器学习模型以及所述文件尾,生成所述通用机器学习模型文件。其中,所述文件头是指位于通用机器学习模型文件开头的一段承担一定任务的数据,所述文件尾是指位于通用机器学习模型尾部的一段承担一定任务的数据。
在另一个实施例中,请一并参阅图14,步骤S2408根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件包括:
步骤S2408c,创建通用机器学习模型文件的标识码。具体地,通用机器学习模型文件 的标识码是指通用机器学习模型文件附带的起标识作用的字符,通过文件的标识码可以将不同的通用机器学习模型文件区分开,便于准确获取对应的通用机器学习模型文件。步骤S2408d根据所述标识码、所述通用机器学习模型、所述模型目录,生成通用机器学习模型文件。在其中一个实施例中,通用机器学习模型文件的标识码存放在文件头。
在再一个实施例中,请一并参阅图15,步骤S2408根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件,包括:
步骤S2408e创建所述通用机器学习模型文件的校验码和/或纠错码。其中,校验码由通用机器学习模型文件中的运算得出,用以检验该通用机器学习模型文件的正确性。在其中一个实施例中,校验码位于一个通用机器学习模型文件中的最后一位,其中,纠错码是指文件接收端,能够发现通用机器学习模型文件在传输过程中出现的错误,并进行纠正的一串字符。
通过本实施例的步骤,增加了通用机器学习模型文件接收的安全性和稳定性。当在传输过程中发送传输错误时,能够及时通过校验码发现错误,以及通过纠错码纠正错误,增加了数据的稳定性和容错性,防止因接收错误导致后续流程的相应出错。
步骤S2408f,根据所述通用机器学习模型文件的校验码和/或纠错码、所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件。在其中一个实施例中,校验码和/纠错码存储在通用机器学习模型中的文件尾。
在一个实施例中,请一并参阅图16,步骤S2408根据所述通用机器学习模型以及所述模型目录,生成通用机器学习模型文件还包括:
步骤S24081,计算所述通用机器学习模型文件所需占用的存储空间的大小。
在其中一个实施例中,通用机器学习模型文件包括一个或多个通用机器学习模型。在另一个实施例中,通用机器学习模型文件还包括文件头、文件尾、模型目录。可选地,通用机器学习文件还可以包括模型目录的存储空间大小以及多个通用机器学习模型的存储空间大小的总和。可选地,通用机器学习文件还可以包括文件头的存储空间大小、文件尾的存储空间大小、模型目录的存储空间大小以及多个通用机器学习模型的存储空间大小的总和。
步骤S24082,根据所述通用机器学习模型、所述通用机器学习模型文件所需占用的存储空间的大小以及所述模型目录,生成通用机器学习模型文件。在其中一个实施例中,通用机器学习模型文件模型目录、通用机器学习模型依次由文件头部到文件尾部存放。
在一个实施例中,请一并参阅图17,提供了另一种通用机器学习模型生成方法,包括:步骤S2501,获取通用机器学习模型;步骤S2502,对所述通用机器学习模型进行存储优化处理,生成二级模型;步骤S2503,计算所述二级模型的存储偏移量;步骤S2504,根据所述二级模型以及所述二级模型存储偏移量,生成二级模型目录;步骤S2505,根据所述二 级模型以及所述二级模型目录,生成通用机器学习模型文件。
步骤S2501与上述实施例中步骤S2402的执行过程相同,在此不再赘述。另外,步骤S2503与步骤S2404,步骤S2504与步骤S2406、步骤S2505与步骤S2408的区别在于执行对象不同,即步骤S2503、步骤S2504以及步骤S2505的执行对象是二级模型,步骤S2404、步骤S2406以及步骤S2408的执行对象是通用机器学习模型,两个实施例中上述对应步骤执行过程一致,在此不再赘述。
通过步骤S2501-步骤S2505的方法,将原始生成的通用机器学习模型进行优化处理,便于通用机器学习模型文件的存放和传输,增加了传输过程中的安全性和稳定性。
在其中一个实施例中,步骤S2502,对所述通用机器学习模型进行存储优化处理,生成二级模型的步骤包括:对所述通用机器学习模型进行压缩处理,生成二级模型。通过本实施例中将通用机器学习模型进行压缩,便于通用机器学习模型在通用机器学习模型文件中存储,进而便于在执行对应通用机器学习模型时快速获取对应的通用机器学习模型。
在另一个实施例中,步骤S2502,对所述通用机器学习模型进行存储优化处理,生成二级模型的步骤还包括:对所述通用机器学习模型进加密处理,生成二级模型。通过本实施例中将通用机器学习模型进行加密,能够增加通用机器学习模型在存储和传输过程中的安全性。
在其中一个实施例中,所述根据所述二级模型以及所述二级模型目录,生成机器学习二级模型文件,包括:
获取所述机器学习二级模型文件的文件头和文件尾;
根据所述文件头、所述二级模型目录、所述通用机器学习模型以及所述文件尾,生成所述机器学习二级模型文件。
在其中一个实施例中,所述计算所述二级模型的存储偏移量的步骤包括:
获取每个所述通用机器学习模型占用的存储空间大小和所述二级模型的数量;
获取所述二级模型的存放顺序;
根据每个所述二级模型占用的存储空间大小、所述二级模型的数量、所述二级模型的存放顺序,计算每个所述二级模型的存储偏移量。
在其中一个实施例中,所述根据所述通用机器学习模型以及所述模型目录,生成机器学习二级模型文件,包括:
创建机器学习二级模型文件的标识码;
根据所述模型文件的标识码、所述二级模型、所述二级模型目录,生成机器学习二级模型文件。
在其中一个实施例中,所述根据所述二级模型以及所述模型目录,生成机器学习二级模型文件,包括:
创建所述机器学习二级模型文件的校验码和/或纠错码;根据所述机器学习二级模型文件的校验码和/或纠错码、所述二级模型以及所述二级模型目录,生成机器学习二级模型文件。
一种通用机器学习模型文件生成方法,所述方法包括:
获取机器学习任务的任务参数;
对所述任务参数进行分类,生成任务指令及模型参数;
根据数据类型将所述任务指令及模型参数进行汇集,生成栈数据和堆数据;
将所述栈数据和堆数据进行整合,生成通用机器学习模型;
对所述通用机器学习模型进行存储优化处理,生成所述二级模型;计算所述二级模型的存储偏移量;
根据所述二级模型以及所述二级模型存储偏移量,生成二级模型目录;
根据所述二级模型、所述模型目录,生成机器学习二级模型文件。
在又一个实施例中,请一并参阅图18,提供了又一种通用机器学习模型生成方法,包括:
步骤S2601,获取机器学习任务的任务参数。具体地,任务参数是生成通用机器学习模型所需要的参数,该参数包括除去输入数据、输出数据之外的参数。具体地,任务参数来自外部程序的输入,或者来自于用户的输入。可以理解的,当任务参数来自于用户的输入时,用户的输入数据需要经过格式转化才能生成任务参数。
步骤S2602,对所述任务参数进行分类处理,生成任务指令及模型参数。具体的,任务指令是指经过编译处理的任务参数。模型参数是指机器学习算法运行过程中所需要对任务参数进行其他处理的处理结果。
步骤S2603,根据数据类型将所述任务指令及模型参数进行汇集,生成栈数据和堆数据。可以理解的,不可共享的数据是指在多核平台中,核间不共享的数据;共享的数据是指在多核平台中,核间共享的数据。具体地,汇集是指对任务指令及模型参数进行打包整理。
步骤S2604,将所述栈数据和堆数据进行整合,生成通用机器学习模型。具体的,通用机器学习模型具有良好的通用性。在其中一个实施例中,通用机器学习模型既兼容上层的不同框架,例如兼容上层的框架层2101、编译层2102以及汇聚层2103;又能兼容下层的不同驱动层和硬件。进一步的,当一个通用机器学习模型形成之后,能够根据不同的运算核数量、输入数据的地址、输出数据的地址以及其他通用机器学习模型调整数据块,以适应不同的情况。
步骤S2605,计算所述通用机器学习模型的存储偏移量;步骤S2606,根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成模型目录;步骤S2607,根据所述通用机器学习模型、所述模型目录,生成通用机器学习模型文件。本实施例中的步骤 S2605、步骤S2606、步骤S2607与上述实施例中的步骤S2405、步骤S2406、步骤S2408的执行过程相同,在此不再赘述。
在一个实施例中,请一并参阅图13,提供了一种通用机器学习模型文件生成装置,包括:模型填充器2701、目录生成器2702以及文件生成器2703;所述模型填充器2701和所述目录生成器2702相连,所述文件生成器2703分别与所述模型填充器2701、所述目录生成器2702相连。具体地,所述模型填充器2701用于获取所述通用机器学习模型;
所述目录生成器2702用于计算所述通用机器学习模型的存储偏移量;以及
根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成模型目录;
所述文件生成器2703用于根据所述通用机器学习模型、所述模型目录,生成通用机器学习模型文件。
在一个实施例中,所述模型填充器2701还用于将所述通用机器学习模型,按序存入所述文件生成器。
在一个实施例中,所述文件生成器2703还包括文件头生成器27031和所述文件尾生成器27032;所述文件头生成器27031与所述目录生成器2702相连,所述文件尾生成器27032与所述模型填充器2701相连。在其中一个实施例中,所述文件头生成器27031还用于创建通用机器学习模型文件的标识码,以及根据所述标识码、所述通用机器学习模型、所述模型目录,生成通用机器学习模型文件。
在一个实施例中,所述文件尾生成器27032还用于创建所述通用机器学习模型文件的校验码和/或纠错码。
在一个实施例中,所述生成装置还包括模型存储优化器2704,所述模型存储优化器2704与所述模型填充器2701相连和所述目录生成器相连,用于对所述通用机器学习模型进行存储优化处理,生成二级模型。在其中一个实施例中,二级模型填充器用于接收所述二级模型,并将所述二级模型按序存入所述文件生成器。
在一个实施例中,所述生成装置还包括文件大小计算器2705,所述文件大小计算器2705与所述目录生成器2702连接,用于计算所述通用机器学习模型占用的存储空间大小,以及计算所述通用机器学习模型文件所需占用的存储空间的大小。
在其中一个实施例中,所述文件大小计算器2705与模型存储优化器2704相连。具体的,上述实施例中的连接关系包括电连接或无线连接。
在一个实施例中,一种通用机器学习模型文件生成装置,请一并参阅图20,所述生成装置包括:
对外接口模块2801,用于获取机器学习任务的任务参数;
分类处理模块2802,用于对所述任务参数进行分类处理,生成任务指令及模型参数;
参数汇集模块2803,用于根据数据类型将所述任务指令及模型参数进行汇集,生成栈 数据和堆数据;
模型生成模块2804,用于将所述栈数据和堆数据进行整合,生成通用机器学习模型;
存储偏移量计算模块2805,用于计算所述通用机器学习模型的存储偏移量;
模型目录生成模块2806,用于根据所述通用机器学习模型以及所述通用机器学习模型存储偏移量,生成模型目录;
模型文件生成模块2807,用于根据所述通用机器学习模型、所述模型目录,生成通用机器学习模型文件。
在其中一个实施例中,请一并参阅图20,通用机器学习模型生成装置与通用机器学习模型文件生成装置相连,所述通用机器学习模型文件生成装置用于将通用机器学习模型生成装置中生成的通用机器学习模型转化为通用机器学习模型文件。
关于通用机器学习模型文件生成装置的具体限定可以参见上文中对于通用机器学习模型文件生成方法的限定,在此不再赘述。上述通用机器学习模型文件生成装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,请一并参阅图21,提供了一种通用机器学习模型文件解析方法,包括:
步骤S2701,获取通用机器学习模型文件。其中,通用机器学习模型文件包括通过步骤S2402步骤S2408生成的模型文件。进一步地,通用机器学习文件中的通用机器学习模型包括通过步骤S2201-步骤S2204生成的通用机器学习模型。
步骤S2702,在所述通用机器学习模型文件中读取模型目录。具体地,模型目录包括通过上述步骤S2406生成的模型目录。
步骤S2703,根据所述模型目录,读取目标通用机器学习模型。其中,所述目标通用机器学习模型是指在通用机器学习模型文件中所要取出的通用机器学习模型。目标通用机器学习模型可以根据用户操作指令确定,还可以根据任务执行需要确定。
在一个实施例中,请一并参阅图15,步骤S2701,获取通用机器学习模型文件包括:
步骤S27011,获取所述通用机器学习模型文件的标识码。具体地,通用机器学习模型文件的标识码可以位于通用机器学习模型文件头,以方便对通用机器学习模型文件进行识别。具体地,通用机器学习模型文件的标识码是指通用机器学习模型文件附带的起标识作用的字符,通过识别文件的标识码可以将不同的通用机器学习模型文件区分开,便于准确获取对应的通用机器学习模型文件。进一步地,标识码可以是通过上述步骤S408c创建的通用机器学习模型文件的标识码。
步骤S27012,检测所述标识码是否符合预设规则。在其中一个实施例中,预设规则是 指在读取对应的通用机器学习模型文件之前,获取的通用机器学习模型文件的标识码的描述信息。进一步地,在获取到通用机器学习模型文件之后,检测通用机器学习模型文件的标识码与描述信息是否相匹配,若匹配,则判断标识码符合预设规则,若不匹配则判断标识码符合预设规则。
步骤S27013,若所述标识码符合预设规则,则在所述通用机器学习模型文件中读取模型目录。具体地,若所述标识码符合预设规则,则可以判断所述通用机器学习模型文件在传输过程中没有发生异常。
在另一个实施例中,若标识码不符合预设规则,则获取的通用机器学习模型文件与要读取的通用机器学习模型文件不一致。具体地,若标识码不符合预设规则,则判断读取的通用机器学习模型文件发生异常,则所述通用机器学习模型文件解析方法停止执行。
在一个实施例中,请一并参阅图23,步骤S2701,获取通用机器学习模型文件包括:
步骤S27014,获取所述通用机器学习模型文件的校验码。具体地,若标识码合法,则获取到的通用机器学习模型文件无误,进一步检测获取到的通用机器学习模型文件的校验码,以判断通用机器学习模型文件的内容是否无误。
步骤S27015,校验所述校验码与预设标准码是否一致,若所述校验码与预设标准码不一致,则执行纠错运算。其中,预设标准码与通用机器学习模型文件内容无误时的校验码一致。进一步地,若所得的校验码与预设标准码一致,则可以判断通用机器学习模型文件的内容无误,反之,若所得的校验码与预设标准码不一致,则可以判断通用机器学习模型文件内容有误。可选地,若通用机器学习模型文件有误,产生错误的原因可以是原始文件有误,还可以是原始文件无误但是在传输过程中发生错误。
在一个实施例中,请一并参阅图24,步骤S27015校验所述校验码与预设标准码是否一致,若所述校验码与预设标准码不一致,则执行纠错运算包括:
步骤S27015a,获取纠错码。其中,纠错码可以是通过上述步骤S2408e得到的纠错码。具体地,错码是指文件接收端,能够发现通用机器学习模型文件在传输过程中出现的错误,并进行纠正的一串字符。
步骤S27015b,根据所述纠错码对所述通用机器学习模型文件进行纠错,得到纠错后的模型文件。具体地,当文件校验码与预设标准码不一致时,判断通用机器学习模型文件内容出错后根据文件纠错码对通用机器学习模型进行纠错。具体地,纠错码可以位于通用机器学习模型文件的文件尾。
步骤S27015c,校验所述纠错后的模型文件的校验码与所述预设标准码是否一致。具体地,在纠错完成后,再次校验纠错后的模型文件的校验码是否与预设标准码一致,以检测纠错效果。
步骤S27015d,若所述纠错后的通用机器学习模型文件的校验码与所述预设标准码一 致,则在所述通用机器学习模型文件中读取模型目录。可以理解地,若纠错后的通用机器学习模型文件的校验码与预设标准码一致,则可判断纠错后的通用机器学习模型已经无误。
在另一个实施例中,所述通用机器学习模型文件解析方法还包括:若所述纠错后的通用机器学习模型文件的校验码与所述预设标准码不一致,则所述方法停止执行。可以理解地,纠错后的通用机器学习模型文件的校验码与预设标准码仍不一致,则可判断纠错失败,纠错后的通用机器学习模型仍有误。
在一个实施例中,请一并参阅图25,步骤S2703,根据所述模型目录,读取目标通用机器学习模型包括:
步骤S27031,获取目标通用机器学习模型的在所述通用机器学习模型文件中的存储偏移量。其中,存储偏移量是指每个通用机器学习模型在通用机器学习模型文件中的存储的相对位置。例如模型A、模型B与模型C依次从文件头到文件尾存储,模型A的大小为2比特,模型B的大小为3比特,模型C的大小为1比特,则模型A的偏移量为0,模型B的偏移量为2比特,模型C的偏移量为2+3=5比特。
步骤S27032,根据所述存储偏移量,读取所述目标通用机器学习模型。在其中一个实施例中,根据存储偏移量,得到目标通用机器学习模型在目标通用机器学习模型文件的位置,进一步地根据目标通用机器学习模型文件的位置读取目标通用机器学习模型。
在一个实施例中,请一并参阅图26,提供了一种通用机器学习模型文件解析方法,包括:
步骤S2801,获取通用机器学习模型文件。具体地,步骤S2801的执行过程与上述步骤S2701的步骤相同,在此不再赘述。
步骤S2802,在所述通用机器学习模型文件中读取二级模型目录。具体地,在本实施例中通用机器学习模型文件中存储的是二级模型文件。具体地,本实施例中的二级模型以及二级模型目录可以上述通过步骤S2501-步骤S2505生成。
步骤S2803,根据所述二级模型目录,读取目标二级模型。在其中一个实施例中,获取目标二级模型的在所述通用机器学习模型文件中的存储偏移量;根据所述存储偏移量,读取所述目标二级模型。其中,目标二级模型是指在通用机器学习模型文件中所要取出的通用机器学习模型。
步骤S2804,对所述目标二级模型进行还原得到目标通用机器学习模型。具体地,二级模型是经过存储优化处理的通用机器学习模型。在其中一个实施例中,根据存储优化处理的操作对二级模型进行还原。例如,若存储优化处理是加密,则还原操作是对二级模型进行解密;又例如,若存储优化处理是压缩,则还原操作是对二级模型进行解压缩。可以理解地,若存储优化处理是加密以及压缩,则还原操作是解密以及解压缩。
在一个实施例中,请一并参阅图27,通用机器学习模型文件解析方法还包括:
步骤S2901,读取所述通用机器学习模型中的硬件参数信息。具体地,硬件参数信息是指,执行通用机器学习模型时所需要的硬件信息。
步骤S2902,根据所述硬件参数信息,生成硬件匹配信息。具体地,根据硬件参数信息,在设备池中匹配符合硬件参数信息的硬件。在其中一个实施例中,设备池可以是不同硬件平台中的设备,通过在设备池中匹配硬件参数信息使得通用机器学习模型的解析过程或执行过程能够跨平台实现。例如,根据硬件参数信息一个通用机器学习模型文件需要一个CPU和一个GPU实现,但是本平台中无GPU只有一个CPU,那么在设备池中寻找另一个平台中有GPU,则连接设备池中不同平台中的硬件设备以完成该通用机器学习模型的执行。
在一个实施例中,请一并参阅图22,通用机器学习模型文件解析方法还包括:
步骤S2903,对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数据。具体的,分类拆解的依据是根据数据类型的不同进行拆解。具体地,栈数据是指在多核开发平台中不可核间共享的数据,堆数据是指在多核开发平台中能够进行核间共享的数据。在一个实施例中,步骤S2903所述对所述通用机器学习模型进行分类拆解,得到栈数据和堆数据的步骤包括:步骤S29031,将所述通用机器学习模型中可共享的数据拆解为栈数据;步骤S29032,将所述通用机器学习模型中不可共享的数据拆解为堆数据。
步骤S2904,根据所述栈区数据、所述堆区数据以及输入数据计算,得到输出数据。在其中一个实施例中,所述方法还包括将所述栈数据分配到栈区;
具体的,栈区是指内存中主要存储栈数据的存储空间。可选的,栈区中存储的数据还包括机器学习运算过程中所产生的中间结果。在其中一个实施例中,所述方法还包括将所述堆数据分配到堆区;具体的,堆区是指内存中主要存储堆数据的存储空间。可选的堆区中存储的数据还包括机器学习运算过程中所产生的中间结果。具体的,堆区数据包括存储在堆区的数据,例如堆数据以及各堆数据块布局信息。
应该理解的是,虽然图9、图11-18以及图21-28的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图9、图11-18以及图21-28中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,请一并参阅图29,提供了一种通用机器学习模型文件解析装置,包括:
文件获取器2901,目录解析器2902以及模型读取器2903;所述目录解析器2902分别与所述文件获取器2901、以及所述模型读取器2903相连;
所述文件获取器2901,用于获取通用机器学习模型文件;
所述目录解析器2902,用于在所述通用机器学习模型文件中读取模型目录;
所述模型读取器2903,用于根据所述模型目录,读取目标通用机器学习模型。
在一个实施例中,所述文件获取器2901包括文件头校验器29011;
所述文件头校验器29011用于获取所述通用机器学习模型文件的标识码;并检测所述标识码是否符合预设规则;若所述文件头中的标识码合法,则在所述通用机器学习模型文件中读取模型目录;所述文件头校验器还用于:
获取所述通用机器学习模型文件的校验码;以及校验所述校验码与预设标准码是否一致,若所述校验码与预设标准码不一致,则执行纠错运算。
在一个实施例中,所述文件获取器2901还包括文件尾纠正器29012;
所述文件尾纠正器29012用于获取所述文件尾的纠错码;还用于根据所述纠错码对所述通用机器学习模型文件进行纠错,得到纠错后的模型文件;以及用于校验所述纠错后的模型文件的校验码与所述预设标准码预生成的校验码是否一致;若所述纠错后的模型文件的校验码与所述预设标准码一致预生成的校验码一致,则在所述通用机器学习模型文件中读取模型目录。
在其中一个实施例中,所述文件尾纠正器29012还用于若所述纠错后的模型文件的校验码与所述预设标准码不一致,则所述方法停止执行。
在一个实施例中,所述模型读取器2903还具体用于获取目标通用机器学习模型的在所述通用机器学习模型文件中的偏移量;以及根据所述偏移量,读取所述目标通用机器学习模型。
在一个实施例中,所述通用机器学习模型文件解析装置还包括模型分发器2904,所述模型分发器2904与所述目录解析器2902相连。在其中一个实施例中,所述模型分发器2904用于在所述通用机器学习模型文件中读取二级模型目录;并根据所述二级模型目录,读取目标二级模型;并对所述目标二级模型进行解析,得到通用机器学习模型。
在一个实施例中,所述通用机器学习模型文件解析装置还包括硬件匹配器2905,所述硬件匹配器2905与所述模型读取器2903相连;所述硬件匹配器用于读取所述通用机器学习模型中的硬件参数信息;以及用于根据所述硬件参数信息,在设备池中匹配对应硬件。
在一个实施例中,所述通用机器学习模型文件解析装置与所述通用机器学习执行装置29100相连,请一并参阅图30,所述通用机器学习执行装置包括:
模型获取器29101,用于获取通用机器学习模型;
模型拆解器29102,用于对所述通用机器学习模型进行分类拆解,得到栈区数据和堆区数据;
结果输出器29103,用于获取所述栈区数据和所述堆区数据、以及输入数据进行计算, 得到输出数据。
关于通用机器学习模型文件解析装置的具体限定可以参见上文中对于通用机器学习模型文件解析方法的限定,在此不再赘述。上述通用机器学习模型文件生成装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图31所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时实现一种通用机器学习模型文件生成方法和/或通用机器学习模型文件解析方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图31中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以上任一实施例所提供方法的步骤。
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以上任一实施例中所提供的方法的步骤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线 动态RAM(RDRAM)等。
本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (21)

  1. 一种通用机器学习模型的生成方法,所述方法包括:
    获取机器学习任务的任务参数;
    对所述任务参数进行分类处理,得到任务指令及模型参数;
    根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据;
    将所述栈数据和堆数据进行整合,得到通用机器学习模型。
  2. 根据权利要求1所述的方法,其特征在于,所述任务参数包括算法控制参数和计算参数;
    所述对所述任务参数进行分类处理,得到任务指令及模型参数的步骤包括:
    对所述算法控制参数进行编译,得到任务指令;
    对所述计算参数进行分类处理,得到模型参数。
  3. 根据权利要求2所述的方法,其特征在于,所述对所述计算参数进行分类处理,得到模型参数的步骤包括:
    对所述计算参数进行预处理,得到预处理模型数据;
    根据所述计算参数获取硬件参数;
    提取所述计算参数中的数据属性参数。
  4. 根据权利要求3所述的方法,其特征在于,所述根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据的步骤包括:
    对所述任务指令进行分类处理,得到任务指令堆数据;
    根据所述数据类型对模型参数进行分类处理,得到模型参数栈数据及模型参数堆数据;
    对所述模型参数栈数据进行汇集,得到所述栈数据;
    对所述模型参数堆数据和任务指令堆数据进行汇集,得到所述堆数据。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述数据类型对模型参数进行分类处理,得到模型参数栈数据及模型参数堆数据的步骤包括:
    根据共享属性对所述模型参数进行分类,得到可共享模型参数及不可共享模型参数;
    对可共享模型参数进行汇集,得到模型参数堆数据;
    对所述不可共享模型参数进行汇集,得到模型参数栈数据。
  6. 根据权利要求4所述的方法,其特征在于,所述模型参数堆数据包括模型参数静态数据和模型参数动态数据;
    所述将所述栈数据和堆数据进行整合,得到通用机器学习模型的步骤包括:
    将所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到连续的静态数据块;
    对所述模型参数动态数据进行打包整合,得到连续的动态数据块;
    对所述模型参数栈数据进行打包整合,得到栈数据块;
    对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型。
  7. 根据权利要求6所述的方法,其特征在于,所述对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型的步骤包括:
    根据所述任务指令获取静态数据布局信息、动态数据布局信息以及栈数据布局信息;
    根据所述静态数据布局信息对所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到所述连续的静态数据块;
    根据所述动态数据布局信息对所述模型参数动态数据进行打包整合,得到连续的动态数据块;
    根据所述栈数据布局信息对所述模型参数栈数据进行打包整合,得到所述栈数据块;
    对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行整合。
  8. 根据权利要求7所述的方法,其特征在于,所述提取所述计算参数中的数据属性参数的步骤包括:
    获取计算参数的输入数据属性、输出数据属性及中间结果临时空间属性;
    在所述输入数据的属性中提取所述输入数据的数据量,并分配所述输入数据存储空间;
    在所述输出数据的属性中提取所述输出数据的数据量,并分配所述输出数据存储空间;
    在所述中间结果临时空间属性中提取中间结果临时空间的数据量,并分配所述中间结果临时存储空间;
    将所述输入数据存储空间及输出数据存储空间存储为堆数据,将所述中间结果临时空间存储为栈数据。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述栈数据布局信息对所述模型参数栈数据进行打包整合,得到所述栈数据块的步骤包括:
    根据所述栈数据布局信息对所述不可共享模型参数、所述中间结果临时空间数据进行整合,得到所述栈数据块。
  10. 根据权利要求9所述的方法,其特征在于,所述根据所述计算参数获取硬件参数的步骤包括:
    获取硬件平台信息以及硬件配置参数并存储为堆数据。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述静态数据布局信息对所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到所述连续的静态数据块的步骤包括:
    根据所述静态数据布局信息,对所述任务指令堆数据、模型参数堆数据、硬件平台信 息以及硬件配置参数进行整合,得到所述连续的静态数据块。
  12. 根据权利要求8所述的方法,其特征在于,所述根据所述动态数据布局信息对所述模型参数动态数据进行打包整合,得到连续的动态数据块的步骤包括:
    根据所述动态数据布局信息对所述输入数据存储空间以及所述输出数据存储空间进行整合,得到所述连续的动态数据块。
  13. 一种通用机器学习模型的生成装置,其特征在于,所述装置包括:
    对外接口模块,用于获取机器学习任务的任务参数;
    分类处理模块,用于对所述任务参数进行分类处理,得到任务指令及模型参数;
    参数汇集模块,用于根据数据类型将所述任务指令及模型参数进行汇集,得到栈数据和堆数据;
    模型生成模块,用于将所述栈数据和堆数据进行整合,得到通用机器学习模型。
  14. 根据权利要求13所述的装置,其特征在于,所述任务参数包括算法控制参数和计算参数;
    所述分类处理模块包括:
    任务指令生成模块,用于对所述算法控制参数进行编译,得到任务指令;
    模型参数生成模块,对所述计算参数进行分类处理,得到模型参数。
  15. 根据权利要求14所述的装置,其特征在于,所述模型参数生成模块包括:
    模型参数栈数据生成模块,用于对可共享模型参数进行汇集,得到模型参数栈数据;
    模型参数堆数据生成模块,用于对所述不可共享模型参数进行汇集,得到模型参数堆数据。
  16. 根据权利要求15所述的装置,其特征在于,所述模型参数堆数据生成模块包括:
    模型参数静态数据生成模块,用于对静态的所述模型参数堆数据进行汇集,得到模型参数静态数据;
    模型参数动态数据生成模块,用于对动态的所述模型参数堆数据进行汇集,得到模型参数动态数据。
  17. 根据权利要求15所述的装置,其特征在于,所述模型参数生成模块还包括:
    预处理模块,用于对所述计算参数进行预处理,得到预处理模型数据;
    硬件参数生成模块,用于根据所述计算参数获取硬件参数;
    属性提取模块,用于提取所述计算参数中的数据属性参数。
  18. 根据权利要求17所述的装置,其特征在于,所述任务指令包括任务指令堆数据;所述参数汇集器包括:
    栈数据汇集器,用于对所述模型参数栈数据进行打包整合,得到栈数据块;
    模型参数动态数据汇集器,用于对所述模型参数动态数据进行打包整合,得到连续的 动态数据块;
    模型参数静态数据汇集器,用于将所述任务指令堆数据与所述模型参数静态数据进行打包整合,得到连续的静态数据块。
  19. 根据权利要求18所述的装置,其特征在于,所述模型生成模块用于对所述连续的静态数据块、所述连续的动态数据块以及栈数据块进行合并,得到通用机器学习模型。
  20. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至12中任一项所述方法的步骤。
  21. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至12中任一项所述的方法的步骤。
PCT/CN2019/085853 2018-06-08 2019-05-07 通用机器学习模型、模型文件的生成和解析方法 WO2019233231A1 (zh)

Priority Applications (10)

Application Number Priority Date Filing Date Title
EP19815956.8A EP3751477A4 (en) 2018-06-08 2019-05-07 GENERAL AUTOMATIC LEARNING MODEL, AND MODEL FILE PRODUCTION AND ANALYSIS METHOD
JP2019554861A JP7386706B2 (ja) 2018-06-08 2019-05-07 汎用機械学習モデル、モデルファイルの生成および解析方法
KR1020197029038A KR20210017985A (ko) 2018-06-08 2019-05-07 범용 기계학습 모델, 모델 파일의 생성 및 분석방법
US16/975,082 US11334329B2 (en) 2018-06-08 2019-05-07 General machine learning model, and model file generation and parsing method
US17/130,370 US11334330B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,393 US11403080B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,300 US11379199B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,469 US11036480B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,348 US11307836B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/849,650 US11726754B2 (en) 2018-06-08 2022-06-26 General machine learning model, and model file generation and parsing method

Applications Claiming Priority (12)

Application Number Priority Date Filing Date Title
CN201810589390.9 2018-06-08
CN201810588623.3A CN110647996B (zh) 2018-06-08 2018-06-08 通用机器学习模型的执行方法、装置和存储介质
CN201810589390.9A CN110580527B (zh) 2018-06-08 2018-06-08 通用机器学习模型的生成方法、装置和存储介质
CN201810588623.3 2018-06-08
CN201811459679.5 2018-11-30
CN201811457719.2A CN111260018B (zh) 2018-11-30 2018-11-30 机器学习二级模型文件生成方法、装置、存储介质
CN201811457719.2 2018-11-30
CN201811456246.4A CN111258584B (zh) 2018-11-30 2018-11-30 通用机器学习二级模型文件解析方法、装置、存储介质
CN201811459853.6 2018-11-30
CN201811459853.6A CN111260071B (zh) 2018-11-30 2018-11-30 通用机器学习模型文件解析方法、装置、存储介质
CN201811459679.5A CN111338630B (zh) 2018-11-30 2018-11-30 通用机器学习模型文件的生成方法、装置、存储介质
CN201811456246.4 2018-11-30

Related Child Applications (6)

Application Number Title Priority Date Filing Date
US16/975,082 A-371-Of-International US11334329B2 (en) 2018-06-08 2019-05-07 General machine learning model, and model file generation and parsing method
US17/130,370 Continuation US11334330B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,469 Continuation US11036480B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,348 Continuation US11307836B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,300 Continuation US11379199B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method
US17/130,393 Continuation US11403080B2 (en) 2018-06-08 2020-12-22 General machine learning model, and model file generation and parsing method

Publications (1)

Publication Number Publication Date
WO2019233231A1 true WO2019233231A1 (zh) 2019-12-12

Family

ID=68770069

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/085853 WO2019233231A1 (zh) 2018-06-08 2019-05-07 通用机器学习模型、模型文件的生成和解析方法

Country Status (5)

Country Link
US (7) US11334329B2 (zh)
EP (1) EP3751477A4 (zh)
JP (1) JP7386706B2 (zh)
KR (1) KR20210017985A (zh)
WO (1) WO2019233231A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116247248A (zh) * 2023-05-10 2023-06-09 北京新研创能科技有限公司 基于排放物分析的氢燃料电池堆健康状态诊断方法及系统

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414187B (zh) * 2019-07-03 2021-09-17 北京百度网讯科技有限公司 模型安全交付自动化的系统及其方法
US11348035B2 (en) * 2020-10-27 2022-05-31 Paypal, Inc. Shared prediction engine for machine learning model deployment
KR102485528B1 (ko) * 2021-11-02 2023-01-06 주식회사 에이젠글로벌 금융 서비스를 위한 금융 모델 및 금융 데이터 가치 평가 방법 및 이러한 방법을 수행하는 장치
US11675571B1 (en) * 2021-12-28 2023-06-13 Nb Ventures, Inc. Restructuring enterprise application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912500A (zh) * 2016-03-30 2016-08-31 百度在线网络技术(北京)有限公司 机器学习模型生成方法和装置
CN106067028A (zh) * 2015-04-19 2016-11-02 北京典赞科技有限公司 基于gpu的自动化机器学习的建模方法
CN106156810A (zh) * 2015-04-26 2016-11-23 阿里巴巴集团控股有限公司 通用机器学习算法模型训练方法、系统和计算节点
CN106779087A (zh) * 2016-11-30 2017-05-31 福建亿榕信息技术有限公司 一种通用机器学习数据分析平台
CN107844634A (zh) * 2017-09-30 2018-03-27 平安科技(深圳)有限公司 多元通用模型平台建模方法、电子设备及计算机可读存储介质

Family Cites Families (65)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01248268A (ja) * 1988-03-30 1989-10-03 Nippon Telegr & Teleph Corp <Ntt> 神経回路網学習装置
EP0676691A3 (en) 1994-04-06 1996-12-11 Hewlett Packard Co Device for saving and restoring registers in a digital computer.
US6381738B1 (en) * 1999-07-16 2002-04-30 International Business Machines Corporation Method for optimizing creation and destruction of objects in computer programs
US7024668B2 (en) 2000-05-15 2006-04-04 Matsushita Electric Industrial Co., Ltd. Application execution apparatus and method
US20030055881A1 (en) 2001-09-14 2003-03-20 Ngo Kim Cuc Method and apparatus for transmitting data over a network
JP2005227794A (ja) * 2002-11-21 2005-08-25 Matsushita Electric Ind Co Ltd 標準モデル作成装置及び標準モデル作成方法
US7558935B1 (en) 2004-05-04 2009-07-07 Sun Microsystems, Inc. Method and system for optimizing memory allocation
KR101164194B1 (ko) 2008-12-11 2012-07-10 한국전자통신연구원 멀티 쓰레드 기반의 정적 스택 할당 방법
US20100185568A1 (en) * 2009-01-19 2010-07-22 Kibboko, Inc. Method and System for Document Classification
US8620461B2 (en) * 2009-09-24 2013-12-31 Honeywell International, Inc. Method and system for updating tuning parameters of a controller
JP5381624B2 (ja) 2009-11-04 2014-01-08 富士通株式会社 メモリ管理機能を有するプログラム及び装置
CN101782976B (zh) 2010-01-15 2013-04-10 南京邮电大学 一种云计算环境下机器学习自动选择方法
JP2011204105A (ja) * 2010-03-26 2011-10-13 Kddi R & D Laboratories Inc スクリプト起動プログラム、スクリプト起動プログラムの生成プログラム、およびプログラムセット
CN101833438A (zh) 2010-04-19 2010-09-15 浙江大学 一种基于多重并行的数据通用处理方法
US8990502B2 (en) * 2010-11-23 2015-03-24 International Business Machines Corporation Write cache structure in a storage system
CN102289496B (zh) 2011-08-22 2013-03-06 北京航空航天大学 一种基于贝叶斯网络的无线认知网络知识库构建方法
US8566559B2 (en) 2011-10-10 2013-10-22 Microsoft Corporation Runtime type identification of native heap allocations
CN102609714B (zh) 2011-12-31 2017-07-07 哈尔滨理工大学 基于信息增益和在线支持向量机的新型分类器及分类方法
JP5635027B2 (ja) * 2012-03-12 2014-12-03 日本電信電話株式会社 コンピュータシステム及びシステム制御方法
US9324033B2 (en) 2012-09-13 2016-04-26 Nokia Technologies Oy Method and apparatus for providing standard data processing model through machine learning
US9086950B2 (en) 2012-09-26 2015-07-21 Avaya Inc. Method for heap management
US9069656B2 (en) 2012-09-28 2015-06-30 Apple Inc. Obfuscating function resources while reducing stack consumption
WO2014126576A2 (en) * 2013-02-14 2014-08-21 Adaptive Spectrum And Signal Alignment, Inc. Churn prediction in a broadband network
US9286574B2 (en) 2013-11-04 2016-03-15 Google Inc. Systems and methods for layered training in machine-learning architectures
US20150242760A1 (en) 2014-02-21 2015-08-27 Microsoft Corporation Personalized Machine Learning System
US10225280B2 (en) * 2014-02-24 2019-03-05 Cyphort Inc. System and method for verifying and detecting malware
US10289962B2 (en) 2014-06-06 2019-05-14 Google Llc Training distilled machine learning models
US9460002B1 (en) 2014-06-30 2016-10-04 Emc Corporation Memory allocation
US9875736B2 (en) 2015-02-19 2018-01-23 Microsoft Technology Licensing, Llc Pre-training and/or transfer learning for sequence taggers
US9710238B2 (en) 2015-03-26 2017-07-18 IfWizard Corporation Automatically optimizing analytics database server
US11221990B2 (en) 2015-04-03 2022-01-11 The Mitre Corporation Ultra-high compression of images based on deep learning
CN104850592B (zh) 2015-04-27 2018-09-18 小米科技有限责任公司 生成模型文件的方法和装置
US9912759B2 (en) 2015-06-24 2018-03-06 International Business Machines Corporation Dynamically generating solution stacks
US10540588B2 (en) 2015-06-29 2020-01-21 Microsoft Technology Licensing, Llc Deep neural network processing on hardware accelerators with stacked memory
CN105824713B (zh) 2016-03-10 2019-07-16 中国银行股份有限公司 一种数据校验方法及装置
CN106371765B (zh) 2016-08-29 2020-09-18 成都科鸿达科技有限公司 一种高效大规模系统的ltl模型检测去内存抖动的方法
CN106383842A (zh) 2016-08-30 2017-02-08 广联达科技股份有限公司 模型文件的解析方法、解析装置和服务器
US11907760B2 (en) 2016-09-23 2024-02-20 Apple Inc. Systems and methods of memory allocation for neural networks
US11681943B2 (en) * 2016-09-27 2023-06-20 Clarifai, Inc. Artificial intelligence development via user-selectable/connectable model representations
US10908587B2 (en) 2016-10-27 2021-02-02 Desprez Llc Machine-assisted part design with automated design request interpretation
US11222413B2 (en) * 2016-11-08 2022-01-11 Samsung Electronics Co., Ltd. Method for correcting image by device and device therefor
US20180165779A1 (en) * 2016-11-15 2018-06-14 Scriyb LLC System and method for event management in an online virtual learning environment with integrated real-learning augmentation and cyber workforce optimization
US10796217B2 (en) * 2016-11-30 2020-10-06 Microsoft Technology Licensing, Llc Systems and methods for performing automated interviews
CN106682280A (zh) 2016-12-08 2017-05-17 润泽安泰(北京)科技有限公司 一种优化算法的通用建模方法及系统
CN108229686B (zh) 2016-12-14 2022-07-05 阿里巴巴集团控股有限公司 模型训练、预测方法、装置、电子设备及机器学习平台
US10684984B2 (en) * 2016-12-21 2020-06-16 Intel Corporation Computing devices and server systems with processing cores having different instruction set architectures
US10885188B1 (en) * 2016-12-30 2021-01-05 Comodo Security Solutions, Inc. Reducing false positive rate of statistical malware detection systems
US10089467B1 (en) * 2017-05-23 2018-10-02 Malwarebytes Inc. Static anomaly-based detection of malware files
US10394811B2 (en) * 2017-05-30 2019-08-27 Oracle International Corporation Tail-based top-N query evaluation
CN107436762B (zh) 2017-07-03 2021-02-23 北京东土军悦科技有限公司 一种寄存器代码文件生成方法、装置和电子设备
CN107563512B (zh) 2017-08-24 2023-10-17 腾讯科技(上海)有限公司 一种数据处理方法、装置以及存储介质
CN107844371A (zh) 2017-10-12 2018-03-27 北京京东尚科信息技术有限公司 任务处理方法、系统及电子设备
CN107749757B (zh) 2017-10-18 2020-08-14 广东电网有限责任公司电力科学研究院 一种基于堆栈式自编码和pso算法的数据压缩方法及装置
US10360214B2 (en) 2017-10-19 2019-07-23 Pure Storage, Inc. Ensuring reproducibility in an artificial intelligence infrastructure
US10963226B2 (en) * 2017-10-25 2021-03-30 Aspiring Minds Assessment Private Limited Generating compilable code from uncompilable code
US10275710B1 (en) * 2017-10-31 2019-04-30 KenSci Inc. Machine learning model repository
CN108763268B (zh) 2018-04-04 2020-12-29 深圳市彬讯科技有限公司 一种三维模型的批处理方法与装置、存储介质
US10565229B2 (en) * 2018-05-24 2020-02-18 People.ai, Inc. Systems and methods for matching electronic activities directly to record objects of systems of record
WO2020039121A1 (en) * 2018-08-20 2020-02-27 Aalto University Foundation Sr. Method and system for generating annotated training data
CN109409513B (zh) * 2018-10-10 2021-03-12 广州市百果园信息技术有限公司 一种基于神经网络的任务处理方法及相关设备
CN109614220B (zh) * 2018-10-26 2020-06-30 阿里巴巴集团控股有限公司 一种多核系统处理器和数据更新方法
CN111507476A (zh) * 2019-01-31 2020-08-07 伊姆西Ip控股有限责任公司 部署机器学习模型的方法、设备和计算机程序产品
US10956698B2 (en) * 2019-04-18 2021-03-23 Paypal, Inc. Systems and methods for using machine learning to determine an origin of a code
US11443234B2 (en) * 2019-09-25 2022-09-13 Sap Se Machine learning data processing pipeline
US20210191765A1 (en) * 2019-12-18 2021-06-24 Deep Vision Inc. Method for static scheduling of artificial neural networks for a processor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106067028A (zh) * 2015-04-19 2016-11-02 北京典赞科技有限公司 基于gpu的自动化机器学习的建模方法
CN106156810A (zh) * 2015-04-26 2016-11-23 阿里巴巴集团控股有限公司 通用机器学习算法模型训练方法、系统和计算节点
CN105912500A (zh) * 2016-03-30 2016-08-31 百度在线网络技术(北京)有限公司 机器学习模型生成方法和装置
CN106779087A (zh) * 2016-11-30 2017-05-31 福建亿榕信息技术有限公司 一种通用机器学习数据分析平台
CN107844634A (zh) * 2017-09-30 2018-03-27 平安科技(深圳)有限公司 多元通用模型平台建模方法、电子设备及计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116247248A (zh) * 2023-05-10 2023-06-09 北京新研创能科技有限公司 基于排放物分析的氢燃料电池堆健康状态诊断方法及系统
CN116247248B (zh) * 2023-05-10 2023-07-25 北京新研创能科技有限公司 基于排放物分析的氢燃料电池堆健康状态诊断方法及系统

Also Published As

Publication number Publication date
EP3751477A4 (en) 2021-11-03
US11334330B2 (en) 2022-05-17
US11403080B2 (en) 2022-08-02
US11307836B2 (en) 2022-04-19
US20210109728A1 (en) 2021-04-15
US20210109725A1 (en) 2021-04-15
US11334329B2 (en) 2022-05-17
US11726754B2 (en) 2023-08-15
US20210109726A1 (en) 2021-04-15
KR20210017985A (ko) 2021-02-17
US20210089285A1 (en) 2021-03-25
US20220326919A1 (en) 2022-10-13
US20210109729A1 (en) 2021-04-15
US11036480B2 (en) 2021-06-15
JP7386706B2 (ja) 2023-11-27
JP2021526670A (ja) 2021-10-07
EP3751477A1 (en) 2020-12-16
US20210109727A1 (en) 2021-04-15
US11379199B2 (en) 2022-07-05

Similar Documents

Publication Publication Date Title
WO2019233231A1 (zh) 通用机器学习模型、模型文件的生成和解析方法
US10303837B2 (en) Virtual cell model geometry compression
US9971633B1 (en) Operation efficiency management with respect to application compile-time
US10102039B2 (en) Converting a hybrid flow
US10706102B2 (en) Operation efficiency management with respect to application run-time
CN105278966A (zh) 基于失效模式分析的卫星星载制导与导航软件的设计与测试方法
CN114968612B (zh) 一种数据处理方法、系统及相关设备
CN111260071A (zh) 通用机器学习模型文件解析方法、装置、存储介质
Rajbhoj et al. Early experience with model-driven development of mapreduce based big data application
CN111949312A (zh) 数据模块的打包方法、装置、计算机设备和存储介质
CN113626510A (zh) 交易核对方法、装置、电子设备及存储介质
CN114968325A (zh) 代码注释的生成方法及装置、处理器和电子设备
CN108492168B (zh) 财税行业审核用仿真方法
CN111258584B (zh) 通用机器学习二级模型文件解析方法、装置、存储介质
CN111260018B (zh) 机器学习二级模型文件生成方法、装置、存储介质
CN110647996B (zh) 通用机器学习模型的执行方法、装置和存储介质
CN111338630A (zh) 通用机器学习模型文件的生成方法、装置、存储介质
CN116089430A (zh) 针对大数据任务的实现方法、装置、设备及存储介质
Fekete et al. Towards a model transformation tool on the top of the OpenCL framework
CN112836106A (zh) 数据爬取应用的创建方法、装置、存储介质及设备
Bernardi et al. A Meta-Model-Based Approach to the Definition of the Analysis Results of Petri-Net Models

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2019554861

Country of ref document: JP

Kind code of ref document: A

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

Ref document number: 19815956

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019815956

Country of ref document: EP

Effective date: 20200908

NENP Non-entry into the national phase

Ref country code: DE