Memory allocation method and device of neural network

A neural network and memory allocation technology, applied in the field of deep learning, can solve problems such as large memory and unreasonable memory allocation, and achieve the effect of reducing memory footprint and optimizing memory allocation
CN110597616AActive Publication Date: 2019-12-20HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN Β· China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Publication Date
2019-12-20

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention provides a memory allocation method and device for a neural network, and the neural network needs to occupy N memory blocks during operation, and the method comprises the following steps: determining the information of the N memory blocks; sorting the N memory blocks from large to small according to the sizes of the N memory blocks to obtain a sorting sequence of the N memory blocks;allocating a first memory block to the neural network for operation of a first node set in the neural network; judging whether the nth memory block can reuse the memory blocks in the allocated set ornot, wherein the allocated set comprises a memory block allocated to the neural network; and if the nth memory block can reuse the memory block in the allocated set, allocating the reusable memory block to the neural network for operation of an nth node set in the neural network, and updating the allocated set; and sequentially executing the judgment from n = 2 to n = N according to the sorting sequence. By adopting the method and the device provided by the invention, the memory allocation of the neural network can be optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field

[0001] This application relates to the field of deep learning technology, and in particular to a memory allocation method and device of a neural network. Background technique

[0002] In the current field of computer deep learning, in order to achieve better algorithm accuracy, deep learning neural networks are becoming more and more complex, and hardware capabilities limit the development of neural networks in a deeper direction, and memory optimization must be carried out. In order to achieve memory optimization, the industry usually adopts the following memory allocation strategies:

[0003] Run the entire neural network, and then allocate memory for the entire neural network in the order in which it runs. For example, the neural network needs to occupy 100M memory block, 10M memory block and 50M memory block in sequence during operation. Then in the prior art, when the neural network applies for a 100M memory block, a 100M memory block can be allocated to the ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More