# US 2019/0377831 A1 · Efficient in-memory representation of computation graph for fast serialization and comparison

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

- Number: US 2019/0377831 A1
- Document ID: US20190377831A1
- Status: Published application
- Kind: A1
- Application number: 16/005,513
- Filed: 2018-06-11
- Published: 2019-12-12
- Earliest claimed: 2018-06-11
- Assignees: Alibaba Group Holding Limited
- Applicants: Alibaba Group Holding Limited
- Inventors: Weifeng ZHANG
- Web page: https://patentgrep.com/patent/US20190377831A1

## CPC

- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06N 3/105: {Shells for specifying net layout}
- G06F 3/0611: {in relation to response time}
- G06F 3/0661: {Format or protocol conversion arrangements}
- G06F 3/067: {Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]}
- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 20/00: Machine learning
- G06F 12/0284: {Multiple user address space allocation, e.g. using different base addresses (interprocessor communication G06F15/163)}
- 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

Embodiments of the present disclosure introduce an offset-based representation for a computation graph of a neural network model. In this representation, the edges in the graph are implemented as offsets to the base address of the graph when the model is loaded into memory rather than pointers to address locations in memory. By replacing the pointer fields with offsets, the model in memory is no longer dependent on the allocation of memory. This overcomes the limitations of performance and/or power that is critical for comparing two models and copying a model to another memory location in latency sensitive applications and in mobile environments.

## Claims

### Claim 1

A method performed by a computing device for providing a data structure associated with a computation graph having a plurality of nodes, the method comprising:
allocating one or more memory blocks associated with the computation graph; and
assigning a plurality of memory units of the allocated one or more memory blocks, wherein each memory unit of the plurality of memory units is associated with a node of the computation graph and includes:
a first section assigned a value corresponding to a current node of the plurality of nodes, and
a second section assigned an offset value referencing another memory unit of the plurality of memory units, wherein the another memory unit is associated with another node coupled to the current node via an edge.

### Claim 2 (depends on 1)

The method of claim 1, further comprising assigning the value corresponding to an operand value of the current node.

### Claim 3 (depends on 2)

The method of claim 2, wherein the another node is an operation node that performs an operation using the operand value.

### Claim 4 (depends on 3)

The method of claim 3, wherein the another memory unit includes a first section configured to have either a pre-set value or a value associated with an output of the operation using the operand value.

### Claim 5 (depends on 1)

The method of claim 1, further comprising assigning the offset value based on a base address of a memory block of the allocated one or more memory blocks.

### Claim 6 (depends on 1)

The method of claim 1, further comprising assigning the offset value based on a base address of a memory sub-block of the allocated one or more memory blocks.

### Claim 7 (depends on 1)

The method of claim 1, wherein each memory unit of the plurality of memory units has a same size.

### Claim 8 (depends on 1)

The method of claim 1, further comprising assigning a root memory unit corresponding to a root node of the computation graph, wherein the root memory unit includes:
a first section assigned a value;
a second section assigned a NULL or negative value.

### Claim 9 (depends on 1)

The method of claim 1, further comprising generating a fast key lookup for configuring the data structure.

### Claim 10 (depends on 9)

The method of claim 9, wherein the fast key lookup is a digital signature.

### Claim 11

A computing device for providing a data structure associated with a computation graph having a plurality of nodes, the computing device comprising:
a memory configured to store a set of instructions; and
a processor configured to execute the set of instructions to cause the computing device to:
allocate one or more memory blocks associated with the computation graph; and
assign a plurality of memory units of the allocated one or more memory blocks, wherein each memory unit of the plurality of memory units is associated with a node of the computation graph and includes:
a first section assigned a value corresponding to a current node of the plurality of nodes, and
a second section assigned an offset value referencing another memory unit of the plurality of memory units, wherein the another memory unit is associated with another node coupled to the current node via an edge.

### Claim 12 (depends on 11)

The computing device of claim 11, wherein the processor is configured to execute the set of instructions to cause the computing device to further perform:
assign the value corresponding to an operand value of the current node.

### Claim 13 (depends on 12)

The computing device of claim 12, wherein the another node is an operation node that performs an operation using the operand value.

### Claim 14 (depends on 13)

The computing device of claim 13, wherein the another memory unit includes a first section configured to have either a pre-set value or a value associated with an output of the operation using the operand value.

### Claim 15 (depends on 11)

The computing device of claim 11, wherein the processor is configured to execute the set of instructions to cause the computing device to further perform:
assign the offset value based on a base address of a memory block of the allocated one or more memory blocks.

### Claim 16 (depends on 11)

The computing device of claim 11, wherein the processor is configured to execute the set of instructions to cause the computing device to further perform:
assign the offset value based on a base address of a memory sub-block of the allocated one or more memory blocks.

### Claim 17 (depends on 11)

The computing device of claim 11, wherein each memory unit of the plurality of memory units has a same size.

### Claim 18 (depends on 11)

The computing device of claim 11, wherein the processor is configured to execute the set of instructions to cause the computing device to further perform:
assign a root memory unit corresponding to a root node of the computation graph, wherein the root memory unit includes:
a first section assigned a value;
a second section assigned a NULL or negative value.

### Claim 19 (depends on 11)

The computing device of claim 11, wherein the processor is configured to execute the set of instructions to cause the computing device to further perform:
generate a fast key lookup for configuring the data structure.

### Claim 20 (depends on 19)

The computing device of claim 19, wherein the fast key lookup is a digital signature.

### Claim 21

A non-transitory computer readable medium that stores a set of instructions that is executable by at least one processor of a computing device to cause the computing device to perform a method for providing a data structure associated with a computation graph having a plurality of nodes, the method comprising:
allocating one or more memory blocks associated with the computation graph; and
assigning a plurality of memory units of the allocated one or more memory blocks, wherein each memory unit of the plurality of memory units is associated with a node of the computation graph and includes:
a first section assigned a value corresponding to a current node of the plurality of nodes, and
a second section assigned an offset value referencing another memory unit of the plurality of memory units, wherein the another memory unit is associated with another node coupled to the current node via an edge.

### Claim at position 22

22-30. (canceled)
