IP Library › Granted Patent US 11,403,080
Granted Patent B2
US 11,403,080 · App. 17/130,393 · Granted Aug 2, 2022

General machine learning model, and model file generation and parsing method

Inventors: Weijian Du (Pudong New Area, CN); Linyang Wu (Pudong New Area, CN); Xunyu Chen (Pudong New Area, CN)
Assignee: SHANGHAI CAMBRICON INFORMATION TECHNOLOGY CO., LTD.
G06F8/433G06F8/10G06F8/35G06F8/447G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,403,080
App. No.
17/130,393
Granted
Aug 2, 2022
Kind
B2
Abstract

Disclosed are a general machine learning model generation method and apparatus, and a computer device and a storage medium. The method comprises: acquiring task parameters of a machine learning task (S 1201 ); performing classification processing on the task parameters to obtain task instructions and model parameters (S 1202 ); aggregating the task instructions and the model parameters according to a data type to obtain stack data and heap data (S 1203 ); and integrating the stack data and the heap data to obtain a general machine learning model (S 1204 ). By means of the method, compiled results of a corresponding general model in the running of an algorithm can be directly executed, which avoids repetitive compilation, thus greatly improving the efficiency of machine learning algorithm implementation and shortening the time from compilation to obtaining execution results.

Claims (40)

1. A method for generating a general-purpose machine learning model file, wherein the general-purpose machine learning model file includes a general-purpose machine learning model and a model directory, and the generation method comprises:

obtaining, by an external interface module, task parameters of a machine learning task;

classifying, by a classification processing module, the task parameters to obtain task instructions and model parameters;

aggregating, by a parameter aggregating module, the task instructions and the model parameters according to data types to generate stack data and heap data;

integrating, by a model generation module, the stack data and the heap data to obtain a general-purpose machine learning model;

calculating, by a storage offset calculation module, a storage offset of the general-purpose machine learning model;

obtaining, by the storage offset calculation module, a size of a storage space occupied by each general-purpose machine learning model and a count of the general-purpose machine learning models;

obtaining, by the storage offset calculation module, a storage order of the general-purpose machine learning models;

calculating, by the storage offset calculation module, a storage offset of each general-purpose machine learning model according to the size of the storage space occupied by each general-purpose machine learning model, the count of the general-purpose machine learning models, and the storage order of the general-purpose machine learning models;

generating, by a model directory generation module, the model directory according to the general-purpose machine learning model and the storage offset of the general-purpose machine learning model;

generating, by a model file generation module, the general-purpose machine learning model file according to the general-purpose machine learning model and the model directory;

creating, by the model file generation module, a check code or an error correction code of the general-purpose machine learning model file;

generating, by the model file generation module, the general-purpose machine learning model file according to the check code or the error correction code of the general-purpose machine learning model file, the general-purpose machine learning model, and the model directory;

calculating, by the model file generation module, a size of a storage space required for the general-purpose machine learning model file; and

generating the general-purpose machine learning model file according to the general-purpose machine learning model, the size of the storage space required for the general-purpose machine learning model file, and the model directory.

2. The method of claim 1 , wherein the step of generating the general-purpose machine learning model file according to the general-purpose machine learning model and the model directory includes:

obtaining a file header and a file tail of the general-purpose machine learning model file; and

generating the general-purpose machine learning model file according to the file header, the model directory, the general-purpose machine learning model, and the file tail.

3. The method of claim 1 , wherein the step of generating the general-purpose machine learning model file according to the general-purpose machine learning model and the model directory includes:

creating an identification code of the general-purpose machine learning model file; and

generating the general-purpose machine learning model file according to the identification code, the general-purpose machine learning model, and the model directory.

4. A device for generating a general-purpose machine learning model file, comprising:

a hardware central processing unit (CPU); a memory physically connected to the (CPU);

an external interface module configured to obtain task parameters of a machine learning task;

a classification processing module configured to classify the task parameters to obtain task instructions and model parameters;

a parameter aggregating module configured to aggregate the task instructions and the model parameters according to data types to generate stack data and heap data;

a model generation module configured to integrate the stack data and the heap data to obtain a general-purpose machine learning model;

a storage offset calculation module configured to calculate a storage offset of the general-purpose machine learning model, wherein the storage offset calculation module is further configured to:

obtain a size of a storage space occupied by each general-purpose machine learning model and a count of the general-purpose machine learning models;

obtain a storage order of the general-purpose machine learning models; and

calculate a storage offset of each general-purpose machine learning model according to the size of the storage space occupied by each general-purpose machine learning model, the count of the general-purpose machine learning models, and the storage order of the general-purpose machine learning models;

a model directory generation module configured to generate the model directory according to the general-purpose machine learning model and the storage offset of the general-purpose machine learning model; and

a model file generation module configured to generate the general-purpose machine learning model file according to the general-purpose machine learning model and the model directory, wherein the model file generation module is further configured to:

create a check code or an error correction code of the general-purpose machine learning model file;

generate the general-purpose machine learning model file according to the check code or the error correction code of the general-purpose machine learning model file, the general-purpose machine learning model, and the model directory;

calculate a size of a storage space required for the general-purpose machine learning model file; and

generate the general-purpose machine learning model file according to the general-purpose machine learning model, the size of the storage space required for the general-purpose machine learning model file, and the model directory.

5. The device of claim 4 , wherein the file generator further includes a file header generator and a file tailer generator, wherein the file header generator is connected to the directory generator, and the file tailer generator is connected to the model filler.

6. The device of claim 5 , wherein the file header generator is further configured to create an identification code of a general-purpose machine learning model file, and generate the general-purpose machine learning model file according to the identification code of the general-purpose machine learning model file, the general-purpose machine learning model, and the model directory.

7. The device of claim 4 , wherein the model filler is further configured to sequentially store the general-purpose machine learning model into the file generator.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 22, 2020
From: DU, WEIJIAN; WU, LINYANG; CHEN, XUNYU
To: SHANGHAI CAMBRICON INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 054722/0982 →
Priority Claims (6)
CN 201810588623.3 · Jun 8, 2018 · national
CN 201810589390.9 · Jun 8, 2018 · national
CN 201811456246.4 · Nov 30, 2018 · national
CN 201811457719.2 · Nov 30, 2018 · national
CN 201811459679.5 · Nov 30, 2018 · national
CN 201811459853.6 · Nov 30, 2018 · national
Continuity (2)
Continuation 16975082
Related Publication 20210109728A1 · Apr 15, 2021