# US 10,956,535 B2 · Operating a neural network defined by user code

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

- Number: US 10,956,535 B2
- Document ID: US10956535B2
- Status: Granted
- Kind: B2
- Application number: 15/624,115
- Filed: 2017-06-15
- Published: 2018-11-22
- Granted: 2021-03-23
- Earliest claimed: 2017-05-22
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Frank Torsten Bernd Seide; Ryota Tomioka; Wilhelm Richert; Bruno S Bozza
- Web page: https://patentgrep.com/patent/US10956535B2

## CPC

- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06F 9/46: Multiprogramming arrangements
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/0442: characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
- G06N 3/0499: Feedforward networks
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/09: Supervised learning
- G06N 3/105: {Shells for specifying net layout}
- G06N 3/048: Activation functions
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Disclosed in some examples are methods, systems, machine-readable media, and devices which operate a neural network defined by user code. A method includes identifying, operations from user code that are integral in operating the neural network, combining a subset of the identified operations into a single processing sequence to be transmitted to an array of hardware processors, performing operations that are not integral in operation of the neural network in a separate thread of execution from the operations that are integral in operating the neural network; and mapping results to the combined operations that were included in the single processing sequence.

## Claims

### Claim 1

A system for operating a neural network defined by user code, the system comprising:
a hardware processor; and
a memory, communicatively coupled to the processor and including instructions, which when performed by the processor, cause the system to perform operations comprising:
identifying, while parsing the user code, a first subset of commands from the user code that operate the neural network and whose performance can be delayed;
identifying, from commands not included in the first subset, a second subset of linear commands that can be combined into a multi-dimensional single command and including inputs to the combined commands in the multi-dimensional single command;
transmitting the multi-dimensional single command to an array of hardware processors to be performed;
parsing results of the multi-dimensional single command to map results to the combined commands that were included in the second subset of linear commands; and
pre-allocating memory for the multi-dimensional single command according to a number of processors available in the array of hardware processors.

### Claim 2 (depends on 1)

The system of claim 1, wherein the first subset of commands are performed in a separate thread of execution from the second subset of commands.

### Claim 3 (depends on 1)

The system of claim 1, wherein the operations further comprise: comparing an amount of time saved by adding filler rows in the multi¬dimensional single command with an amount of time necessary to add and calculate the values in the filler row; and adding the filler rows into the multi¬dimensional single command in response to the time saved by adding the filler row being more than the time needed to add and calculate the values in the filler row.

### Claim 4 (depends on 1)

The system of claim 1, wherein the operations are performed in real-time during operation of the neural network.

### Claim 5 (depends on 1)

The system of claim 1, wherein a portion of the user code is selected from pre-defined segments of code, the identifying steps performed prior to executing the input code.

### Claim 6 (depends on 1)

The system of claim 1, wherein the second subset of commands include single dimensional vector multiplications and the multi-dimensional single command performs the vector calculations by a single multiplication of a two-dimensional matrix.

### Claim 7

A tangible storage device that stores instructions which when performed by a machine, cause the machine to perform operations comprising:
separating commands whose performance can be delayed from operations that are integral in operating a neural network;
combining a subset of the commands that are integral in operating the neural network into a single processing sequence to be transmitted to an array of hardware processors:
transmitting the single processing sequence to the array of hardware processors;
parsing results of the single processing sequence to map results to the commands in the single processing sequence; and
pre-allocating memory for the single processing sequence according to a number of processors available in the array of hardware processors.

### Claim 8 (depends on 7)

The tangible storage device of claim 7, wherein the operations further comprise comparing an amount of time saved by adding filler rows in the single processing sequence with an amount of time necessary to add and calculate the values in the filler row; and adding the filler rows into the single processing sequence in response to the time saved by adding the filler row being more than the time needed to add and calculate the values in the filler row.

### Claim 9 (depends on 7)

The tangible storage device of claim 7, wherein the operations of the method are performed in real-time while operating the neural network.

### Claim 10 (depends on 7)

The tangible storage device of claim 7, wherein a portion of the input code is selected from pre-defined segments of code, the identifying steps performed prior to a user completing the input code.

### Claim 11 (depends on 7)

The tangible storage device of claim 7, wherein the subset of commands that are integral in operating the neural network are transmitted to the array of hardware processors in a first thread of execution and the subset of commands a hose execution can be delayed are executed in a second thread of execution.

### Claim 12 (depends on 11)

The tangible storage device of claim 11, wherein the threads of execution are fibers configured as part of an application that is operating the neural network.

### Claim 13

A computer-implemented method for operating a neural network defined by user code, the method comprising:
identifying, while parsing user code, operations from the user code that are integral in operating the neural network;
combining a subset of the identified operations into a single processing sequence to be transmitted to an array of hardware processors and including padding values that fill space left in the single processing sequence not occupied by the subset of identified operations;
performing operations that are not integral in operation of the neural network in a separate thread of execution from the operations that are integral in operating the neural network;
parsing results of the single processing sequence to map the results to the combined operations that were included in the single processing sequence.

### Claim 14 (depends on 13)

The computer-implemented method of claim 13, wherein the thread of execution is an application fiber.

### Claim 15 (depends on 13)

The computer-implemented method of claim 13, wherein adding the padding values is in response to an amount of time saved by adding the padding values exceeding an amount of time necessary to process the padding values in the single processing sequence.

### Claim 16 (depends on 13)

The computer-implemented method of claim 13, wherein the steps of the method are performed in real-time during operation of the neural network model.

### Claim 17 (depends on 13)

The computer-implemented method of claim 13, wherein a portion of the input code is selected from pre-defined segments of code, the identifying step is performed prior to execution of the user code.

### Claim 18 (depends on 13)

The computer-implemented method of claim 13, further comprising pre-allocating memory for the single processing sequence according to a number of processors available in the array of hardware processors.
