US 12,430,110 B1
Global modulo allocation in neural network compilation
Hongbin Zheng, San Jose, CA (US); Randy Renfu Huang, Morgan Hill, CA (US); and Robert Geva, Cupertino, CA (US)
Assigned to Amazon Technologies, Inc., Seattle, WA (US)
Filed by Amazon Technologies, Inc., Seattle, WA (US)
Filed on Aug. 28, 2023, as Appl. No. 18/238,663.
Application 18/238,663 is a continuation of application No. 17/326,175, filed on May 20, 2021, granted, now 11,809,849.
This patent is subject to a terminal disclaimer.
Int. Cl. G06F 8/41 (2018.01); G06F 9/38 (2018.01); G06F 13/28 (2006.01); G06N 3/04 (2023.01)
CPC G06F 8/452 (2013.01) [G06F 9/3853 (2013.01); G06F 13/28 (2013.01); G06N 3/04 (2013.01)] 14 Claims
OG exemplary drawing
 
1. A compiler-implemented method comprising:
receiving a dataflow graph of a neural network, the neural network comprising a neural network operator;
receiving information indicating a quantity of computation resources and a quantity of memory resources of a hardware accelerator assigned to execute the neural network operator;
generating, based on the dataflow graph, a loop-nest of the neural network operator, wherein elements of a first tensor are associated with first indices determined by a first induction variable of a parent loop of the loop-nest, and wherein elements of a second tensor are associated with second indices determined by a second induction variable of a child loop nested within the parent loop;
determining, based on the information and based on a first modulo operator applied to the first indices and a second modulo operator applied to the second indices to map the first and second indices to remainders, a number of iterations to be included in a batch to access the first tensor and the second tensor, wherein the number of iterations in the batch are to be executed in parallel by the hardware accelerator;
generating a schedule of execution of a set of batches including the batch; and
generating executable instructions to be executed by the hardware accelerator based on the schedule of execution.