# US 11,112,980 B2 · Method and apparatus for allocating memory space for driving neural network

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,112,980 B2
- Document ID: US11112980B2
- Status: Granted
- Kind: B2
- Application number: 16/561,303
- Filed: 2019-09-05
- Published: 2020-06-04
- Granted: 2021-09-07
- Earliest claimed: 2018-12-04
- Assignees: Samsung Electronics Co., Ltd.
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Joonho Song
- Web page: https://patentgrep.com/patent/US11112980B2

## CPC

- G06F 3/0631: {by allocating resources to storage systems}
- G06N 5/046: Forward inferencing; Production systems
- G06F 3/0604: {Improving or facilitating administration, e.g. storage management}
- G06F 3/0673: {Single storage device}
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/063: using electronic means
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method of allocating a memory for driving a neural network including obtaining first capacity information of a space to store an input feature map of a first layer from among the layers of the neural network, and second capacity information of a space to store an output feature map of the first layer, and allocating a first storage space to store the input feature map in the memory based on an initial address value of the memory and the first capacity information and a second storage space to store the output feature map in the memory based on a last address value of the memory and the second capacity information.

## Claims

### Claim 1

A method of allocating a memory to layers of a neural network, the method comprising:
obtaining first capacity information of a space to store an input feature map of a first layer from among the layers of the neural network, and second capacity information of a space to store an output feature map of the first layer; and
allocating a first storage space to store the input feature map in the memory based on an initial address value of the memory and the first capacity information and a second storage space to store the output feature map in the memory based on a last address value of the memory and the second capacity information,
wherein the first store e space corresponds to a space from the initial address value to a first address value of the memory, and
wherein the second storage space corresponds to a space from a second address value to the last address value of the memory.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
allocating a space to store an input feature map of a second layer subsequent to the first layer, to the second storage space;
obtaining third capacity information of a space to store an output feature map of the second layer; and
allocating a third storage space to store the output feature map of the second layer in the memory based on the initial address value of the memory and the third capacity information.

### Claim 3 (depends on 1)

The method of claim 1, wherein:
the obtaining further comprises obtaining fourth capacity information of a space to store a weight map for an operation with the input feature map, and
the allocating further comprises allocating a space to store the weight map between the first storage space and the second storage space based on the fourth capacity information.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
dividing a weight map of the first layer into sub-weight maps;
dividing the first layer into sublayers and respectively allocating the sub-weight maps to the sublayers;
obtaining sub-capacity information of spaces to respectively store the sub-weight maps; and
allocating, to each of the sublayers, a space to store a sub-weight map of the sub-weight maps based on the respective sub-capacity information of the sub-weight map, between the first storage space and the second storage space.

### Claim 5 (depends on 4)

The method of claim 4, wherein channels of the output feature map are respectively generated from an operation between each of the sub-weight maps and the input feature map, and
sequentially storing the channels of the output feature map in the second storage space.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
selecting an input tile in the input feature map of the first layer;
obtaining capacity information about a capacity to respectively store the input tile, an output tile corresponding to the input tile, and a weight map of the first layer; and
allocating spaces to respectively store the input tile, the output tile, and the weight map in the memory based on the capacity information.

### Claim 7 (depends on 1)

The method of claim 1, wherein the memory is located in a processor of a device driving the neural network.

### Claim 8 (depends on 1)

A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the method of claim 1.

### Claim 9

A neural network device comprising:
a memory; and
a processor configured to drive to execute instructions to drive a neural network to:
obtain first capacity information of a space to store an input feature map of a first layer from among layers of the neural network, and second capacity information of a space to store an output feature map of the first layer, and
allocate a first storage space to store the input feature map in the memory based on an initial address value of the memory and the first capacity information and a second storage space to store the output feature map in the memory based on a last address value of the memory and the second capacity information,
wherein the first storage space corresponds to a space from the initial address value to a first address value of the memo and the second storage space corresponds to a space from a second address value to the last address value of the memory.

### Claim 10 (depends on 9)

The neural network device of claim 9, wherein the processor is further configured to:
allocate a space to store an input feature map of a second layer subsequent to the first layer, to the second storage space;
obtain third capacity information of a space to store an output feature map of the second layer; and
allocate a third storage space to store the output feature map of the second layer in the memory based on the initial address value of the memory and the third capacity information.

### Claim 11 (depends on 9)

The neural network device of claim 9, wherein the processor is further configured to:
obtain fourth capacity information of a space to store a weight map for an operation with the input feature map; and
allocate a space to store the weight map between the first storage space and the second storage space based on the fourth capacity information.

### Claim 12 (depends on 9)

The neural network device of claim 9, wherein the processor is further configured to:
divide a weight map of the first layer into sub-weight maps,
divide the first layer into sublayers, and respectively allocate the sub-weight maps to the sublayers;
obtain sub-capacity information of spaces to respectively store the sub-weight maps; and
allocate, to each of the sublayers, a space to store a sub-weight map of the sub-weight maps based on the respective sub-capacity information of the sub-weight map, between the first storage space and the second storage space.

### Claim 13 (depends on 12)

The neural network device of claim 12, wherein the processor is further configured to:
generate channels of the output feature map from an operation between each of the sub-weight maps and the input feature map; and
sequentially store each of the channels of the output feature map.

### Claim 14 (depends on 9)

The neural network device of claim 9, wherein the processor is further configured to:
select an input tile in the input feature map of the first layer;
obtain capacity information about a capacity to respectively store the input tile, an output tile corresponding to the input tile, and the weight map of the first layer; and
allocate spaces to respectively store the input tile, the output tile, and the weight map in the memory based on the capacity information.

### Claim 15 (depends on 9)

The neural network device of claim 9, wherein the memory is located in the processor.
