Method and system for feature-maps allocation in system-cache using prioritized linear scan for neural network acceleration
A method and system for allocation of feature-maps in a system cache in a DRAM includes receiving input feature maps associated with data at the system cache, and then creating clusters of spatially co-located features maps and calculating a priority of each of the clusters based on one or more cluster parameters. The method further includes placing the clusters based on the execution order and the calculated priorities of each of the clusters to obtain a prioritized plurality of the clusters. Thereafter, a first address is assigned to each of the prioritized clusters and then an overlap is determined of assignment of addresses to each of consecutive clusters of the prioritized clusters based on a conflict of life parameter. The method further includes reassigning a second address to each of the prioritized clusters based on a determination result and the calculated priorities of each of the clusters.
1 . A method for allocation of feature maps in a system cache in a dynamic random access memory (DRAM), the method comprising:
receiving a plurality of input feature maps associated with a data at the system cache;
creating a plurality of clusters of spatially co-located features maps of the plurality of input feature maps;
calculating a priority of each cluster of the plurality of clusters based on one or more cluster parameters;
placing the plurality of clusters in the DRAM based on an execution order and calculated priorities of each cluster of the plurality of clusters to obtain a plurality of prioritized clusters;
assigning a respective first address in the DRAM to each prioritized cluster of the plurality of prioritized clusters;
determining an overlap of address assignments of consecutive clusters among the plurality of prioritized clusters based on a conflict of life parameter; and
reassigning a respective second address in the DRAM to each prioritized cluster of the plurality of prioritized clusters based on a result of determining the overlap and calculating the priority of each cluster of the plurality of clusters.
2 . The method as claimed in the claim 1 , further comprising:
determining a life of each cluster of the plurality of clusters based on an execution order of each input feature map of the input feature maps; and
determining the conflict of life parameter in each respective first address and each respective second address based on the determined life of each cluster of the plurality of clusters.
3 . The method as claimed in the claim 2 , wherein the one or more cluster parameters comprises at least one of a cluster size, a cluster access frequency, and cluster life.
4 . The method as claimed in the claim 1 , further comprising:
parsing the plurality of clusters; and
sorting the plurality of clusters,
wherein the respective first address of each prioritized cluster of the plurality of prioritized clusters is assigned to a lower order address near to a zero offset in the DRAM, and
wherein the plurality of clusters other than the plurality of the prioritized clusters are assigned to a higher order address in the DRAM.
5 . The method as claimed in the claim 2 , wherein after determining the conflict of life parameter, the method comprises:
determining a priority of the plurality of prioritized clusters;
based on a result of the determination of the priority of the plurality of prioritized clusters, wherein reassigning the respective second address to each prioritized cluster of the plurality of prioritized clusters, comprises at least one of:
assigning a plurality of clusters having a highest priority to a lower order address near to a zero offset in the DRAM;
assigning a plurality of clusters having a low priority to a higher order address in the DRAM; and
assigning a plurality of clusters having mid priority to a middle order address in the DRAM.
6 . A neural network (NN) system, for allocation of a feature map in a system cache of a dynamic random access memory (DRAM), and the system cache is communicatively coupled with the DRAM, the NN system comprising at least one processor configured to:
receive a plurality of input feature maps associated with a data at the system cache;
create a plurality of clusters of spatially co-located features maps of the plurality of input feature maps;
calculate a priority of each cluster of the plurality of clusters based on one or more cluster parameters;
place the plurality of clusters in the DRAM based on an execution order and calculated priorities of each cluster of the plurality of clusters to obtain a plurality of prioritized clusters;
assign a respective first address in the DRAM to each prioritized cluster of the plurality of prioritized clusters;
determine an overlap of address assignments of consecutive clusters among the plurality of prioritized clusters based on a conflict of life parameter; and
reassign a respective second address in the DRAM to each prioritized cluster of the plurality of prioritized clusters based on a result of determining the overlap and calculating the priority of each cluster of the plurality of clusters.
7 . The NN system as claimed in the claim 6 , wherein the at least one processor is further configured to:
determine a life of each cluster of the plurality of clusters based on an execution order of each input feature map of the input feature maps; and
determine the conflict of life parameter in each respective first address and each respective second address based on the determined life of each cluster of the plurality of clusters.
8 . The NN system as claimed in the claim 7 , wherein the one or more cluster parameters comprises at least one of a cluster size, a cluster access frequency, and cluster life.
9 . The NN system as claimed in the claim 6 , wherein the at least one processor is further configured to:
parse the plurality of clusters; and
sort the plurality of clusters,
wherein the respective first address of each prioritized cluster of the plurality of prioritized clusters is assigned to a lower order address near to a zero offset in the DRAM, and
wherein the plurality of clusters other than the plurality of prioritized clusters are assigned to a higher order address in the DRAM.
10 . The NN system as claimed in the claim 7 , wherein after determining the conflict of life parameter, the at least one processor is further configured to:
determine a priority of the plurality of prioritized clusters;
based on a result of the determination of the priority of the plurality of prioritized clusters, wherein reassigning the respective second address to each prioritized cluster of the plurality of prioritized clusters, comprises at least one of:
assigning a plurality of clusters having a highest priority to a lower order address near to a zero offset in the DRAM;
assigning a plurality of clusters having a low priority to a higher order address in the DRAM; and
assigning a plurality of clusters having mid priority to a middle order address in the DRAM
based on a result of the determination of the priority of the prioritized plurality of the clusters, the reassigning of the second address to each of the prioritized plurality of the clusters, comprises at least one of:
assigning a plurality of clusters having a highest priority to a lower order address near to a zero offset in the DRAM;
assigning a plurality of clusters having a low priority to a higher order address in the DRAM; and
assigning a plurality of clusters having mid priority to a middle order address in the DRAM.