IP Library Granted Patent US 11,468,304
Granted Patent B1
US 11,468,304 · App. 16/696,377 · Granted Oct 11, 2022

Synchronizing operations in hardware accelerator

Inventor: Ron Diamant (Santa Clara, CA)
Assignee: Amazon Technologies, Inc.
G06N3/063G06F15/8046G06F17/15
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,468,304
App. No.
16/696,377
Granted
Oct 11, 2022
Kind
B1
Abstract

In one example, a hardware accelerator comprises an event register that stores an event; a hardware execution engine; and a controller configured to: extract, from an instruction, parameters of an operation to be performed by the hardware execution engine, and a synchronization primitive of a plurality of synchronization primitives for the event; and based on the synchronization primitive, perform at least one of: controlling a start time of the operation at the hardware execution engine, or determining whether to access the event register. The synchronization primitives include a set operation to set the event and/or a wait operation to suspend the operation at the hardware execution engine until the event is set. The plurality of synchronization primitive defines different conditions to be satisfied in order to perform the set operation.

Claims (125)

1. A hardware accelerator, comprising:

a memory;

a plurality of event registers;

a first hardware accelerator unit including a first controller and a systolic array; and

a second hardware accelerator unit including a second controller and a post-processing engine,

wherein the first controller is configured to:

receive a first instruction;

extract, from the first instruction, first parameters of a first convolution operation and a first synchronization primitive;

control the systolic array to perform the first convolution operation based on the first parameters to generate a first output,

perform a write operation to store the first output at a location of the memory; and

based on the first synchronization primitive, set a first event register of the plurality of event registers when the write operation completes; and

wherein the second controller is configured to:

receive a second instruction;

extract, from the second instruction, second parameters of a post-processing operation, a second synchronization primitive;

based on the second synchronization primitive, determine whether the first event register is set;

responsive to determining that the first event register is set, perform a read operation at the location of the memory to retrieve the first output; and

control the post-processing engine to perform the post-processing operation on the first output to generate a second output.

2. The hardware accelerator of claim 1 , wherein the second instruction further includes a third synchronization primitive;

wherein the write operation is a first write operation;

wherein the second controller is configured to:

extract the third synchronization primitive from the second instruction; and

based on the third synchronization primitive, set a second event register of the plurality of event registers after the read operation completes; and

wherein the first controller is configured to:

receive a third instruction;

extract, from the third instruction, third parameters of a second convolution operation and a second write operation, and a fourth synchronization primitive;

based on the fourth synchronization primitive, determine whether the second event register is set; and

responsive to determining that the second event register is set:

control the systolic array to perform the second convolution operation to generate a third output; and

perform the second write operation to store the third output at the location of the memory.

3. The hardware accelerator of claim 1 , wherein the second controller is configured to, based on the second synchronization primitive, clear the first event register after determining that the first event register is set.

4. The hardware accelerator of claim 3 , wherein the post-processing engine is a first post-processing engine;

wherein the post-processing operation is a first post-processing operation;

wherein the read operation is a first read operation;

wherein the accelerator further comprises a third hardware accelerator unit, the third hardware accelerator unit including a third controller and a second post-processing engine;

wherein the third controller is configured to:

receive a third instruction;

extract, from the third instruction, fourth parameters of a second post-processing operation and a fourth synchronization primitive;

based on the fourth synchronization primitive, determine whether the first event register is set;

responsive to determining that the first event register is set, perform a second read operation at the location of the memory to retrieve the first output;

control the second post-processing engine to perform the second post-processing operation based on the first output to generate a fourth output; and

based on the fourth synchronization primitive, not clear the first event register after determining that the first event register is set.

5. The hardware accelerator of claim 1 , wherein the first synchronization primitive and the second synchronization primitive are selected from a plurality of synchronization primitives; and

wherein the plurality of synchronization primitives further includes:

a third synchronization primitive indicating that the execution of a first accelerator operation does not wait for an event register to be set; and

a fourth synchronization primitive indicating that no event register is set as part of the execution of a second accelerator operation.

6. A hardware accelerator, comprising:

an event register;

a hardware execution engine; and

a controller configured to:

extract, from an instruction, parameters of an operation to be performed by the hardware execution engine, and a synchronization primitive of a plurality of synchronization primitives for an event stored in the event register; and

based on the synchronization primitive, perform at least one of:

controlling a start time of the operation at the hardware execution engine, or determining whether to access the event register.

7. The hardware accelerator of claim 6 , wherein the instruction is part of an instruction set supported by the hardware accelerator; and

wherein each instruction of the instruction set includes parameters of an operation of a plurality of operations to be performed by the hardware execution engine and a synchronization primitive of the plurality of synchronization primitives.

8. The hardware accelerator of claim 6 , wherein the plurality of synchronization primitives comprises at least one of: a first synchronization primitive indicating a set operation to set the event, or a second synchronization primitive indicating a wait operation to suspend the operation at the hardware execution engine until the event is set.

9. The hardware accelerator of claim 7 , wherein the plurality of synchronization primitive indicates different conditions to be satisfied in order to perform the set operation; and

wherein the conditions comprises at least one of: completion of an operation at the hardware execution engine, completion of a write operation to a memory, or completion of a read operation to the memory.

10. The hardware accelerator of claim 7 , wherein the plurality of synchronization primitives comprises a wait and clear operation to wait for the event to be set and then to clear the event.

11. The hardware accelerator of claim 7 , wherein the plurality of synchronization primitives comprises at least one of: a third synchronization primitive indicating not to set an event, or a fourth synchronization primitive indicating not to wait for an event to be set.

12. The hardware accelerator of claim 6 , wherein the hardware execution engine and the controller are, respectively, a first hardware execution engine and a first controller;

wherein the hardware accelerator further comprises a second hardware execution engine and a second controller, and a memory;

wherein the instruction is a first instruction;

wherein the operation is a first operation;

wherein the parameters are first parameters;

wherein the synchronization primitive is a first synchronization primitive;

wherein the first controller is configured to:

control the first hardware execution engine to perform the first operation based on the first parameters to generate a first output;

perform a write operation to store the first output at the memory; and

based on the first synchronization primitive, set the event in the event register after the write operation completes; and

wherein the second controller is configured to:

receive a second instruction;

extract, from the second instruction, second parameters of a second operation to be performed by the second hardware execution engine, and a second synchronization primitive;

based on the second synchronization primitive, and based on the event being set, perform a read operation at the memory to obtain the first output; and

control the second hardware execution engine to perform the second operation based on the second parameters and the first output to generate a second output.

13. The hardware accelerator of claim 12 , further comprising a third controller;

wherein the read operation is a first read operation;

wherein the second controller is configured to, based on the second synchronization primitive, clear the event; and

wherein the third controller is configured to:

receive a third instruction;

extract, from the third instruction, a third synchronization primitive;

perform a second read operation at the memory to obtain the first output; and

based on the third synchronization primitive, not to clear the event.

14. The hardware accelerator of claim 12 , wherein the event and the event register are, respectively, a first event and a first event register;

wherein the hardware accelerator further comprises a third hardware execution engine and a third controller, and a second event register storing a second event;

wherein the write operation and the read operation are, respectively, a first write operation and a first read operation;

wherein the second controller is configured to:

extract a third synchronization primitive from the second instruction;

perform a second write operation to store the second output at the memory; and

based on the third synchronization primitive, set the second event at the second event register after the second write operation completes; and

wherein the third controller is configured to:

receive a third instruction;

extract, from the third instruction, third parameters of a third operation to be performed by the third hardware execution engine, and a third synchronization primitive;

based on the third synchronization primitive, determine whether the second event is set;

based on determining that the second event is set, perform a second read operation at the memory to obtain the second output; and

control the third hardware execution engine to perform the third operation based on the third parameters and the second output.

15. The hardware accelerator of claim 6 , wherein the hardware execution engine and the controller are, respectively, a first hardware execution engine and a first controller;

wherein the hardware accelerator further comprises a second hardware execution engine and a second controller, and a memory;

wherein the instruction is a first instruction;

wherein the operation is a first operation;

wherein the parameters are first parameters;

wherein the synchronization primitive is a first synchronization primitive;

wherein the first controller is configured to:

perform a read operation to obtain a first output from the memory; and

based on the first synchronization primitive, set the event in the event register after the read operation completes; and

wherein the second controller is configured to:

receive a second instruction;

extract, from the second instruction, second parameters of a second operation to be performed by the second hardware execution engine, and a second synchronization primitive;

based on the second synchronization primitive, and based on the event being set, control the second hardware execution engine to perform the second operation to generate a second output; and

perform a write operation to the memory to store the second output.

16. The hardware accelerator of claim 15 , wherein the first hardware execution engine comprises a systolic array;

wherein the second hardware execution engine comprises at least one of: an activation engine, or a pooling engine; and

wherein the memory comprises a partial sum buffer to store partial sums generated by the systolic array or intermediate outputs from the activation engine or the pooling engine.

17. A method of synchronizing operations among a plurality of hardware execution engines, the method comprising:

extracting, by a first controller and from a first instruction, first parameters of a first accelerator operation and a first synchronization primitive;

extracting, by a second controller and from a second instruction, second parameters of a second accelerator operation and a second synchronization primitive;

controlling, by the first controller, a first hardware execution engine to perform the first accelerator operation based on the first parameters;

setting, by the first controller, an event based on the first synchronization primitive;

determining, by the second controller and based on the second synchronization primitive, whether the event is set; and

responsive to determining that the event is set, controlling, by the second controller, a second hardware execution engine to perform the second accelerator operation based on the second parameters.

18. The method of claim 17 , wherein the first synchronization primitive indicates that the event is set after the first accelerator operation completes; and

wherein the first controller sets the event after the first accelerator operation completes.

19. The method of claim 18 , wherein the first accelerator operation comprises a write operation to store first output data to a memory; and

wherein the second accelerator operation comprises a read operation to read the first output data from the memory.

20. The method of claim 18 , wherein the first accelerator operation comprises a read operation to read first data from a location in a memory; and

wherein the second accelerator operation comprises a write operation to write second data to the location in the memory.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 26, 2019
From: DIAMANT, RON
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 051121/0817 →
Cited By (3)
US 12,204,897 US 12,399,720 US 12,710,961