CN116757284A - Model reasoning method, device, storage medium and program product - Google Patents

Model reasoning method, device, storage medium and program product Download PDF

Info

Publication number
CN116757284A
CN116757284A CN202211172258.0A CN202211172258A CN116757284A CN 116757284 A CN116757284 A CN 116757284A CN 202211172258 A CN202211172258 A CN 202211172258A CN 116757284 A CN116757284 A CN 116757284A
Authority
CN
China
Prior art keywords
model
operator
input data
dimension
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211172258.0A
Other languages
Chinese (zh)
Inventor
伍国林
王哲
陆二伟
廖建文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211172258.0A priority Critical patent/CN116757284A/en
Publication of CN116757284A publication Critical patent/CN116757284A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a model reasoning method, device, storage medium and program product, wherein the method comprises the following steps: acquiring a to-be-processed model and input data, wherein each operator of the to-be-processed model is configured with an initialization memory space, and the initialization memory space is adapted to the maximum input data dimension allowed by the to-be-processed model; determining the output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension; and reasoning the model to be processed based on the input data, the output dimension of each operator and the initialized memory space, and outputting a model reasoning result. The application can reduce the model reasoning time delay and improve the model reasoning efficiency.

Description

Model reasoning method, device, storage medium and program product
Technical Field
The present application relates to the field of computer technology, and in particular, to a model reasoning method, device, storage medium, and program product.
Background
Artificial intelligence (Artificial Intelligence, abbreviated as "AI") is the basic theory, method, and technique of studying how computer hardware and software are applied to simulate certain intelligent behaviors of humans. With the development of computer technology, the application of AI models is becoming more and more popular. Artificial neural networks (Artificial Neural Networks, ANNs) are algorithmic mathematical models that mimic the behavioral characteristics of animal neural networks and perform distributed parallel information processing. The artificial neural network model is a common AI model and is widely applied to various scenes, such as a natural language model, an image recognition model and the like.
In an actual scene, the trained AI model needs to be deployed on a server or an end-side product, and the application of the model is realized through a model reasoning process. During AI model reasoning, in the initialization stage, the reasoning framework needs to allocate a memory space matched with the input dimension of each operator of the model to realize the reasoning of the input data.
However, when the input dimension of the AI model dynamically changes, if the above manner is still adopted to allocate a corresponding memory space for each operator, the memory space required by all operators in the model needs to be reallocated after each input data change, which results in long reasoning delay and low reasoning efficiency of the model.
Disclosure of Invention
The embodiment of the application provides a model reasoning method, device, storage medium and program product, which can reduce model reasoning time delay and improve model reasoning efficiency.
In a first aspect, an embodiment of the present application provides a model reasoning method, including: acquiring a to-be-processed model and input data, wherein each operator of the to-be-processed model is configured with an initialization memory space, and the initialization memory space is adapted to the maximum input data dimension allowed by the to-be-processed model; determining the output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension; and reasoning the model to be processed based on the input data, the output dimension of each operator and the initialized memory space, and outputting a model reasoning result.
In an embodiment, before the determining the output dimension of each operator of the model to be processed according to the data dimension of the input data, the method further includes: acquiring the maximum allowable input data dimension of the model to be processed; and configuring the initialization memory space for each operator of the model to be processed according to the maximum input data dimension, wherein the initialization memory space is adapted to the maximum input data dimension.
In an embodiment, the configuring the initialization memory space for each operator of the model to be processed according to the maximum input data dimension, where the initialization memory space is adapted to the maximum input data dimension includes: determining the memory resource occupation amount of each operator according to the maximum input data dimension and the parameter configuration of each operator; and configuring the initialized memory space for each operator based on the memory resource occupation amount, wherein the resource amount of the initialized memory space is larger than or equal to the memory resource occupation amount for each operator.
In an embodiment, the determining the output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension includes: judging whether the data dimension of the input data is larger than the maximum input data dimension; and if the data dimension of the input data is larger than the maximum input data dimension, determining the output dimension of each operator in the model to be processed according to the maximum input data dimension.
In an embodiment, the determining the output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension further includes: and if the data dimension of the input data is smaller than or equal to the maximum input data dimension, determining the output dimension of each operator in the model to be processed according to the data dimension of the input data.
In an embodiment, the reasoning the model to be processed based on the input data, the output dimension of each operator, and the initialized memory space, and outputting a model reasoning result includes: in the model reasoning process, detecting whether a current operator is configured with preset attributes; if the current operator is configured with the preset attribute, updating the output dimension of the current operator based on the data received by the current operator and the parameter configuration of the current operator; based on the updated output dimension of the current operator and the input data, reasoning the current operator on an initialized memory space corresponding to the current operator to obtain a reasoning result of the current operator; and determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
In an embodiment, the reasoning is performed on the model to be processed based on the input data, the output dimension of each operator, and the initialized memory space, and a model reasoning result is output, and further includes: if the preset attribute is not configured by the current operator, reasoning the current operator on the initialized memory space corresponding to the current operator based on the output dimension of the current operator and the input data, so as to obtain a reasoning result of the current operator; and determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
In an embodiment, the determining the inference result of the to-be-processed model according to the inference results of all operators in the to-be-processed model includes: and transmitting the reasoning result of the current operator to the next operator, and continuing model reasoning until each operator of the model to be processed is traversed, so as to obtain the model reasoning result.
In an embodiment, before detecting whether the current operator is configured with the preset attribute in the model reasoning process, the method further includes: creating a topological structure of the model to be processed, configuring preset attributes for a target operator in the model to be processed, and transmitting the preset attributes in the topological structure.
In a second aspect, an embodiment of the present application provides a model inference apparatus, including:
the system comprises a first acquisition module, a second acquisition module and a processing module, wherein the first acquisition module is used for acquiring a to-be-processed model and input data, each operator of the to-be-processed model is configured with an initialization memory space, and the initialization memory space is adapted to the maximum allowable input data dimension of the to-be-processed model;
the determining module is used for determining the output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension;
the reasoning module is used for reasoning the model to be processed based on the input data, the output dimension of each operator and the initialized memory space, and outputting a model reasoning result.
In one embodiment, the method further comprises: the second acquisition module is used for acquiring the maximum input data dimension allowed by the to-be-processed model before the output dimension of each operator of the to-be-processed model is determined according to the data dimension of the input data; and the configuration module is used for configuring the initialization memory space for each operator of the to-be-processed model according to the maximum input data dimension, and the initialization memory space is adapted to the maximum input data dimension.
In an embodiment, the configuration module is configured to determine, according to the maximum input data dimension and the parameter configuration of each operator, a memory resource occupation amount of each operator; and configuring the initialized memory space for each operator based on the memory resource occupation amount, wherein the resource amount of the initialized memory space is larger than or equal to the memory resource occupation amount for each operator.
In an embodiment, the determining module is configured to determine whether a data dimension of the input data is greater than the maximum input data dimension; and if the data dimension of the input data is larger than the maximum input data dimension, determining the output dimension of each operator in the model to be processed according to the maximum input data dimension.
In an embodiment, the determining module is further configured to determine, if the data dimension of the input data is less than or equal to the maximum input data dimension, an output dimension of each operator in the model to be processed according to the data dimension of the input data.
In an embodiment, the inference module is configured to detect whether the current operator is configured with a preset attribute in a model inference process; if the current operator is configured with the preset attribute, updating the output dimension of the current operator based on the data received by the current operator and the parameter configuration of the current operator; based on the updated output dimension of the current operator and the input data, reasoning the current operator on an initialized memory space corresponding to the current operator to obtain a reasoning result of the current operator; and determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
In an embodiment, the inference module is further configured to infer, if the current operator is not configured with the preset attribute, the current operator on an initialized memory space corresponding to the current operator based on an output dimension of the current operator and the input data, so as to obtain an inference result of the current operator; and determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
In an embodiment, the inference module is further configured to transmit an inference result of the current operator to a next operator, and continue model inference until each operator of the to-be-processed model is traversed, so as to obtain the model inference result.
In one embodiment, the method further comprises: the creating module is used for creating a topological structure of the model to be processed before detecting whether the current operator is configured with the preset attribute in the model reasoning process, configuring the preset attribute for the target operator in the model to be processed, and transmitting the preset attribute in the topological structure.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory for storing code instructions, the processor being for executing the code instructions to perform the method described in the first aspect of the embodiments of the present application or any one of the possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored therein a computer program or instructions which, when run on a computer, cause the computer to perform the method described in the first aspect of the embodiments of the present application or any one of the possible implementations of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run on a computer, causes the computer to perform the model reasoning method described in the first aspect of the embodiments of the present application or any one of the possible implementations of the first aspect.
The application provides a model reasoning method, equipment, a storage medium and a program product, wherein a matched initialization memory space is configured for each operator in advance based on the maximum input data dimension preset by a model to be processed, in the model reasoning process, the output dimension of each operator can be directly determined according to the data dimension of input data and the maximum input data dimension allowed by the model, and then reasoning is completed based on the operator output dimension, the input data and the initialization memory space, so that the initialization memory space of the operator is adapted to the maximum input data dimension allowed by the model to be processed, the configured initialization memory space can meet the model reasoning requirement no matter how the data dimension of the input data changes, the operator is not required to be allocated with memory again, the model time delay is reduced, and the model reasoning efficiency is improved.
It should be understood that the description of the application above is not intended to limit key or critical features of embodiments of the application, nor to limit the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the application or the technical solutions of the prior art, the following description of the embodiments or the drawings used in the description of the prior art will be given in brief, it being obvious that the drawings in the description below are some embodiments of the application and that other drawings can be obtained from them without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a block diagram of a software architecture of an electronic device according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an application scenario of model reasoning provided in an embodiment of the present application;
FIG. 4 is a flow chart of a model reasoning method according to an embodiment of the present application;
FIG. 5 is a flow chart of a model reasoning method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of relationships between operators in a model according to an embodiment of the present application;
Fig. 7 is a schematic structural diagram of a model inference apparatus according to an embodiment of the present application.
Detailed Description
In embodiments of the present application, the words "first," "second," and the like are used to distinguish between identical or similar items that have substantially the same function and effect. For example, the first chip and the second chip are merely for distinguishing different chips, and the order of the different chips is not limited. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
For clarity in describing aspects of embodiments of the present application, the terms involved are first interpreted:
AI: artificial Intelligence, artificial intelligence.
ASR: automatic Speech Recognition is an automatic speech recognition technology, which is a technology for converting human speech into text.
TTS: text To Speech, i.e. "from Text To Speech", is part of a man-machine conversation, allowing the machine To speak. It can convert the files stored in the computer, such as help files or web pages, into natural speech output.
Operators: is a mapping O of function space to function space: X.fwdarw.X. The operator in the broad sense can be generalized to any space, such as an inner product space, etc. The deep learning algorithm consists of individual computational units, which may be referred to as operators (OP for short). In the network model, the computation logic in the operator corresponding layer, for example: the convolution layer (Convolution Layer) is an operator. The weight summation process in the full-connected Layer (FC Layer) is an operator.
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Fig. 1 shows a schematic configuration of an electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. Wireless communication techniques may include global system for mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, so that the electrical signal is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The processor 110 may be adapted to execute any of the methods provided by the embodiments of the present application in accordance with the obtained executable instructions by invoking a computer program stored in the memory 121.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may parse out a voice signal based on the vibration signal of the vocal part vibration bone piece obtained by the bone conduction sensor 180M, and implement a voice function. The application processor can analyze heart rate information based on the blood pressure beat signals acquired by the bone conduction sensor 180M, so that a heart rate detection function is realized.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the invention, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 2 is a software configuration block diagram of the electronic device 100 according to the embodiment of the present invention.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as phone, mailbox, calendar, camera, gallery, map, navigation, WLAN (Wireless Local Area Network ), bluetooth, music, video, short message, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time (Android Runtime) includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The workflow of the electronic device 100 software and hardware is illustrated below in connection with capturing a photo scene.
When touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into the original input event (including information such as touch coordinates, time stamp of touch operation, etc.). The original input event is stored at the kernel layer. The application framework layer acquires an original input event from the kernel layer, and identifies a control corresponding to the input event. Taking the touch operation as a touch click operation, taking a control corresponding to the click operation as an example of a control of a camera application icon, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera driver by calling a kernel layer, and captures a still image or video by the camera 193.
The model reasoning method of the embodiment of the application is described in detail below through specific embodiments. The following embodiments may be combined with each other or implemented independently, and the same or similar concepts or processes may not be described in detail in some embodiments.
With the development of computer technology, the application of AI models is becoming more and more popular. The artificial neural network model is a common AI model and is widely applied to various scenes, such as an ASR model, a TTS model, various image recognition models and the like.
In an actual scene, the AI model firstly goes through a model training stage, then the trained AI model is required to be deployed on a server or a terminal, and a model reasoning process is carried out on the server or the terminal to output a model reasoning result so as to realize the application of the model. The server may be a cloud server or a local server. The terminal can be mobile equipment such as a mobile phone, a tablet personal computer and the like, and can also be equipment such as a desktop computer and the like. Both the server and the terminal may be implemented by the electronic device 100 described above.
As shown in fig. 3, a schematic view of a scenario architecture of model reasoning provided by an embodiment of the present application, where the model reasoning architecture mainly includes: model initialization and inference output two phases, wherein:
In the model initialization stage, the model file of the model to be processed needs to be analyzed, then the model topological structure is created, and then the processes of operator initialization, calculation dimension reasoning and the like are carried out.
In the reasoning output stage, after the initialization stage is finished, a user only needs to give input data, and model reasoning can be carried out on the model to be processed based on the input data, and then model output is obtained, so that the whole process of model reasoning is finished.
In the model initialization stage, the inference framework needs to allocate a memory space matched with the input dimension of each operator of the model to realize the subsequent model inference process.
However, the above reasoning process is applicable to the situation that the data dimension of the input data is unchanged, the memory space required by each operator in the actual scene is related to the dimension of the input data, when the input dimension of the AI model is dynamically changed, if the corresponding memory space is still allocated for each operator by adopting the above manner, the memory space required by all operators in the model needs to be reallocated after each input data change, so that the reasoning time delay of the model is too long and the reasoning efficiency is low.
Aiming at the problems, the embodiment of the application provides a model reasoning scheme, wherein a matched initialization memory space is configured for each operator in advance based on the maximum input data dimension preset by a model to be processed, in the model reasoning process, the output dimension of each operator can be directly determined according to the data dimension of the input data and the maximum input data dimension allowed by the model, and then reasoning is completed based on the operator output dimension, the input data and the initialization memory space, so that the initialization memory space of the operator is adapted to the maximum input data dimension allowed by the model to be processed, the configured initialization memory space can meet the model reasoning requirement no matter how the data dimension of the input data changes, the memory is not required to be allocated for the operator again, the model reasoning time delay is reduced, and the model reasoning efficiency is improved.
As shown in fig. 4, an embodiment of the present application provides a model reasoning method, which may be performed by the electronic device 100 described above and may be applied to the application scenario of model reasoning shown in fig. 3, so as to reduce the model reasoning delay and improve the model reasoning efficiency. The method comprises the following steps:
step 401: and acquiring the model to be processed and input data, wherein each operator of the model to be processed is configured with an initialization memory space, and the initialization memory space is adapted to the maximum input data dimension allowed by the model to be processed.
In this step, the model to be processed may be an algorithm model based on a neural network, such as an ASR model, a TTS model, and various cv (computer vision) models, etc. The model file of the model to be processed can be directly read in the local database, and can be uploaded by a user through a client, or can be directly input through external input equipment. The model to be processed comprises one or more operators, and each operator is preconfigured with an initialization memory space to complete data calculation of each operator during model reasoning. And the initialization memory space is adapted to the maximum input data dimension allowed by the model to be processed, so that when the dimension of the input data changes, the model reasoning process can be ensured to be smoothly carried out only by updating the dimension of the model operator.
In one embodiment, before step 401, it may include: and acquiring the maximum input data dimension allowed by the model to be processed. And configuring an initialization memory space for each operator of the model to be processed according to the maximum input data dimension, wherein the initialization memory space is adapted to the maximum input data dimension.
In this embodiment, before model reasoning is performed, model initialization may be performed first, and in the model initialization stage, the maximum input data dimension allowed by the to-be-processed model may be read from the model file. And then, determining the initialized memory space of each operator based on the maximum input data dimension preset by the model to be processed, so that the initialized memory space of each operator is adapted to the maximum input data dimension.
The largest input data dimension here, i.e. the largest input data dimension that the model to be processed can handle during the reasoning process. Each model to be processed corresponds to a respective use scene, the output requirements on the models are possibly different due to different use scenes, in an actual scene, the models are expected to exert the best performance in the specific use scenes, therefore, when the AI model is deployed, some limiting parameters are configured for the models, such as the maximum input data dimension allowed by the models to be processed is configured, the corresponding models are generated according to the maximum input data dimension, and further the phenomenon that the models cannot be effectively calculated due to unlimited input data is avoided. For example, for a TTS model, the input data is generally text containing words, and assuming that the TTS model is configured in advance to allow a maximum input data dimension of 30 words for one piece of data, in the subsequent reasoning process of the TTS model, the maximum input data dimension that can be processed by one reasoning is 30 words. Even if the input data given by the user is 100 words, the model will only cut the 100 words that are input in sequence, for example, it may cut into 3 pieces of data including 30 words and one piece of data including 10 words. In processing, the first 30 words are processed in order, and then the subsequent words are processed in units of 30 words. Thus, unnecessary stress on computing resources caused by sudden increase of the calculated amount of the model due to overlarge input text is avoided.
The above-mentioned cutting process of input data may be pre-processed on other devices, or may be pre-processed on a local device.
Since each operator in the model to be processed is related to the input data, the larger the data dimension of the input data is, the larger the memory space will be required for the corresponding operator during calculation. The initialization memory space of each operator is adapted to the largest input data dimension, which means that the initialization memory space of each operator can meet the memory resource requirement when the model to be processed is input by the largest input data dimension, so that no matter whether the data dimension of the input data changes or not in the follow-up reasoning process, the memory is not required to be allocated for the operator again, the model reasoning time delay is reduced, and the model reasoning efficiency is improved.
In an embodiment, the configuring an initialization memory space for each operator of the model to be processed according to the maximum input data dimension, where the initialization memory space is adapted to the maximum input data dimension includes: and determining the memory resource occupation amount of each operator according to the maximum input data dimension and the parameter configuration of each operator. And configuring an initialized memory space for each operator based on the memory resource occupation amount, wherein the resource amount of the initialized memory space is larger than or equal to the memory resource occupation amount for each operator.
In this embodiment, the model to be processed may be converted and parsed, to obtain the maximum input data dimension and the parameter configuration of each operator. Each operator of the model to be processed may have a specific parameter configuration, for example, for an operator of convolution calculation, the parameter configuration may include: the number of convolution kernels, the size of the convolution kernels and the like, and the parameter configuration of operators are different, and the memory space resources required by the convolution kernels are different, so that in an actual scene, a model to be processed can be converted and analyzed to obtain the maximum input data dimension required by combining the model to be processed and the parameter configuration of each operator, the memory resource occupation amount required by the operators is determined, and then the initialization memory space is allocated to the corresponding operators based on the memory resource occupation amount required by the operators. Therefore, each operator can be guaranteed to have the satisfied memory, the memory is not required to be reallocated, and the time delay is reduced.
Step 402: and determining the output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension.
In this step, the data dimension of the input data is used to characterize the size of the input data. For example, for a TTS model, where the input data is text, the data dimension of the input data may include the number of bytes of a piece of input text. For an image recognition model, the input data is typically a picture, and the data dimension of the input data may include: the width and height of an input picture, and color channels.
The output dimension of each operator in the model to be processed is related to the data actually processed by the model, so that the output dimension of each operator in the model to be processed needs to be determined based on the data dimension of the input data and the maximum input data dimension, and the model reasoning is ensured to be smoothly carried out. Therefore, when the dynamic data is input into the model, only the output dimension of the model operator is updated according to the data dimension of the new input data, the memory is not required to be reallocated, the initialization is realized once, and the continuous reasoning of the dynamic input data is realized.
Step 403: based on the input data, the output dimension of each operator and the initialized memory space, reasoning the model to be processed, and outputting a model reasoning result.
In the step, after the output dimension of each operator in the model to be processed is determined, the input data can be inferred on the initialized memory space corresponding to each operator, and then the model inference result is obtained and output for a user to check in time.
According to the model reasoning method, the matched initialization memory space is configured for each operator in advance based on the maximum input data dimension preset by the model to be processed, in the model reasoning process, the output dimension of each operator can be determined directly according to the data dimension of the input data and the maximum input data dimension allowed by the model, and then reasoning is completed based on the operator output dimension, the input data and the initialization memory space, so that the memory space required by the operator is smaller than or equal to the memory space allocated by the model to be processed, when the data dimension of the input data changes, the configured memory space can meet the model reasoning requirement, the memory does not need to be allocated for the operator again, the model reasoning time delay is reduced, and the model reasoning efficiency is improved.
As shown in fig. 5, an embodiment of the present application provides a model reasoning method, which may be executed by the electronic device 100 described above and may be applied to the application scenario of model reasoning shown in fig. 3, so as to reduce the model reasoning delay and improve the model reasoning efficiency. The method comprises the following steps:
step 501: the method comprises the steps of obtaining a model to be processed and the maximum input data dimension allowed by the model to be processed. See the description of step 401 for details of the above embodiments.
Step 502: and configuring an initialization memory space for each operator of the model to be processed according to the maximum input data dimension, wherein the initialization memory space is adapted to the maximum input data dimension. See the description of step 401 for details of the above embodiments.
Step 503: input data is acquired. See the description of step 401 for details of the above embodiments.
Step 504: it is determined whether the data dimension of the input data is greater than the maximum input data dimension. If yes, go to step 505, otherwise go to step 506.
In this step, when determining the output dimension of each operator of the model to be processed, the data dimension of the input data and the size of the maximum input data dimension are comprehensively considered, so that in order to ensure that the data dimension actually processed by the model at one time does not exceed the preset maximum input data dimension, the data dimension of the input data needs to be compared with the maximum input data dimension, if the data dimension of the input data is greater than the maximum input data dimension, step 505 is entered, otherwise step 506 is entered.
Step 505: and determining the output dimension of each operator in the model to be processed according to the maximum input data dimension. Step 507 is then entered.
In this step, the original input data is generally subjected to a preprocessing process, and the dimension of the original input data is cut into the dimension required by the model to be processed, and then is input into the model to be processed. For example, the dimension of the maximum input data preset by the to-be-processed model is that one piece of input data comprises 30 words, and the original input data is 100 words, then the original data is cut into: 3 pieces of data including 30 words and one piece of data including 10 words. So as to ensure that the model reasoning process is smoothly carried out. The process of data preprocessing may not be in the same engine as the model reasoning process. However, in an actual scenario, if the data preprocessing process is not accurate enough, the situation that the data dimension of the input data is larger than the maximum input data dimension may still be encountered, and at this time, the to-be-processed model cannot process the input data at one time, and the input data may be processed in batches after being cut. Taking the TTS model as an example of a model to be processed, assuming that the corresponding maximum input data dimension is 30 words and the current input data is 100 words, indicating that the TTS model can only process 30 words of input data at a time at most, calculating the output dimension of each operator in the TTS model based on 30 words of the maximum input data dimension. Therefore, the actual requirements of the to-be-processed model are met, the output dimension of each operator is also suitable for the corresponding initialized memory space, the memory space actually required by each operator is not larger than the initialized memory space, the memory is further prevented from being redistributed, and the model reasoning time delay is reduced.
In an embodiment, after step 504, the method may further include: and if the data dimension of the input data is larger than the maximum input data dimension, returning an error prompt.
In this embodiment, however, if a situation is encountered in which the data dimension of the input data is greater than the maximum input data dimension, the inference engine may also return an error prompt to prompt the relevant personnel to process in time.
Step 506: and determining the output dimension of each operator in the model to be processed according to the data dimension of the input data. Step 507 is then entered.
In this step, if the data dimension of the input data is smaller than or equal to the maximum input data dimension, it is indicated that the current input data dimension does not exceed the maximum input data dimension corresponding to the model. Taking the TTS model as an example of a model to be processed, assuming that the corresponding maximum input data dimension is 30 words and the current input data is 20 words, it is explained that the TTS model can process the input 20 words at one time, and then the output dimension of each operator in the TTS model can be calculated based on the data dimension 20 words of the input data. Therefore, the actual requirements of the model to be processed are met, the initialized memory space corresponding to the output dimension of each operator is also suitable, the memory space actually required by each operator is not larger than the initialized memory space, the memory is further prevented from being reallocated, and the model reasoning time delay is reduced.
Step 507: in the model reasoning process, whether the current operator is configured with preset attributes or not is detected. If yes, go to step 508, otherwise go to step 510.
In this step, a plurality of operators in the model to be processed are generally related to each other, and there are sometimes parameters of the current operator to be determined by the output of the previous operator. After determining the output dimension of the operator under the global dynamics in step 505 or step 506, in the model reasoning process, there may be some operators whose output dimension cannot be determined at one time, that is, there may be a calculation result of the dimension dependent pre-operator of a part of operators, and such part of operators may be called as a target operator with a dynamic input condition.
For example, taking an ASR model as a model to be processed, there are cases of local dynamic input. As shown in FIG. 6, a schematic diagram of a partial operator relationship for an ASR model, comprising: the index_control operator, operator 1, operator 2, operator 3, slice operator, operator Q, and other operators, just to give examples. The output result of the operator 1 is transmitted to the Slice operator, and as one of parameters of Slice, the output result of the Slice operator is transmitted to the operator Q. In such an operator relationship, when the Slice operator receives dynamic parameters, it must cause its output dimension to change, resulting in the dimension of the operator Q also changing. For example, in the Slice operator, parameters starts, ends, axes, steps are included, and these parameters are fixed parameters under normal conditions, in the ASR model reasoning process, it is assumed that the Slice operator receives a dynamic start parameter, and the output dimension of the Slice operator also changes, so that the output dimension of a subsequent operator Q of the Slice operator is in an uncertain state, and the output dimension of the subsequent operator Q of the Slice operator needs to be determined after the Slice operator reasoning is completed. When processing the Slice operator, the Slice operator can be marked differently by giving a preset attribute to the Slice operator, for example, marking a dynamic attribute label, and the dynamic attribute label is transferred to a subsequent operator. In order to enable each operator to successfully complete reasoning, in the actual reasoning process of the ASR model, each operator can be checked for preset attributes, so that each operator of the model to be processed can be traversed, and whether the current operator is configured with the preset attributes or not is judged. If yes, go to step 508, otherwise go to step 510.
In an embodiment, before step 507, the method may further include: creating a topological structure of the model to be processed, configuring preset attributes for a target operator in the model to be processed, and transmitting the preset attributes in the topological structure.
In this embodiment, a topology structure of a model to be processed may be created in a model initialization stage, then, based on a relationship between operators in the model to be processed, target operators with dynamic input conditions are found, preset attributes are configured for the target operators, for example, the target operators are labeled for identifying the target operators, and the preset attributes may be transferred in the topology structure, so that in a model reasoning process, the operators are checked and identified.
Step 508: updating the output dimension of the current operator based on the data received by the current operator and the parameter configuration of the current operator.
In this step, if the current operator is configured with a preset attribute, it is indicated that the current operator is a target operator with a dynamic input condition, and before calculating the current operator, the output dimension of the current operator is updated based on the data received by the current operator and the parameter configuration of the current operator, so that the updated operator output dimension can smoothly complete the reasoning calculation.
Step 509: based on the updated output dimension and input data of the current operator, reasoning the current operator on an initialized memory space corresponding to the current operator to obtain a reasoning result of the current operator. Step 511 is entered.
In the step, the updated output dimension of the current operator can enable the calculation result of the operator to be more accurate, the memory space is not required to be allocated for the operator again, the current operator can be directly inferred on the initialized memory space corresponding to the current operator, the accurate reasoning result of the current operator can be obtained, the operator reasoning time delay is reduced, and the model reasoning time delay is further reduced.
Step 510: based on the output dimension and the input data of the current operator, reasoning is carried out on the current operator on the initialized memory space corresponding to the current operator, and a reasoning result of the current operator is obtained. Step 511 is entered.
In this step, if the current operator is not configured with the preset attribute, it is indicated that the current operator is a common operator, and the operator parameters of the current operator do not depend on the output result of the previous operator, so that the output dimension determined in step 505 or step 506 can be directly adopted to infer the current operator on the initialized memory space corresponding to the current operator for the input data, so as to obtain the inference result of the current operator.
Step 511: and determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
In this step, multiple operators may be serial or parallel, and after the reasoning of all operators in the model to be processed is completed, the reasoning result of the model to be processed may be output.
In one embodiment, in the model reasoning process, step 511 may specifically include: and transmitting the reasoning result of the current operator to the next operator, and continuing model reasoning until each operator of the model to be processed is traversed, so as to obtain a model reasoning result.
In this embodiment, between multiple operators with serial relationships, the reasoning result of the previous operator needs to be transferred to the next operator, so as to complete the reasoning of the next operator, until the reasoning process of all operators in serial is completed. All operators existing in parallel are required to complete reasoning, and the parallel reasoning results are summarized to form the reasoning results of the model to be processed, so that the integrity of model reasoning is ensured.
According to the model reasoning method, after the model to be processed finishes global dynamic input, the dimension of a part of operators possibly depends on the calculation result of the front operator, the dimension of the operators cannot be calculated in advance, preset attributes are added for the operators in the reasoning framework, and the attributes are transferred in the topological structure of the model. Checking preset attributes of operators in the reasoning process, and when the operator encounters a target operator with the preset attributes, recalculating the dimension of the target operator in the model reasoning process to realize real-time dynamic updating of the dimension without reallocating the memory space, so that the time delay of model reasoning is reduced, and the efficiency of model reasoning is improved.
As shown in fig. 7, an embodiment of the present application provides a model reasoning apparatus 700, which can be applied to the electronic device 100 shown in the foregoing description, and can be applied to an application scenario of model reasoning shown in fig. 3, so as to reduce a model reasoning delay and improve a model reasoning efficiency. The device comprises: the first acquisition module 701, the determination module 702 and the reasoning module 703 function as follows:
a first obtaining module 701, configured to obtain a to-be-processed model and input data, where each operator of the to-be-processed model is configured with an initialization memory space, and the initialization memory space is adapted to a maximum input data dimension allowed by the to-be-processed model.
A determining module 702 is configured to determine an output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension.
The reasoning module 703 is configured to reason the model to be processed based on the input data, the output dimension of each operator, and the initialized memory space, and output a model reasoning result.
In one embodiment, the method further comprises: a second obtaining module 704, configured to obtain a maximum input data dimension allowed by the model to be processed before determining an output dimension of each operator of the model to be processed according to a data dimension of the input data. The configuration module 705 is configured to configure an initialization memory space for each operator of the model to be processed according to the maximum input data dimension, where the initialization memory space is adapted to the maximum input data dimension.
In one embodiment, the configuration module 705 is configured to determine the memory resource occupation amount of each operator according to the maximum input data dimension and the parameter configuration of each operator. And configuring an initialized memory space for each operator based on the memory resource occupation amount, wherein the resource amount of the initialized memory space is larger than or equal to the memory resource occupation amount for each operator.
In one embodiment, the determining module 702 is configured to determine whether a data dimension of the input data is greater than a maximum input data dimension. If the data dimension of the input data is larger than the maximum input data dimension, determining the output dimension of each operator in the model to be processed according to the maximum input data dimension.
In an embodiment, the determining module 702 is configured to determine, according to the data dimension of the input data, an output dimension of each operator in the model to be processed if the data dimension of the input data is less than or equal to the maximum input data dimension.
In one embodiment, the inference module 703 is configured to detect whether the current operator is configured with a preset attribute in the model inference process. If the current operator is configured with the preset attribute, updating the output dimension of the current operator based on the data received by the current operator and the parameter configuration of the current operator. Based on the updated output dimension and input data of the current operator, reasoning the current operator on an initialized memory space corresponding to the current operator to obtain a reasoning result of the current operator. And determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
In an embodiment, the inference module 703 is further configured to infer the current operator on the initialized memory space corresponding to the current operator based on the output dimension and the input data of the current operator if the current operator is not configured with the preset attribute, so as to obtain an inference result of the current operator. And determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
In an embodiment, the inference module 703 is further configured to transmit the inference result of the current operator to the next operator, and continue model inference until each operator of the to-be-processed model is traversed, so as to obtain a model inference result.
In one embodiment, the method further comprises: the creating module 706 is configured to create a topology structure of the to-be-processed model, configure preset attributes for a target operator in the to-be-processed model, and transfer the preset attributes in the topology structure before traversing each operator of the to-be-processed model and judging whether the current operator is configured with the preset attributes.
It should be noted that, the above device provided by the present application can implement all the method steps implemented by the corresponding method embodiments, and can achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those of the method embodiments in this embodiment are omitted.
Embodiments of the present application also provide a computer program product comprising one or more computer programs. When the computer program is loaded and executed on a computer, the flow or functions according to embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL), or wireless (e.g., infrared, wireless, microwave, etc.), or semiconductor medium (e.g., solid state disk, SSD)) or the like.
Embodiments of the present application also provide a computer-readable storage medium storing instructions that, when executed, cause a computer to perform a method as described in any of the above embodiments. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer readable media can include computer storage media and communication media and can include any medium that can transfer a computer program from one place to another. The storage media may be any target media that is accessible by a computer.
As one possible design, the computer-readable medium may include a compact disk read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disk storage. The computer readable medium may include disk storage or other disk storage devices. Moreover, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital versatile disc (digital versatile disc, DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (12)

1. A method of model reasoning, comprising:
acquiring a to-be-processed model and input data, wherein each operator of the to-be-processed model is configured with an initialization memory space, and the initialization memory space is adapted to the maximum input data dimension allowed by the to-be-processed model;
determining the output dimension of each operator of the model to be processed according to the data dimension of the input data and the maximum input data dimension;
And reasoning the model to be processed based on the input data, the output dimension of each operator and the initialized memory space, and outputting a model reasoning result.
2. The method of claim 1, further comprising, prior to said determining the output dimension of each operator of the model to be processed from the data dimensions of the input data:
acquiring the maximum allowable input data dimension of the model to be processed;
and configuring the initialization memory space for each operator of the model to be processed according to the maximum input data dimension, wherein the initialization memory space is adapted to the maximum input data dimension.
3. The method of claim 2, wherein configuring the initialization memory space for each operator of the model to be processed according to the maximum input data dimension, the initialization memory space being adapted to the maximum input data dimension, comprises:
determining the memory resource occupation amount of each operator according to the maximum input data dimension and the parameter configuration of each operator;
and configuring the initialized memory space for each operator based on the memory resource occupation amount, wherein the resource amount of the initialized memory space is larger than or equal to the memory resource occupation amount for each operator.
4. The method of claim 1, wherein determining the output dimension of each operator of the model to be processed from the data dimension of the input data and the maximum input data dimension comprises:
judging whether the data dimension of the input data is larger than the maximum input data dimension;
and if the data dimension of the input data is larger than the maximum input data dimension, determining the output dimension of each operator in the model to be processed according to the maximum input data dimension.
5. The method of claim 4, wherein determining the output dimension of each operator of the model to be processed from the data dimension of the input data and the maximum input data dimension further comprises:
and if the data dimension of the input data is smaller than or equal to the maximum input data dimension, determining the output dimension of each operator in the model to be processed according to the data dimension of the input data.
6. The method according to claim 1, wherein the reasoning the model to be processed based on the input data, the output dimension of each operator, and the initialized memory space, and outputting a model reasoning result includes:
In the model reasoning process, detecting whether a current operator is configured with preset attributes;
if the current operator is configured with the preset attribute, updating the output dimension of the current operator based on the data received by the current operator and the parameter configuration of the current operator;
based on the updated output dimension of the current operator and the input data, reasoning the current operator on an initialized memory space corresponding to the current operator to obtain a reasoning result of the current operator;
and determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
7. The method of claim 6, wherein the reasoning the model to be processed based on the input data, the output dimension of each operator, and the initialized memory space, outputting a model reasoning result, further comprises:
if the preset attribute is not configured by the current operator, reasoning the current operator on the initialized memory space corresponding to the current operator based on the output dimension of the current operator and the input data, so as to obtain a reasoning result of the current operator;
And determining the reasoning results of the to-be-processed model according to the reasoning results of all operators in the to-be-processed model.
8. The method according to claim 6 or 7, wherein the determining the inference result of the model to be processed according to the inference results of all operators in the model to be processed comprises:
and transmitting the reasoning result of the current operator to the next operator, and continuing model reasoning until each operator of the model to be processed is traversed, so as to obtain the model reasoning result.
9. The method according to claim 6 or 7, wherein before detecting whether the current operator is configured with a preset attribute in the model reasoning process, further comprising:
creating a topological structure of the model to be processed, configuring preset attributes for a target operator in the model to be processed, and transmitting the preset attributes in the topological structure.
10. An electronic device, comprising: a memory for storing a computer program and a processor for executing the computer program to perform the method of any of claims 1-9.
11. A computer readable storage medium storing instructions that, when executed, cause a computer to perform the method of any one of claims 1-9.
12. A computer program product comprising a computer program which, when run, causes an electronic device to perform the method of any one of claims 1-9.
CN202211172258.0A 2022-09-26 2022-09-26 Model reasoning method, device, storage medium and program product Pending CN116757284A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211172258.0A CN116757284A (en) 2022-09-26 2022-09-26 Model reasoning method, device, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211172258.0A CN116757284A (en) 2022-09-26 2022-09-26 Model reasoning method, device, storage medium and program product

Publications (1)

Publication Number Publication Date
CN116757284A true CN116757284A (en) 2023-09-15

Family

ID=87948372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211172258.0A Pending CN116757284A (en) 2022-09-26 2022-09-26 Model reasoning method, device, storage medium and program product

Country Status (1)

Country Link
CN (1) CN116757284A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030065688A1 (en) * 2001-10-01 2003-04-03 Benoit Dageville Adaptive memory allocation
CN106529679A (en) * 2016-10-14 2017-03-22 腾讯科技(上海)有限公司 Machine learning method and system
CN109583576A (en) * 2018-12-17 2019-04-05 上海联影智能医疗科技有限公司 A kind of medical image processing devices and method
CN111881315A (en) * 2020-06-24 2020-11-03 华为技术有限公司 Image information input method, electronic device, and computer-readable storage medium
CN112529169A (en) * 2019-09-18 2021-03-19 华为技术有限公司 Data processing method, model optimization device and model execution device
CN114138457A (en) * 2021-10-26 2022-03-04 杭州涿溪脑与智能研究所 Memory allocation method and device for deep learning end-side reasoning
CN114201298A (en) * 2021-12-15 2022-03-18 建信金融科技有限责任公司 Memory management method and device, electronic equipment and storage medium
CN114995822A (en) * 2022-06-07 2022-09-02 重庆大学 Deep learning compiler optimization method special for CNN accelerator
CN114995823A (en) * 2022-06-07 2022-09-02 重庆大学 Deep learning compiler optimization method for special accelerator for CNN
CN115081598A (en) * 2022-08-23 2022-09-20 北京灵汐科技有限公司 Operator processing method and device, electronic equipment and computer readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030065688A1 (en) * 2001-10-01 2003-04-03 Benoit Dageville Adaptive memory allocation
CN106529679A (en) * 2016-10-14 2017-03-22 腾讯科技(上海)有限公司 Machine learning method and system
CN109583576A (en) * 2018-12-17 2019-04-05 上海联影智能医疗科技有限公司 A kind of medical image processing devices and method
CN112529169A (en) * 2019-09-18 2021-03-19 华为技术有限公司 Data processing method, model optimization device and model execution device
CN111881315A (en) * 2020-06-24 2020-11-03 华为技术有限公司 Image information input method, electronic device, and computer-readable storage medium
CN114138457A (en) * 2021-10-26 2022-03-04 杭州涿溪脑与智能研究所 Memory allocation method and device for deep learning end-side reasoning
CN114201298A (en) * 2021-12-15 2022-03-18 建信金融科技有限责任公司 Memory management method and device, electronic equipment and storage medium
CN114995822A (en) * 2022-06-07 2022-09-02 重庆大学 Deep learning compiler optimization method special for CNN accelerator
CN114995823A (en) * 2022-06-07 2022-09-02 重庆大学 Deep learning compiler optimization method for special accelerator for CNN
CN115081598A (en) * 2022-08-23 2022-09-20 北京灵汐科技有限公司 Operator processing method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN110910872B (en) Voice interaction method and device
CN114650363B (en) Image display method and electronic equipment
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN115333941B (en) Method for acquiring application running condition and related equipment
CN112416984B (en) Data processing method and device
CN116048831B (en) Target signal processing method and electronic equipment
CN116051351B (en) Special effect processing method and electronic equipment
CN113407300B (en) Application false killing evaluation method and related equipment
CN113380240B (en) Voice interaction method and electronic equipment
CN114828098B (en) Data transmission method and electronic equipment
CN114079642B (en) Mail processing method and electronic equipment
CN117726929A (en) Image processing method and device
CN116757284A (en) Model reasoning method, device, storage medium and program product
CN116089057B (en) Resource scheduling method, device, storage medium and program product
CN117133311B (en) Audio scene recognition method and electronic equipment
CN115792431B (en) Abnormal position detection method and electronic equipment
CN115016666B (en) Touch processing method, terminal equipment and storage medium
CN116048629B (en) System service switching method, control device, electronic equipment and storage medium
CN115437601B (en) Image ordering method, electronic device, program product and medium
CN116703689B (en) Method and device for generating shader program and electronic equipment
CN116703741B (en) Image contrast generation method and device and electronic equipment
CN116757259A (en) Network model processing method, device, storage medium, and program product
CN114115772B (en) Method and device for off-screen display
CN114205318B (en) Head portrait display method and electronic equipment
CN116233599B (en) Video mode recommendation method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination