# US 2025/0165282 A1 · Task context switch for neural processor circuit

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

- Number: US 2025/0165282 A1
- Document ID: US20250165282A1
- Status: Published application
- Kind: A1
- Application number: 19/001,159
- Filed: 2024-12-24
- Published: 2025-05-22
- Earliest claimed: 2021-01-22
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Christopher L. MILLS; Kenneth W. Waters
- Web page: https://patentgrep.com/patent/US20250165282A1

## CPC

- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/045: Combinations of networks
- G06N 3/063: using electronic means
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A neural processor includes neural engines for performing convolution operations on input data corresponding to one or more tasks to generate output data. The neural processor also includes a data processor circuit coupled to external system memory. The data processor circuit includes a buffer for storing the output data from the neural engines. The neural processor further includes a task manager coupled to the data processor circuit. The task manager receives a context-switch task. The context-switch task specifies a switch of the data processor circuit from handling an outgoing task to an incoming task. The task manager sends configuration data of the context-switch task to cause the data processor circuit to transmit the output data corresponding to the outgoing task from the buffer to the external system memory. The data processor circuit also fetches data corresponding to the incoming task from the external system memory to the buffer.

## Claims

### Claim 1

(canceled)

### Claim 2

A task manager circuit, comprising:
a first task queue;
a second task queue; and
a controller coupled to the first task queue and the second task queue and configured to:
receive a context-switch task specifying a switch for a data processor circuit from handling a first task to a second task, wherein the first task or the second task is stored in the first task queue or the second task queue; and
transmit configuration data of the context-switch task to the data processor circuit to cause the data processor circuit to:
transmit output data corresponding to the first task generated by a neural engine circuit of a plurality of neural engine circuits to an external system memory that is shared by the plurality of neural engine circuits; and
fetch data corresponding to the second task from the external system memory to a buffer of the data processor circuit.

### Claim 3 (depends on 2)

The task manager circuit of claim 2, wherein the first task is assigned to a first neural network and the second task is assigned to a second neural network that is different from the first neural network.

### Claim 4 (depends on 2)

The task manager circuit of claim 2, wherein the first task queue comprises a hardware queue that comprises memory slots configured to store a predetermined number of segments including one or more task descriptors.

### Claim 5 (depends on 2)

The task manager circuit of claim 2, wherein the first task queue comprises one or more registers configured to store values that represent states and a configuration of the first task queue.

### Claim 6 (depends on 2)

The task manager circuit of claim 2, wherein the first task queue comprises a free space register configured to indicate a number of free slots in the first task queue that are free to store one or more segments including one or more task descriptors.

### Claim 7 (depends on 2)

The task manager circuit of claim 2, wherein the first task queue comprises a state register configured to store a state selected from an enabled state, a stopped state, a suspended state, and a disabled state.

### Claim 8 (depends on 2)

The task manager circuit of claim 2, wherein the first task queue comprises a queue priority register configured to store a priority parameter for the first task queue.

### Claim 9 (depends on 2)

The task manager circuit of claim 2, wherein the first task queue has a first priority and the second task queue has a second priority higher than the first priority.

### Claim 10 (depends on 2)

The task manager circuit of claim 2, wherein the first task is configured to be stored in a first segment of the first task queue, the second task is configured to be stored in a second segment of the first task queue, and the context-switch task is configured to be stored between the first segment and the second segment.

### Claim 11 (depends on 2)

The task manager circuit of claim 2, wherein the first task is configured to be stored in the first task queue and the second task is configured to be stored in the second task queue different from the first task queue.

### Claim 12

A method of performing neural processing operations, comprising:
receiving, by a task manager circuit, a context-switch task specifying a switch for a data processor circuit from handling a first task to a second task, wherein the first task or the second task is stored in a first task queue or a second task queue;
transmitting configuration data of the context-switch task to the data processor circuit;
transmitting, by the data processor circuit, output data corresponding to the first task generated by a neural engine circuit of a plurality of neural engine circuits to an external system memory that is shared by the plurality of neural engine circuits; and
fetching data corresponding to the second task from the external system memory to a buffer of the data processor circuit.

### Claim 13 (depends on 12)

The method of claim 12, further comprising:
assigning the first task to a first neural network; and
assigning the second task to a second neural network that is different from the first neural network.

### Claim 14 (depends on 12)

The method of claim 12, wherein the first task queue comprises a hardware queue that comprises memory slots to store a predetermined number of segments including one or more task descriptors.

### Claim 15

A neural processor circuit, comprising:
one or more neural engine circuits configured to perform convolution operations on input data corresponding to one or more tasks to generate output data;
a data processor circuit coupled to the one or more neural engine circuits and coupled to a system memory, the data processor circuit comprising a buffer configured to store the output data from the one or more neural engine circuits; and
a task manager circuit comprising a first task queue, a second task queue, and a controller coupled to the first task queue and the second task queue and configured to:
receive a context-switch task specifying a switch for the data processor circuit from handling a first task to a second task, wherein the first task or the second task is stored in a first task queue or a second task queue; and
transmit configuration data of the context-switch task to the data processor circuit to cause the data processor circuit to:
transmit output data corresponding to the first task generated by the one or more neural engine circuits and stored in a buffer of the data processor circuit to an external system memory that is shared by a plurality of neural engine circuits; and
fetch data corresponding to the second task from the external system memory to the buffer.

### Claim 16 (depends on 15)

The neural processor circuit of claim 15, wherein the first task queue comprises a hardware queue that comprises memory slots configured to store a predetermined number of segments including one or more task descriptors.

### Claim 17 (depends on 15)

The neural processor circuit of claim 15, wherein the first task queue comprises one or more registers configured to store values that represent states and configuration of the first task queue.

### Claim 18 (depends on 15)

The neural processor circuit of claim 15, wherein the first task queue comprises a free space register configured to indicate a number of free slots in the first task queue that are free to store one or more segments including one or more task descriptors.

### Claim 19 (depends on 15)

The neural processor circuit of claim 15, wherein the first task queue comprises a state register configured to store a state selected from an enabled state, a stopped state, a suspended state, and a disabled state; and
wherein the first task queue comprises a queue priority register configured to store a priority parameter for the first task queue.

### Claim 20 (depends on 15)

The neural processor circuit of claim 15, wherein the first task is configured to be stored in a first segment of the first task queue, the second task is configured to be stored in a second segment of the first task queue, and the context-switch task is configured to be stored between the first segment and the second segment.

### Claim 21 (depends on 15)

The neural processor circuit of claim 15, wherein the first task is configured to be stored in the first task queue and the second task is configured to be stored in the second task queue different from the first task queue.
