CN109657788A - Data processing method, device and Related product - Google Patents

Data processing method, device and Related product Download PDF

Info

Publication number
CN109657788A
CN109657788A CN201811554134.2A CN201811554134A CN109657788A CN 109657788 A CN109657788 A CN 109657788A CN 201811554134 A CN201811554134 A CN 201811554134A CN 109657788 A CN109657788 A CN 109657788A
Authority
CN
China
Prior art keywords
fitting
activation primitive
allocation list
input data
sampled point
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
CN201811554134.2A
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.)
Cambricon Technologies Corp Ltd
Beijing Zhongke Cambrian Technology Co Ltd
Original Assignee
Beijing Zhongke Cambrian Technology 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 Beijing Zhongke Cambrian Technology Co Ltd filed Critical Beijing Zhongke Cambrian Technology Co Ltd
Priority to CN201811554134.2A priority Critical patent/CN109657788A/en
Publication of CN109657788A publication Critical patent/CN109657788A/en
Priority to CN201911309819.5A priority patent/CN111126581B/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Neurology (AREA)
  • Machine Translation (AREA)
  • Stored Programmes (AREA)

Abstract

This application involves a kind of data processing method, device and Related product, the Related product includes board, and the board includes: multiple artificial intelligence process devices, saves as multichannel memory in the multiple artificial intelligence process device is corresponding;Wherein, the artificial intelligent processor of target is used for after receiving the artificial intelligence process device computations that general processor CPU is issued by target parallel thread, passes through main memory access corresponding with the target parallel thread.The smooth operation in neural network processor of customized activation primitive can be realized using this method.

Description

Data processing method, device and Related product
Technical field
This application involves field of artificial intelligence, more particularly to a kind of data processing method, device and related production Product.
Background technique
With the development of artificial intelligence technology, there are various neural network algorithms, and activating operation is nerve Very important calculating step in network algorithm.In existing neural network processor, the activation primitive type of support is seldom, Only it is no more than ten kinds.
Existing neural network processor during handling activation primitive to the type poor compatibility of activation primitive, Customized activation primitive can not be handled.
Summary of the invention
Based on this, it is necessary to for existing neural network processor to activation primitive during handling activation primitive Type poor compatibility, the problem of can not handling customized activation primitive, provide a kind of data processing method, dress It sets and Related product.
A kind of data processing method, which comprises
Obtain the fitting allocation list and input data of activation primitive;
Judge that the input data corresponds to the piecewise interval in the fitting allocation list;
The piecewise interval in the fitting allocation list is corresponded to according to the input data, determines the input data in institute State corresponding configuration information in fitting allocation list;
Fitting operation is executed to the input data according to the configuration information, obtains the output number of the activation primitive According to.
It is described in one of the embodiments, that fitting operation is executed to the input data according to the configuration information, it obtains Output data to the activation primitive includes:
Obtain hardware instruction set;
According to the hardware instruction set and the configuration information, compiling generates control instruction;
The control instruction is translated as machine instruction;
Fitting operation is executed to the input data according to the configuration information and machine instruction, obtains the activation letter Several output datas.
The segment identifier corresponded to according to the input data in the fitting allocation list in one of the embodiments, Between, determine that the input data corresponding configuration information in the fitting allocation list includes:
According to the input data, the interval fitting function of each piecewise interval is determined.
The segment identifier corresponded to according to the input data in the fitting allocation list in one of the embodiments, Between, determine that the input data corresponding configuration information in the fitting allocation list includes:
Obtain the quasi- configuration function of the activation primitive;
According to the input data, the fitting parameter of each piecewise interval in the fitting allocation list is determined;
According to the fitting parameter, configuration obtains the configuration fitting that each piecewise interval corresponds to the quasi- configuration function Function.
The method also includes creations to be fitted allocation list in one of the embodiments, and the creation is fitted allocation list packet Include following steps:
Obtain activation primitive;
The sampled point of the activation primitive is chosen according to preset rules;
The functional value of each sampled point is calculated according to the activation primitive;
Operation is fitted to the activation primitive according to the functional value of the sampled point and the sampled point, is obtained It is fitted allocation list.
The acquisition activation primitive includes: in one of the embodiments,
Obtain the domain of the activation primitive;And
Obtain the cutting number of segment of the activation primitive.
The sampled point that the activation primitive is chosen according to preset rules in one of the embodiments, comprising:
According to the cutting number of segment, the sampled point is chosen in each segmentation.
It is described in one of the embodiments, to be swashed according to the functional value of the sampled point and the sampled point to described Function living is fitted operation, obtains fitting allocation list and includes:
Operation is fitted to the activation primitive by least square method, obtains fitting allocation list.
A kind of data processing equipment, described device include:
Interface module, for obtaining the fitting allocation list and input data of activation primitive;
Comparison module, for judging that the input data corresponds to the piecewise interval in the fitting allocation list;And it is used for The piecewise interval in the fitting allocation list is corresponded to according to the input data, determines corresponding in the fitting allocation list match Confidence breath;
Computing module obtains described sharp for executing fitting operation to the input data according to the fitting allocation list The output data of function living.
The computing module includes hardware instruction set acquiring unit, compilation unit in one of the embodiments,;
The hardware instruction set acquiring unit is for obtaining hardware instruction set;
The compilation unit is used for according to the hardware instruction set and the fitting allocation list, and compiling generates control instruction.
Described device further includes decoding module and output data generation module in one of the embodiments,;
The decoding module, for the control instruction to be translated as machine instruction;
The output data generation module, for being held according to the configuration information and machine instruction to the input data Row fitting operation obtains the output data of the activation primitive.
The comparison module in one of the embodiments, further include:
Interval fitting function determination unit, for determining that the section of each piecewise interval is quasi- according to the input data Close function.
The comparison module in one of the embodiments, further include:
Quasi- configuration function acquiring unit, for obtaining the quasi- configuration function of the activation primitive;
Fitting parameter determination unit, for determining each described point in the fitting allocation list according to the input data The fitting parameter in section section;
Fitting function determination unit is configured, for according to the fitting parameter, it is corresponding that configuration obtains each piecewise interval The configuration fitting function of the quasi- configuration function.
Described device further includes fitting allocation list creation module in one of the embodiments, the fitting allocation list wound Model block further include:
Activation primitive acquiring unit, for obtaining activation primitive;
Sampling unit, for choosing the sampled point of the activation primitive according to preset rules;
The Fitting Calculation unit for calculating the functional value of each sampled point according to the activation primitive, and is used for root Operation is fitted to the activation primitive according to the functional value of the sampled point and the sampled point, obtains fitting allocation list.
The activation primitive acquiring unit includes: in one of the embodiments,
Domain acquiring unit, for obtaining the domain of the activation primitive;
Cutting number of segment acquiring unit, for obtaining the cutting number of segment of the activation primitive.
The sampling unit includes: in one of the embodiments,
Sampled point selection unit, for choosing the sampled point in each segmentation according to the cutting number of segment.
The Fitting Calculation unit includes: in one of the embodiments,
Least square method arithmetic element is obtained for being fitted operation to the activation primitive by least square method It is fitted allocation list.
A kind of board is applied in Heterogeneous Computing framework, and the board includes: multiple artificial intelligence process devices, described more Multichannel memory is saved as in a artificial intelligent processor is corresponding;Wherein, the artificial intelligent processor of target is for passing through target Parallel thread receive general processor CPU issue artificial intelligence process device computations after, by with the target parallel line The corresponding main memory access of journey, according to the artificial intelligence process device computations to the corresponding physical memory of the main memory access It accesses;The artificial intelligent processor of target is any artificial intelligence process in the multiple artificial intelligence process device Device, the target parallel thread are any of multiple parallel threads of CPU starting;In the multiple parallel thread At least different main memory accesses is corresponded to there are two thread.
A kind of mainboard is applied in Heterogeneous Computing framework, and the mainboard includes: general processor CPU and above-mentioned plate Card.
A kind of electronic equipment is applied in Heterogeneous Computing framework, and the electronic equipment includes such as above-mentioned mainboard.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor The step of any of the above embodiment the method is realized when row.
Above-mentioned data processing method, device and Related product are determined in fitting allocation list by input data and match confidence Breath executes fitting operation to input data, obtains output data of the activation primitive after over-fitting, realize customized activation Function smooth operation in neural network processor, so that neural network processor has the execution of different activation primitives Preferably compatibility.
Detailed description of the invention
Fig. 1 is the application apparatus figure of data processing method in one embodiment;
Fig. 2 is the flow diagram of data processing method in one embodiment;
Fig. 3 is to execute fitting operation in one embodiment to the input data according to the configuration information, obtain institute State the flow diagram of the output data step of activation primitive;
Fig. 4 is the flow diagram of creation fitting allocation list step in one embodiment;
Fig. 5 is to be fitted the schematic device of allocation list creation module and neural network processor in one embodiment;
Fig. 6 is the board structure schematic diagram for data processing in an embodiment;
Fig. 7 is the mainboard structure schematic diagram for data processing in an embodiment.
Specific embodiment
In order to which the objects, technical solutions and advantages of the application are more clearly understood, with reference to the accompanying drawings and embodiments, The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, It is not used to limit the application.
Data processing method provided by the present application can be applied in application environment as shown in Figure 1.It is answered shown in Fig. 1 With in environment include development of neural networks device 100 and Processing with Neural Network device 200.It is refreshing in one of the embodiments, The activation primitive of input is obtained through network development device 100.Further, development of neural networks device 100 is according to preset rules Sampling processing is carried out to activation primitive, obtains fitting allocation list.Development of neural networks device 100 in one of the embodiments, Fitting allocation list is sent to Processing with Neural Network device 200.Further, Processing with Neural Network device 200 obtains activation letter Several fitting allocation lists and input data, and determine input data corresponding configuration information in the fitting allocation list;More into One step, Processing with Neural Network device 200 executes fitting operation to input data according to configuration information, obtains activation primitive Output data.
In one embodiment, as shown in Fig. 2, providing a kind of data processing method, it is applied in Fig. 1 in this way Development of neural networks device 100 and Processing with Neural Network device 200 for be illustrated, comprising the following steps:
Step S202 obtains the fitting allocation list and input data of activation primitive.Wherein, fitting allocation list refers to sharp Function living is fitted the information table of processing institute's reference.It can determine the process of fitting treatment to activation primitive according to fitting allocation list Method.Wherein, the input data refers to the data that operation is carried out using activation primitive.
Step S204 judges that the input data corresponds to the piecewise interval in the fitting allocation list.Specifically, it is fitted There can be multiple continuous piecewise intervals in allocation list, piecewise interval forms the domain of activation primitive.It is to be appreciated that defeated Entering data is the data in domain, and then input data corresponds to the piecewise interval in fitting allocation list.Wherein, domain is The value range of activation primitive independent variable.
Step S206 corresponds to the piecewise interval in the fitting allocation list according to the input data, determines the input Data corresponding configuration information in the fitting allocation list.Specifically, each section of piecewise interval can correspond to respective configuration Information.Piecewise interval, and then the corresponding configuration information of available input data can be determined according to input data.Wherein, match Confidence breath refers to the information that processing is fitted to fitting function.
Step S208 executes fitting operation to the input data according to the configuration information, obtains the activation primitive Output data.Specifically, the treatment process specifically executed according to configuration information to input data is carried out to activation primitive Fitting obtains the treatment process of the output data of fitting function.
Above-mentioned data processing method determines the configuration information in fitting allocation list by input data, holds to input data Row fitting operation obtains output data of the activation primitive after over-fitting.Customized activation primitive is realized at neural network Smooth operation in device is managed, so that neural network processor has better compatibility to the execution of different activation primitives.
In one embodiment, include: also referring to Fig. 3, step S208
Step S2081 obtains hardware instruction set.Wherein, hardware instruction set is the base instruction format of hardware device.? In one embodiment, hardware instruction set refers to the base instruction format that neural network processor is applicable in.
Step S2082, according to the hardware instruction set and the configuration information, compiling generates control instruction.Specifically, The configuration information that development of neural networks tool 100 generates is sent to Processing with Neural Network device 200, Processing with Neural Network device 200 cannot directly read configuration information.For this purpose, Processing with Neural Network device 200 or development of neural networks tool 100 will bases The base instruction of Processing with Neural Network device 200 generates the control instruction of corresponding configuration information.
The control instruction is translated as machine instruction by step S2083.Specifically, raw by the compiling of step S2082 At control instruction be transferred to cannot be directly by machine recognition after Processing with Neural Network device 200.Further, neural network Processing unit 200 decodes control instruction, and control instruction translation can directly be known at Processing with Neural Network device 200 Other machine instruction.Machine instruction is binary instruction in one of the embodiments,.
Step S2084 executes fitting operation to the input data according to the configuration information and machine instruction, obtains The output data of the activation primitive.Specifically, Processing with Neural Network device 200 is by identification machine instruction, according to input number It is fitted allocation list according to reading, obtains the configuration information for corresponding to input data in fitting allocation list.Further, according to confidence Breath determines the treatment process specifically executed to input data, is completed by machine instruction control neural network processing unit 200 Fitting operation obtains the output data of activation primitive.
Step S204 includes: step S2041a in one of the embodiments, according to the input data, determines each institute State the interval fitting function of piecewise interval.Specifically, interval fitting function refers to the fitting letter for respectively corresponding each piecewise interval Number, i.e., a piecewise interval can correspond to an interval fitting function.Optionally, interval fitting function can be different , it is also possible to all identical, can also be that part same section is different.
As a kind of specific embodiment, the domain of activation primitive is [0,16], section [0,8) in section Fitting function is y=2x+1, and the interval fitting function in section [8,16] is y=2x2+ 3x+4 then gathers allocation list such as Under:
Value starting point Xstart Value terminal Xend Fitting function
0 8 Y=2x+1
8 16 Y=2x2+3x+4
When input data section [0,8) when, then by interval fitting function y=2x+1 calculate output data, such as when Input data is 6, then reads following configuration information:
0 8 Y=2x+1
According to above-mentioned configuration information, corresponding fitting operation, i.e. y=2*6+1=13 are executed to input data 6, then input number It is 13 according to 6 corresponding output datas.
In another embodiment, step S204 includes:
Step S2041b obtains the quasi- configuration function of the activation primitive.Specifically, quasi- configuration function, which refers to, is carrying out Before fitting operation, the function classification that operation is fitted to activation primitive is preset.Such as quasi- configuration function may include: Unitary linear function, One- place 2-th Order function, direct proportion function, inverse proportion function.
Step S2042 determines the quasi- of each piecewise interval in the fitting allocation list according to the input data Close parameter.Specifically, fitting parameter is the parameter in addition to independent variable and dependent variable in quasi- configuration function, such as unitary one Slope and intercept in secondary function.
Step S2043, according to the fitting parameter, configuration obtains each piecewise interval and corresponds to the quasi- configuration function Configuration fitting function.Specifically, each quasi- configuration function corresponds to a kind of function type.And then a kind of function type can be right Answer multiple and different specific functions.When fitting parameter determines that then corresponding specific function also determines that.Such as y=ax, Then when fitting parameter a is assigned 1, then can obtain specifically configuring fitting function y=x.
As a kind of specific embodiment, intending configuration function is y=kx+b, and domain is [0,16], then is fitted configuration Table is as follows:
Value starting point Xstart Value terminal Xend k b
0 8 1 1
8 16 2 3
When input data is 6, then corresponding configuration information is read:
0 8 1 1
It is y=1*6+1=7 that information, which obtains the output data of input data 6, according to above configured.
Through the foregoing embodiment, so that determining characteristic parameter or fitting function in each segmentation by being fitted allocation list, Operation efficiency can be improved convenient for the operation result after being conveniently fitted in activation primitive implementation procedure.
In one embodiment, as shown in figure 4, the method also includes creations to be fitted allocation list, the creation fitting is matched Table is set to include the following steps:
Step S2010 obtains activation primitive.Specifically, each neuron node in neural network receives upper one layer of mind Input value of the output valve through member as this neuron, and input value is passed into next layer, input layer node can incite somebody to action Attribute value is directly passed to next layer.In multilayer neural network, the output of upper layer node and the input of lower level node it Between there is a functional relation, this function is known as activation primitive.Optionally, activation primitive may include ReLU, sigmoid, Tanh, ReLU1 and ReLU6.Scene according to different needs, customized activation primitive can be it is diversified, such as ReLU5:
Step S2012 chooses the sampled point of the activation primitive according to preset rules.
Wherein, the sampled point of activation primitive refers to the independent variable chosen in activation primitive image according to pre-defined rule Value.Specifically, the preset rules for choosing sampled point, which can be, equidistantly to be chosen or randomly selects, can also according to other rule into Row is chosen.
Step S2014 calculates the functional value of each sampled point according to the activation primitive.Specifically, according to activation letter Several and independent variable value, is calculated the functional value of corresponding sampled point.
Step S2016 is fitted the activation primitive according to the functional value of the sampled point and the sampled point Operation obtains fitting allocation list.Wherein, the activation primitive of script image complexity, variation multiplicity can be intended by fitting operation It is combined into the combination of simple function image, the calculating process of activation primitive is simplified, improves operation efficiency.Optionally, fitting fortune Calculating can be realized by least square method and/or quadratic fit.The operation of activation operation is simplified through the foregoing embodiment Journey improves the treatment effeciency of activation primitive.
In one embodiment, step S2010, obtaining activation primitive includes:
Obtain the activation primitive domain;And obtain the cutting number of segment of the activation primitive respective function image.
Specifically, activation primitive image refers to the figure that the relationship by independent variable and functional value shows in a coordinate system Picture.Cutting number of segment, which refers to, is segmented the activation primitive in domain.It in one of the embodiments, will be in domain Independent variable be segmented.It is to be appreciated that number of fragments depend on function curve shape and the requirement to precision, minimum 1 Section, does not limit at most.Specifically, if necessary to it is high-precision as a result, activation primitive image it is more complicated, then segmentation compared with It is more.For example, sigmoid function can divide 60 sections.In another embodiment, if it is not high to required precision, if activation letter Number images are fairly simple, then are segmented less, such as ReLU function can divide 2 sections.Through the foregoing embodiment, by activation primitive point Section processing, can be fitted entire activation primitive by different specific functions, be more nearly the primary characteristic of activation primitive, So that fitting result is more accurate.
In one embodiment, step S2012 chooses the sampled point of the activation primitive according to preset rules, comprising:
According to the cutting number of segment, the sampled point is chosen in each segmentation.
Optionally, sampling can take equidistant sampling, such as every section etc. point 19 parts in segmentation.One embodiment wherein In, 20 sampling points can be adopted in the border segment of activation primitive.Certainly, it sampling number and is not fixed, is also not necessarily limited to above-mentioned equidistant sampling Method, other method of samplings such as stochastical sampling can also be with.
The length of each segmentation is identical in one of the embodiments, and the sampling number in each segmentation is also identical.? In another embodiment, the length of each segmentation is different, and the sampling number in every section is also different.
As a kind of specific embodiment, in sigmoid function, functional image is divided into 60 sections, every section of equidistant choosing Take 20 sampled points.
It should be understood that although each step in Fig. 2-4 flow chart is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, these steps can execute in other order.Moreover, at least one in Fig. 2-4 Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in same a period of time to multiple sub-steps Quarter executes completion, but can execute at different times, the execution in these sub-steps or stage be sequentially also not necessarily according to Secondary progress, but in turn or can be handed over at least part of the sub-step or stage of other steps or other steps Alternately execute.
In one embodiment, please refer to fig. 5, providing a kind of fitting allocation list creation module 110 and a kind of mind Through network processing unit 120.
Wherein, fitting allocation list creation module 110 can be software, can also be the hardware device for being stored with software, wrap Activation primitive acquiring unit 111, sampling unit 112, the Fitting Calculation unit 113, hardware interactive unit 115 and control is included to refer to Enable 114 (not shown) of generation unit.
In one embodiment, activation primitive acquiring unit 111 is for obtaining activation primitive;Sampling unit 112, is used for The sampled point of the activation primitive is chosen according to preset rules;The Fitting Calculation unit 113, for calculating the letter of the sampled point Numerical value;And
For being fitted operation to the activation primitive according to the functional value of the sampled point and the sampled point, Obtain fitting allocation list.
Interface module 121 includes that domain obtains module and cutting number of segment acquisition module in one of the embodiments, The domain obtains module for obtaining the activation primitive domain;
The cutting number of segment obtains the cutting number of segment that module is used to obtain the activation primitive image.
Sampling module 112 in one of the embodiments, further include: sampled point chooses module, for according to the cutting Number of segment chooses the sampled point in each segmentation.
The Fitting Calculation unit 113 further includes least square method computing module in one of the embodiments, for passing through Least square method is fitted operation to the activation primitive, obtains fitting allocation list.
Hardware interactive unit 115 is used for the control instruction and fitting allocation list hair in one of the embodiments, It send to the neural network processor 120.Specifically, hardware interactive unit 115 is the communication interface of software and hardware.At it In middle one embodiment, hardware interactive unit 115 includes the data copy function that driver provides, and data copy function will Binary instruction in fitting allocation list creation module 110 copies into the memory module 123 of neural network processor.
Specific restriction about fitting allocation list creation module 110 may refer to above for data processing method It limits.Modules in above-mentioned fitting allocation list creation module 110 can be fully or partially through software, hardware and combinations thereof To realize.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with soft Part form is stored in the memory in computer equipment, executes the corresponding behaviour of the above modules in order to which processor calls Make.
In one embodiment, neural network processor 120 includes interface module 121, comparison module 122 and operation Module 124.Neural network processor 120 can also include memory module 123 in one of the embodiments,.Neural network is opened Fitting allocation list or control instruction can be sent in the memory module 123 of neural network processor 120 by hair tool 110.Into One step, interface module 121 can read fitting allocation list and control instruction from memory module 123.The interface module 121 for obtaining fitting allocation list and input data.Optionally, interface module 121 is also used to obtain control instruction.
Interface module 121 obtains the fitting allocation list and input data of activation primitive in one of the embodiments,.? In another embodiment, interface module 121 is used to receive the fitting allocation list and input data of the transmission of storage unit 123.At it In middle one embodiment, the comparison module 122 is used to judge that the input data to correspond to the segmentation in the fitting allocation list Section;And for corresponding to the piecewise interval in the fitting allocation list according to the input data, determine the fitting configuration Corresponding configuration information in table.The comparison module 122 is connected with the computing module 124 in one of the embodiments, The computing module 124 is used to execute fitting operation to the input data according to the fitting allocation list, obtains the activation The output data of function.The interface module 121 can be also used for sending out the output data in one of the embodiments, It send to the neural network processor 120.
The computing module 124 includes hardware instruction set acquiring unit, compilation unit in one of the embodiments,;
The hardware instruction set acquiring unit is for obtaining hardware instruction set;
The compilation unit is used for according to the hardware instruction set and the fitting allocation list, and compiling generates control instruction.
Described device further includes decoding module 125 and output data generation module 126 in one of the embodiments,;
The decoding module 125, for the control instruction to be translated as machine instruction;
The output data generation module 126, for according to the fitting allocation list, the input data and described Machine instruction obtains the output data of the activation primitive.
The comparison module also 122 includes: in one of the embodiments,
Interval fitting function determination unit, for determining that the section of each piecewise interval is quasi- according to the input data Close function.
In another embodiment, the comparison module 122 further include:
Quasi- configuration function acquiring unit, for obtaining the quasi- configuration function of the activation primitive;
Fitting parameter determination unit, for determining each described point in the fitting allocation list according to the input data The fitting parameter in section section;
Fitting function determination unit is configured, for according to the fitting parameter, it is corresponding that configuration obtains each piecewise interval The configuration fitting function of the quasi- configuration function.
It can be embedded in the form of hardware in above-mentioned neural network processor 120 or independently of the processing in computer equipment In device.
In one embodiment, the application also provides a kind of board, which is applied to Neural Network Data processing method In, which may include: multiple artificial intelligence process devices, save as in multichannel in multiple artificial intelligence process devices are corresponding It deposits;Wherein, the artificial intelligent processor of target is used to receive the artificial intelligence process device that CPU is issued by target parallel thread After computations, by main memory access corresponding with the target parallel thread, referred to according to artificial intelligence process device calculating Order accesses to the corresponding physical memory of the main memory access;The artificial intelligent processor of target is the multiple artificial Any artificial intelligence process device in intelligent processor, the target parallel thread are multiple parallel threads of CPU starting Any of;Different main memory accesses at least is corresponded to there are two thread in the multiple parallel thread.
Shown in Figure 6, above-mentioned board is in addition to including that (application specific processor 11 can for above-mentioned multiple artificial intelligence process devices 111 To include multiple artificial intelligence process devices 111) and multichannel memory 12 except, can also include other matching components.This is mating Component includes but is not limited to: Memory Controller Hub 13, bus, interface 14.Application specific processor 11 by interface 14 and external equipment it Between carry out instruction transmission and data transmission.Optionally, external equipment can be general processor (CPU) 10.
Board provided in this embodiment can execute above method embodiment, and it is similar that the realization principle and technical effect are similar, Details are not described herein.
In one embodiment, the application also provides a kind of mainboard, is applied in Neural Network Data processing method, such as Shown in Fig. 7, which includes: general processor (CPU) 10 and board provided by the above embodiment, which includes multiple people Work intelligent processor 111 saves as multichannel memory in multiple artificial intelligence process devices 111 are corresponding;Wherein, the artificial intelligence of target Can processor be used for by target parallel thread receive CPU issue artificial intelligence process device computations after, by with institute The corresponding main memory access of target parallel thread is stated, according to the artificial intelligence process device computations to the main memory access pair The physical memory answered accesses;The artificial intelligent processor of target is any in the multiple artificial intelligence process device Artificial intelligence process device, the target parallel thread are any of multiple parallel threads of CPU starting;It is described more Different main memory accesses at least is corresponded to there are two thread in a parallel thread.
Mainboard provided in this embodiment can execute above method embodiment, and it is similar that the realization principle and technical effect are similar, Details are not described herein.
In one embodiment, a kind of electronic equipment is provided, the electronic apparatus application is in Heterogeneous Computing framework, the electricity Sub- equipment includes mainboard as shown in Figure 7.The mainboard includes CPU and board, and board includes multiple artificial intelligence process devices, more Multichannel memory is saved as in a artificial intelligent processor is corresponding;Wherein, the artificial intelligent processor of target is for passing through target Parallel thread receive general processor CPU issue artificial intelligence process device computations after, by with the target parallel line The corresponding main memory access of journey, according to the artificial intelligence process device computations to the corresponding physical memory of the main memory access It accesses;The artificial intelligent processor of target is any artificial intelligence process in the multiple artificial intelligence process device Device, the target parallel thread are any of multiple parallel threads of CPU starting;In the multiple parallel thread At least different main memory accesses is corresponded to there are two thread.
Optionally, electronic equipment may include data processing equipment, robot, computer, printer, scanner, plate electricity Brain, intelligent terminal, mobile phone, automobile data recorder, navigator, sensor, camera, server, cloud server, camera, camera shooting Machine, projector, wrist-watch, earphone, mobile storage, wearable device, the vehicles, household electrical appliance, and/or Medical Devices.It is described The vehicles include aircraft, steamer and/or vehicle;The household electrical appliance include TV, air-conditioning, micro-wave oven, refrigerator, electric cooker, Humidifier, washing machine, electric light, gas-cooker, kitchen ventilator;The Medical Devices include Nuclear Magnetic Resonance, B ultrasound instrument and/or electrocardio Figure instrument.
Electronic equipment provided in this embodiment can execute above method embodiment, implementing principle and technical effect class Seemingly, details are not described herein.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is counted The step of any of the above embodiment the method is realized when calculation machine program is executed by processor.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can It is completed with instructing relevant hardware by computer program, the computer program can be stored in a non-volatile meter In calculation machine read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method. Wherein, any of memory, storage, database or other media is drawn used in each embodiment provided herein With may each comprise non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), can Programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile storage Device may include random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is with more Kind form can obtain, such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the guarantor of the application Protect range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (21)

1. a kind of data processing method, which is characterized in that the described method includes:
Obtain the fitting allocation list and input data of activation primitive;
Judge that the input data corresponds to the piecewise interval in the fitting allocation list;
The piecewise interval in the fitting allocation list is corresponded to according to the input data, determines the input data in the fitting Corresponding configuration information in allocation list;
Fitting operation is executed to the input data according to the configuration information, obtains the output data of the activation primitive.
2. the method according to claim 1, wherein described hold the input data according to the configuration information Row fitting operation, the output data for obtaining the activation primitive includes:
Obtain hardware instruction set;
According to the hardware instruction set and the configuration information, compiling generates control instruction;
The control instruction is translated as machine instruction;
Fitting operation is executed to the input data according to the configuration information and machine instruction, obtains the defeated of the activation primitive Data out.
3. the method according to claim 1, wherein described correspond to the fitting configuration according to the input data Piecewise interval in table determines that the input data corresponding configuration information in the fitting allocation list includes:
According to the input data, the interval fitting function of each piecewise interval is determined.
4. the method according to claim 1, wherein described correspond to the fitting configuration according to the input data Piecewise interval in table determines that the input data corresponding configuration information in the fitting allocation list includes:
Obtain the quasi- configuration function of the activation primitive;
According to the input data, the fitting parameter of each piecewise interval in the fitting allocation list is determined;
According to the fitting parameter, configuration obtains the configuration fitting function that each piecewise interval corresponds to the quasi- configuration function.
5. the method according to claim 1, wherein the method also includes creations to be fitted allocation list, the wound Fitting allocation list is built to include the following steps:
Obtain activation primitive;
The sampled point of the activation primitive is chosen according to preset rules;
The functional value of each sampled point is calculated according to the activation primitive;
Operation is fitted to the activation primitive according to the functional value of the sampled point and the sampled point, fitting is obtained and matches Set table.
6. according to the method described in claim 5, it is characterized in that, the acquisition activation primitive includes:
Obtain the domain of the activation primitive;And
Obtain the cutting number of segment of the activation primitive.
7. according to the method described in claim 5, it is characterized in that, described choose adopting for the activation primitive according to preset rules Sampling point, comprising:
According to the cutting number of segment, the sampled point is chosen in each segmentation.
8. according to the method described in claim 5, it is characterized in that, described according to the sampled point and the letter of the sampled point Numerical value is fitted operation to the activation primitive, obtains fitting allocation list and includes:
Operation is fitted to the activation primitive by least square method, obtains fitting allocation list.
9. a kind of data processing equipment, which is characterized in that described device includes:
Interface module, for obtaining the fitting allocation list and input data of activation primitive;
Comparison module, for judging that the input data corresponds to the piecewise interval in the fitting allocation list;And it is used for basis The input data corresponds to the piecewise interval in the fitting allocation list, determines corresponding with confidence in the fitting allocation list Breath;
Computing module obtains the activation letter for executing fitting operation to the input data according to the fitting allocation list Several output datas.
10. device according to claim 9, which is characterized in that the computing module includes:
Hardware instruction set acquiring unit, compilation unit;
The hardware instruction set acquiring unit is for obtaining hardware instruction set;
The compilation unit is used for according to the hardware instruction set and the fitting allocation list, and compiling generates control instruction.
11. device according to claim 10, which is characterized in that described device further includes that decoding module and output data are raw At module;
The decoding module, for the control instruction to be translated as machine instruction;
The output data generation module, for executing fitting to the input data according to the configuration information and machine instruction Operation obtains the output data of the activation primitive.
12. device according to claim 9, which is characterized in that the comparison module further include:
Interval fitting function determination unit, for determining the interval fitting letter of each piecewise interval according to the input data Number.
13. device according to claim 9, which is characterized in that the comparison module further include:
Quasi- configuration function acquiring unit, for obtaining the quasi- configuration function of the activation primitive;
Fitting parameter determination unit, for determining each segment identifier in the fitting allocation list according to the input data Between fitting parameter;
Fitting function determination unit is configured, for according to the fitting parameter, configuration to be obtained described in each piecewise interval correspondence The configuration fitting function of quasi- configuration function.
14. device according to claim 9, which is characterized in that described device further includes fitting allocation list creation module, institute State fitting allocation list creation module further include:
Activation primitive acquiring unit, for obtaining activation primitive;
Sampling unit, for choosing the sampled point of the activation primitive according to preset rules;
The Fitting Calculation unit, for calculating the functional value of each sampled point according to the activation primitive, and for according to institute The functional value for stating sampled point and the sampled point is fitted operation to the activation primitive, obtains fitting allocation list.
15. device according to claim 14, which is characterized in that the activation primitive acquiring unit includes:
Domain acquiring unit, for obtaining the domain of the activation primitive;
Cutting number of segment acquiring unit, for obtaining the cutting number of segment of the activation primitive.
16. device according to claim 14, which is characterized in that the sampling unit includes:
Sampled point selection unit, for choosing the sampled point in each segmentation according to the cutting number of segment.
17. device according to claim 9, which is characterized in that the Fitting Calculation unit includes:
Least square method arithmetic element is fitted for being fitted operation to the activation primitive by least square method Allocation list.
18. a kind of board, which is characterized in that be applied in Neural Network Data processing, the board includes: multiple artificial intelligence Processor, the multiple artificial intelligence process device it is corresponding in save as multichannel memory;Wherein, the artificial intelligent processor of target is used In by target parallel thread receive general processor CPU issue artificial intelligence process device computations after, by with institute The corresponding main memory access of target parallel thread is stated, it is corresponding to the main memory access according to the artificial intelligence process device computations Physical memory access;The artificial intelligent processor of target is any artificial in the multiple artificial intelligence process device Intelligent processor, the target parallel thread are any of multiple parallel threads of CPU starting;It is the multiple parallel Different main memory accesses at least is corresponded to there are two thread in thread.
19. a kind of mainboard, which is characterized in that be applied in Neural Network Data processing, the mainboard includes: general processor CPU and board as claimed in claim 18.
20. a kind of electronic equipment, which is characterized in that be applied in Neural Network Data processing, the electronic equipment includes as weighed Benefit require 19 described in mainboard.
21. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any item of the claim 1 to 8 is realized when being executed by processor.
CN201811554134.2A 2018-12-18 2018-12-18 Data processing method, device and Related product Pending CN109657788A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811554134.2A CN109657788A (en) 2018-12-18 2018-12-18 Data processing method, device and Related product
CN201911309819.5A CN111126581B (en) 2018-12-18 2019-12-18 Data processing method and device and related products

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811554134.2A CN109657788A (en) 2018-12-18 2018-12-18 Data processing method, device and Related product

Publications (1)

Publication Number Publication Date
CN109657788A true CN109657788A (en) 2019-04-19

Family

ID=66114864

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201811554134.2A Pending CN109657788A (en) 2018-12-18 2018-12-18 Data processing method, device and Related product
CN201911309819.5A Active CN111126581B (en) 2018-12-18 2019-12-18 Data processing method and device and related products

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201911309819.5A Active CN111126581B (en) 2018-12-18 2019-12-18 Data processing method and device and related products

Country Status (1)

Country Link
CN (2) CN109657788A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110796247A (en) * 2020-01-02 2020-02-14 深圳芯英科技有限公司 Data processing method, device, processor and computer readable storage medium
CN111191779A (en) * 2020-01-02 2020-05-22 深圳芯英科技有限公司 Data processing method, device, processor and computer readable storage medium
CN111191766A (en) * 2020-01-02 2020-05-22 深圳芯英科技有限公司 Data processing method, device, processor and computer readable storage medium
CN113705821A (en) * 2021-08-24 2021-11-26 山东浪潮科学研究院有限公司 Method, device and medium for realizing waveform drawing of ADC (analog to digital converter) board card based on PCIE (peripheral component interface express)
US11681904B2 (en) 2019-08-13 2023-06-20 Samsung Electronics Co., Ltd. Processor chip and control methods thereof

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378012B (en) * 2021-06-30 2023-10-24 上海思朗科技有限公司 Data processing method, device and system
CN115908870A (en) * 2022-10-19 2023-04-04 海南港航控股有限公司 Image-text matching method and system based on heterogeneous data fusion

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04507026A (en) * 1990-05-22 1992-12-03 インターナショナル・ビジネス・マシーンズ・コーポレーション Learning Machine Synapse Processor System Device
TW200924343A (en) * 2007-11-28 2009-06-01 Univ Chung Yuan Christian Reactive power demand forecasting using feed-forward neural network technique and method thereof
CN105512723A (en) * 2016-01-20 2016-04-20 南京艾溪信息科技有限公司 Artificial neural network calculating device and method for sparse connection
US20170103313A1 (en) * 2015-05-21 2017-04-13 Google Inc. Neural Network Processor
CN107861916A (en) * 2017-11-10 2018-03-30 中国科学院计算技术研究所 A kind of method and apparatus for being used to perform nonlinear operation for neutral net
CN108205518A (en) * 2016-12-19 2018-06-26 上海寒武纪信息科技有限公司 Obtain device, method and the neural network device of functional value
CN108427990A (en) * 2016-01-20 2018-08-21 北京中科寒武纪科技有限公司 Neural computing system and method
CN108647045A (en) * 2018-03-20 2018-10-12 科大讯飞股份有限公司 The implementation method and device of activation primitive, storage medium, electronic equipment
US20180300614A1 (en) * 2017-04-17 2018-10-18 Microsoft Technology Licensing, Llc Power-efficient deep neural network module configured for executing a layer descriptor list
CN108898216A (en) * 2018-05-04 2018-11-27 中国科学院计算技术研究所 Activation processing unit applied to neural network
CN108921288A (en) * 2018-05-04 2018-11-30 中国科学院计算技术研究所 Neural network activates processing unit and the neural network processor based on the device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6124542A (en) * 1999-07-08 2000-09-26 Ati International Srl Wavefunction sound sampling synthesis
CN101881954B (en) * 2009-05-06 2013-07-10 陈学恭 Novel interpolation method for setting substitution curve
CN103528840B (en) * 2013-09-29 2016-03-30 天津大学 Based on the modulation transfer function measurement method of x-ray imaging system detector charactorizations
CN107341541B (en) * 2016-04-29 2021-01-29 中科寒武纪科技股份有限公司 Apparatus and method for performing full connectivity layer neural network training
CN105893159B (en) * 2016-06-21 2018-06-19 北京百度网讯科技有限公司 Data processing method and device
CN107729984A (en) * 2017-10-27 2018-02-23 中国科学院计算技术研究所 A kind of computing device and method suitable for neutral net activation primitive
CN108710944A (en) * 2018-04-30 2018-10-26 南京大学 One kind can train piece-wise linear activation primitive generation method
CN109857978B (en) * 2019-01-17 2024-03-26 上海上塔软件开发有限公司 Online self-adaptive segmentation algorithm suitable for power curve of household electrical appliance

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04507026A (en) * 1990-05-22 1992-12-03 インターナショナル・ビジネス・マシーンズ・コーポレーション Learning Machine Synapse Processor System Device
TW200924343A (en) * 2007-11-28 2009-06-01 Univ Chung Yuan Christian Reactive power demand forecasting using feed-forward neural network technique and method thereof
US20170103313A1 (en) * 2015-05-21 2017-04-13 Google Inc. Neural Network Processor
CN105512723A (en) * 2016-01-20 2016-04-20 南京艾溪信息科技有限公司 Artificial neural network calculating device and method for sparse connection
CN108427990A (en) * 2016-01-20 2018-08-21 北京中科寒武纪科技有限公司 Neural computing system and method
CN108205518A (en) * 2016-12-19 2018-06-26 上海寒武纪信息科技有限公司 Obtain device, method and the neural network device of functional value
US20180300614A1 (en) * 2017-04-17 2018-10-18 Microsoft Technology Licensing, Llc Power-efficient deep neural network module configured for executing a layer descriptor list
CN107861916A (en) * 2017-11-10 2018-03-30 中国科学院计算技术研究所 A kind of method and apparatus for being used to perform nonlinear operation for neutral net
CN108647045A (en) * 2018-03-20 2018-10-12 科大讯飞股份有限公司 The implementation method and device of activation primitive, storage medium, electronic equipment
CN108898216A (en) * 2018-05-04 2018-11-27 中国科学院计算技术研究所 Activation processing unit applied to neural network
CN108921288A (en) * 2018-05-04 2018-11-30 中国科学院计算技术研究所 Neural network activates processing unit and the neural network processor based on the device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11681904B2 (en) 2019-08-13 2023-06-20 Samsung Electronics Co., Ltd. Processor chip and control methods thereof
US11842265B2 (en) 2019-08-13 2023-12-12 Samsung Electronics Co., Ltd. Processor chip and control methods thereof
CN110796247A (en) * 2020-01-02 2020-02-14 深圳芯英科技有限公司 Data processing method, device, processor and computer readable storage medium
CN110796247B (en) * 2020-01-02 2020-05-19 深圳芯英科技有限公司 Data processing method, device, processor and computer readable storage medium
CN111191779A (en) * 2020-01-02 2020-05-22 深圳芯英科技有限公司 Data processing method, device, processor and computer readable storage medium
CN111191766A (en) * 2020-01-02 2020-05-22 深圳芯英科技有限公司 Data processing method, device, processor and computer readable storage medium
CN111191766B (en) * 2020-01-02 2023-05-16 中昊芯英(杭州)科技有限公司 Data processing method, device, processor and computer readable storage medium
CN111191779B (en) * 2020-01-02 2023-05-30 中昊芯英(杭州)科技有限公司 Data processing method, device, processor and computer readable storage medium
CN113705821A (en) * 2021-08-24 2021-11-26 山东浪潮科学研究院有限公司 Method, device and medium for realizing waveform drawing of ADC (analog to digital converter) board card based on PCIE (peripheral component interface express)
CN113705821B (en) * 2021-08-24 2023-06-30 山东浪潮科学研究院有限公司 PCIE-based method, equipment and medium for realizing waveform drawing by ADC board card

Also Published As

Publication number Publication date
CN111126581B (en) 2021-01-12
CN111126581A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN109657788A (en) Data processing method, device and Related product
US10853623B2 (en) Method and apparatus for generating information
CN108805091B (en) Method and apparatus for generating a model
CN108830235B (en) Method and apparatus for generating information
CN109191514A (en) Method and apparatus for generating depth detection model
US10853722B2 (en) Apparatus for executing LSTM neural network operation, and operational method
CN112990312A (en) Model training method, image recognition method, device, equipment and storage medium
CN109583594B (en) Deep learning training method, device, equipment and readable storage medium
CN109871941A (en) Data processing method, device and Related product
CN111476719A (en) Image processing method, image processing device, computer equipment and storage medium
CN107590460A (en) Face classification method, apparatus and intelligent terminal
CN111383232A (en) Matting method, matting device, terminal equipment and computer-readable storage medium
CN106981099B (en) Method and apparatus for manipulating three-dimensional animated characters
CN109117758A (en) Method and apparatus for generating information
CN112906806A (en) Data optimization method and device based on neural network
CN113222170A (en) Intelligent algorithm and model for IOT (Internet of things) AI (Artificial Intelligence) collaborative service platform
CN106484614A (en) A kind of method of verification picture processing effect, device and mobile terminal
CN108595211A (en) Method and apparatus for output data
CN112906554B (en) Model training optimization method and device based on visual image and related equipment
US20220067495A1 (en) Intelligent processor, data processing method and storage medium
CN109241930A (en) Method and apparatus for handling supercilium image
CN110009100B (en) Calculation method of user-defined operator and related product
CN104079920B (en) The method and device of authentication image acquisition process
CN110353687A (en) The device of sitting posture analysis is carried out based on the buttocks of artificial intelligence and electronic skin contact data
CN113010873B (en) Image processing method, image processing device, nonvolatile storage medium and processor

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190419